[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: working with xsl:comment
> Sorry, another query in quick succession but like earlier I might be > missing something rather obvious. > > I am writing some information within the <xsl:comment> tags. > I want to > later retreive this content in another .xsl file. How do I do > it? Also > can I retrieve the container node of this comment? > > E.g <TD width="50%"><FONT SIZE="4" COLOR="red">Checking for > existence of > 'Wood'...</FONT> > <!--Wood--></TD> > > So how do I get the information 'Wood' as well as the position of the > containing <TD> so that I can proceed to find other sibling > <TD>s from > this point? Use the comment() function eg: <xsl:template match="comment()"> <xsl:value-of select="."/> </xsl:template> Which will output 'Wood'. If you want <!--Wood--> then use copy-of instead of value-of. To select the TD that contains a comment just use a predicate eg: <xsl:apply-templates select="TD[comment()]"/> cheers andrew
|
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
|