|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Global Variable
aruniima.chakrabarti@xxxxxxxxxxxxxxxxxx wrote: > I was trying something like this... but this won't really work as I want the > node-list in the param.... Any ideas??? > > <xsl:param name="Path" select="'p_ptr_str_ln_txn_inq_com'"/> > > <xsl:variable name="xpath"> > <xsl:choose> > <xsl:when test="string-length($Path) != 0"> "string-length($Path) != 0" is longhand for just "$Path" (try it) > <xsl:value-of select="//Header/*[name()=$Path]"/> > > </xsl:when> > <xsl:otherwise> > > <xsl:value-of select="//Header"/> > > > </xsl:otherwise> > </xsl:choose> > </xsl:variable> You want xsl:copy-of, not xsl:value-of, (value-of means 'create a text node from the string-value of this object, in this case the first node in this node-set' ... whereas copy-of means 'copy this node-set') Then $xpath will be a result tree fragment. To access it as a node-set you will need to convert it to a node-set by passing it as an argument to the exsl:node-set() extension function or your XSLT vendor's equivalent extension function (check the docs). <xsl:variable name="xp-nodeset" select="exsl:node-set($xpath)" xmlns:exsl="http://exslt.org/common" /> - Mike ____________________________________________________________________________ mike j. brown | xml/xslt: http://skew.org/xml/ denver/boulder, colorado, usa | resume: http://skew.org/~mike/resume/ 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








