|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] ANN. UX v 0.2. Grep in XSLT.( Re: path quesion )
----- Original Message ----- From: Kay Michael > > I am processing 2 XML files within a single xsl file. From one file > > I retreive a path value e.g. 'customer/age', from an element > > , this value > > is placed in a variable. I then want to look for the 'customer/age' > > element in the 2nd xml file, > > There is no way in standard XSLT of constructing an XPath expression from a > string (other than by writing a stylesheet to generate another stylesheet). > > You can do it in Saxon using the saxon:evaluate() extension function. I would like to say once again that I think it is bad that saxon:evaluate ( and xt:node-set ) are not in the standard. However. To those who may like to see that 'standard' way of creating one stylesheet out of another ( there are some twists there with TransformAlias ;-) Ux v 0.2 provides some version of grep, implemented in XSLT. Ux v 0.2. ( source code published at http://www.pault.com/Ux/ ) also contains String -> node-set conversion, almost 100% clean support for chaining complex transformations + many new examples of how can XSLT replace perl ;-) In the example below ( which works in Ux v 0.2 ) 'last' , 'grep' and ' x' are all XSLT stylesheets. <xsl:variable name="to-exec"> /! last | grep {login[@status='FAILED']} | x </xsl:variable> <xsl:copy-of select= "document( $to-exec )"/> Rgds.Paul. 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
|






