[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: XSL and processing
Tomas Eriksson wrote: > > Hello, > > I have a question regarding processing in XSL. I have the following document, > > <root> > <pool> > <doc identifier="node6"> > <title>The node title</title> > </doc> > <doc identifier="node14"> > <title>The node title</title> > </doc> > </pool> > <relations> > <rel> > <ref nodeidentifier="node6"/> > <rel> > <rel> > <ref nodeidentifier="node14"/> > <rel> > </relations> > </root> > > I would like to process the relations - rel section as a tree (image) and > after the tree node display the title of the references doc node. I have > tried the following, > > <xsl:template match="root"> > <xsl:for-each select="relations/rel/ref"> > <IMG src="plus.bmp" style="cursor: hand;" align="top"></IMG> > <SPAN> > <xsl:process > select="ancestor(root)/pool/doc[attribute(identifier)='{attribute(nodeidenti > fier)}']/title"/> > </SPAN> > </xsl:for-each> > </xsl:template> > > <xsl:template match="root/doc/title"> > <xsl:process-children/> > </xsl:template> > > I am only interested in the doc[identifier]/title matching the ref - > nodeidentifier value. > > It seems like I am loosing the value of {attribute(nodeidentifier)} when I > go into a new xsl:process instruction That won't work because the select attribute of xsl:process isn't treated as an attribute value template. In the future you might be able to do it using something like: ancestor(root) / pool / doc[attribute(identifier) = ./attribute(nodeidentifier)] > Does anyone know how to process and match attribute values the way I want > to do ? Is it possible with XSL ? Not yet. James 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
|