select with ino:id as value

X-Application Version: 4.1.1
Tamino Version : 4.1.1
Platform : Win2k
WebContainer : Tomcat 4.1.1
JDK Version : 1.4.1

I am trying to populate a “select” tag with both text and value XQuerys. However, I want the values to be the ino:id.

The only way to get the ino:id that I can see is to use the tf:getInoId($x) function. We can enclose it in xq:attribute (also xq:element I guess) trying to get it past the element/attribute check, but I’m thinking the Doctype comparison is blowing things up.

If in the SelectTag.jsp example, you change the value query to be:
return tf:getInoId($x)
return xq:attribute{tf:getInoId($x)}</xq:attribute>

neither of these seems to work. Any ideas?

Hi Joel,

as you might know, with the new Tamino 4.1.1 documents do not contain an ino:id attribute anymore and as you mentioned right the XQuery fuction ‘tf:getInoId($x)’ would deliver the ino:id.

Unfortunately, this does not work with the xapp:select tag at present, because we ‘clean’ the documents return by queries from the ino:id information an keep this information in specilal nodeLocation objects belonging to their documents, therefore it is not possible to use the ino:id information in the xapp:select tag.

Now? I can offer you a workaround. As an example I have adapted the Query/PropertyQuery.jsp example.
Instead of using the xapp:select tag you can use a combination of dicrectcommand and browse tag.

1. Process a Xquery with a directcommand and store the result by setting the document attribute.
2. Browse over the result set and fill the HTML select manually.


<!-- Define the query-->
<xapp:setvar name="textVal" scope="session">
   for $x in input()/Property/Address/State return $x

<!process query-->
<xapp:directcommand type="xquery" collection="${xappCollection$}" document="select" arg="${textVal$}"/>

<!-- Fill HTML select tag -->
<select name="varSelection">
    <option value=""></option>
    <xapp:browse pagesize="1000" document="select" >
       <option value="<xapp:display select="$ID"/>"><xapp:display select="/State"/></option>

This solution is not totally convenient, but it will hopefully solve your problem at present.



As we could see in the past there is a lot of interest in the xapp:select tag. Therefore, we opened a discussion topic about this tag to make a proposal for its redesign (see Redesign of xapp:select).

It would be nice if you could read the proposal and give us feedback. The question is: Does the proposed xapp:select meet your requirements when working with HTML select tags?

X-Application Version: 4.1.1, 3.1.3
Tamino Version : 4.1.1, 3.1
Platform : Win2k, WinXP, Solaris, Linux, …
WebContainer : Tamocat 4.1.1, Tomcat 3.3.1
JDK Version : 1.4.1, 1.3.1


we have just posted an inprovement for the xapp:select tag in our contribution section.

Please have a looka at:xapp:select improvement