[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] selection on position
hi i have a problem which is not working the way i wud have thot it should work. i have an xml that looks like <colors> <color>red</color> <color>blue</color> <color>green</color> </colors> and i want to match a pattern based on a condition.. ( this is a purely experimental example.. and is intended to understand xsl ) i want to get the second color element ie blue i can do something like <xsl:template match="colors"> <xsl:value-of select="color[position()=2]"/> </xsl:template> ---or--- <xsl:template match="/"> <xsl:value-of select="/colors/color[position()=2]"/> </xsl:template> ------------------------------------------------- however, something like <xsl:template match="/colors/color[position()=2]"> <xsl:value-of select="."/> </xsl:template> would gimme all colors, ignoring the condition... I am not sure what happens behind.. any explaination to this is appreciated thanks -------------------------------------------------------------- Sent with "Me-Mail", Boltblue's FREE mobile messaging service. http://www.boltblue.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
|