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

Re: xalan:nodeset

Subject: Re: xalan:nodeset
From: "J.Pietschmann" <j3322ptm@xxxxxxxx>
Date: Sun, 26 Nov 2006 13:56:32 +0100
select constraint
Nima Kaviani wrote:
I have the following XML file:
[snip]
and I have used the following construct to store some of the elements
in a variable based on an equality between the values of the
attributes:

<xsl:param name="contextID" select="policy:context/@rdf:resource"/>
<xsl:variable name="contexts">
<xsl:copy-of select="//constraint:SimpleConstriant[@rdf:ID = $contextID]"/>
</xsl:variable>


apparantly the variable "contexts" has stored the relevant information
but when I try to read it, using for-each or whatever else, nothing is
displayed. so the code below is not working:

<xsl:for-each select="xalan:nodeset($contexts)">
    <xsl:value-of select="constraint:SimpleConstriant/@rdf:ID"/>
</xsl:for-each>

while <xsl:copy-of select="xalan:nodeset$contexts)"/> shows that the
desired values are stored in the variable.

Selecting from a RTF-converted-nodeset can be tricky, however it looks like that the context elements in the for-each are already the constraint:SimpleConstriant elements, and you can just select the necessary attribute.

The real question is: why do you actually create the "contexts"
variable as RTF? You should be able to do the following, without
the nodeset() extension:

 <xsl:param name="contextID" select="policy:context/@rdf:resource"/>
 <xsl:variable name="contexts"//constraint:SimpleConstriant[@rdf:ID
                    = $contextID]"/>

 <xsl:for-each select="$contexts">
     <xsl:value-of select="@rdf:ID"/>
 </xsl:for-each>


J.Pietschmann


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.