Subject: [xsl] Dynamic XPath From: "Philip Fitzsimons" <pfitzsimons@xxxxxxxxxxx> Date: Fri, 23 May 2003 15:08:42 +0100 |
I want to create an XSLT expressions so that I can vary which nodes I select, I can't use [name() = $nodeName] because the depth of the path may change - and I want to use paths not nodenames... What I would like to do is: <!--<xsl:variable name="dynamicPath" select="/document/*[position() = 2]" />--> <xsl:variable name="dynamicPath" select="/document/section/keep/pear" /> <xsl:variable name="textContent" select="{$dynamicPath}/text()" /> Which is not valid :( - so how can I create a dynamic path? Is it possible? I'm using MSXML 4.0 under .Net <document> <section> first section <keep> first sub-section <apple> </apple> <pear> </pear> </keep> <house sid="1.2"> first sub-section <fish> <jumping>hello</jumping> </fish> <dog></dog> </house> <castle sid="1.3"> first sub-section </castle> </section> </document> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Axis order and variables, gutman | Thread | Re: [xsl] Dynamic XPath, G. Ken Holman |
Re: [xsl] xml to xsl: fo -> pdf for, G. Ken Holman | Date | Re: [xsl] XSLT 2/XPath 2 roadmap, Frédéric Laurent |
Month |