Subject: Re: [xsl] xpath expression From: Dan Diebolt <dandiebolt@xxxxxxxxx> Date: Thu, 17 May 2001 19:05:23 -0700 (PDT) |
Rather than matching on <type> directly, I think you are better off matching each <input> and from there looking forward or backward to the next or previous <input>. If you really must match on each <type>, you can reach the parent <input> by simply adding "../" to the head of the XPath expression. Regards, Dan ------------------- <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output indent="yes"/> <xsl:template match="/"> <xsl:apply-templates select="root"/> </xsl:template> <xsl:template match="root"> <xsl:apply-templates select="input"/> </xsl:template> <xsl:template match="input"> Preceding input=<xsl:value-of select="preceding-sibling::input[1]/type"/><br/> This input=<xsl:value-of select="type"/><br/> Following input=<xsl:value-of select="following-sibling::input[1]/type"/><br/> <hr/> </xsl:template> </xsl:stylesheet> __________________________________________________ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] How to simplify the xslt , Jeni Tennison | Thread | [xsl] where is that processor writt, Tobias Reif |
Re: [xsl] Referencing nodes from an, Adam Turoff | Date | RE: [xsl] Get Processing Instructio, Joshua Allen |
Month |