[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Addressing siblings
Tempore 10:28:05, die 02/09/2005 AD, hinc in
xsl-list@xxxxxxxxxxxxxxxxxxxxxx scripsit
<David.McKay@xxxxxxxxxxxxxxxxxxxxxxxxxxx>:
Hi,<?xml version="1.0" encoding="UTF-8"?> <People> <Man name="Bob" wife="Alice" birth="1960-08-15"/> <Woman name="Alice" birth="1955-10-26"/> </People> 'xsl:key' was made for this: Try this: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:key name="husband" match="Man" use="@wife"/> <xsl:template match="Woman"> <xsl:value-of select="key('husband',@name)/@birth"/> </xsl:template> </xsl:stylesheet> (will return the husband's birthday)
|
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
|