[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: using node-set on a query result
Your stylesheet is correctly displaying the string-value of the <Text/> element. The string value of the <Text/> element is the concatenation of all its descendant text nodes. Since there are no descendant text nodes, the string-value is the empty string, "". Perhaps you meant <xsl:copy-of> instead of <xsl:value-of>? Michael Kay > -----Original Message----- > From: Leona Slepetis [mailto:LSlepetis@xxxxxxxxxxxxxxxx] > Sent: 12 September 2004 04:47 > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > Subject: using node-set on a query result > > > > > > > > Hi All, > > I'm trying to build a tree to be used in other places in my > stylesheet. > > <?xml version="1.0" encoding="UTF-8"?> > <xsl:transform > xmlns:xsl=" http://www.w3.org/1999/XSL/Transform " version="1.0" > xmlns:esql=" http://apache.org/cocoon/SQL/v2 " > xmlns:exsl=" http://exslt.org/common " > extension-element-prefixes="exsl"> > <xsl:variable name="qinfo"> > <Question> > <esql:connection> > <esql:autocommit>false</esql:autocommit> > <esql:pool>MYDB</esql:pool> > <esql:execute-query> > <esql:query> > select text from question where order = 1 > </esql:query> > <esql:results> > <esql:row-results> > <Text><esql:get-string column="text" /></Text> > </esql:row-results> > </esql:results> > </esql:execute-query> > </esql:connection> > </Question> > </xsl:variable> > <xsl:template match="buildsomething"> > ... > <td>XXXXX<xsl:value-of select="exsl:node-set($qinfo)"/>XXXXX<td> > <td>YYYYY<xsl:value-of > select="exsl:node-set($qinfo)//Text"/>YYYYY<td> > ... > </xsl:template> > </xsl:transform> > > This is the result of "buildsomething": > > <td>XXXXXfalseSURVEY > select text from sur_question where order = 1 > XXXXX</td><td>YYYYYYYYYY</td> > > Why am I not able to get the value of the Text node here? Am I doing > something wrong with node-set(), or is there a better way to do this > altogether (within the same stylesheet)? My actual query is > more complex > than the simplified version I show above. > > Many thanks, > Leona
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|