[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: using node-set on a query result

Subject: RE: using node-set on a query result
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Sun, 12 Sep 2004 12:59:06 +0100
esql execute query
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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.