RE: XPath expr on generated nodeset
[Al Byers] > > I generated a nodeset by assigning elements to a variable and > then converting the fragment to a nodeset, but normal XPath > expressions do not seem to work. I would appreciate any help > on figuring out what I am doing wrong. I am using Xalan 2.4.0. TIA Al > If all you are doing is building a fixed set of nodes, there is no need to convert RTFs to nodesets. You can create a nodeset by putting them in a named template and access them using document(""). This illustrates how to construct your example - <xsl:variable name='aNd' select='document("")/xsl:stylesheet/xsl:template[@name="fragment"]/aaa'/ > .... <xsl:template name='fragment'> <aaa> <bbb>Stuff</bbb> </aaa> </xsl:template> This way works fine and does not depend on extension functions, so it is fully portable. Of course, it cannot be dynamically constructed, but it works well for lookup tables and such. 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