|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] referencing elements
Hi, I am pretty new to XSLT and have a problem I cannot solve. I am posting here, hoping some kind soul is friendly enough to enlighten me (; - thanks in advance I have a xml input document like this: <root> <chapter name="foo"> this is all about foo </chapter> <chapter name="bar"> this is all about bar </chapter> <chapter name="baz"> this is all about baz. you might want to have a look at chapter <link id="bar"/> too. </chapter> </root> Now I would like to generate some nice html out of this and convert the "link" element into a true hyperreference therefore in my stylesheet i have something along the lines (not with true hyperlinks yet, but just to demonstrate ids: <xsl:template select="chapter" id of this chapter is: <xsl:value-of select"generate-id()"/> <br/> to demonstrate a link: <xsl:value-of select="/chapter[@name=???]"/> </xsl:template> Now the ??? part is what i don't know how to solve. My first go was to write: select="/chapter[@name=@id]" or: select="/chapter[@name=./@id]" Hoping that somehow i could access the node that the current template rule matched, but it seems in square brackets the context node is overruled. Anybody knows how to do this? Also, I would like to produce one html page per chapter. Is there a chance I can do this without post-processing the result? thank you very much in advance, Andreas 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








