|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: xpath expression
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
|
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








