|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Cannot use result tree fragment
[abbouh] > i want to get all "ht" nodes from different external documents,so i > use in my xsl file: > > <xsl:for-each select="//doccontent/chapmod"> > <xsl:variable name="vchapmod" select="current()"/> > <xsl:variable name="vchapmod1"> > <xsl:value-of > select="document(concat(string($vchapmod/attribute::docref),'. > xml'))"/> > </xsl:variable> > <xsl:for-each select="$vchapmod1//ht"> > > but i get this error : > Error in Xpath expression,Cannot use result tree fragment > the error is for <xsl:for-each select="$vchapmod1//ht"> > When you tell the stylesheet to create a result, it gets stored as a "Result Tree Fragment" (RTF). In xslt 1.0, RFTs cannot be used in place of nodesets, so you cannot operate on the output. Some processors have an extension that does let you use them as if they were regular nodesets. When you declare a variable the way you did, the processor creates a RTF and assigns it to the variable. That is why you got the error message. But you could simplify you variable and get the result you expected - <xsl:variable name="vchapmod1" select="document(concat(string($vchapmod/attribute::docref),'.xml'))"/> In this construction, you select a nodeset and assign it to the variable, so you will be able to use it. Cheers, Tom P XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|

Cart








