Subject: Re: [xsl] <xsl:for-each select> and acessing the parent tag's attribute From: cutlass <cutlass@xxxxxxxxxxx> Date: Sun, 15 Apr 2001 15:19:53 +0100 |
Hi,
I want to know how to get the value of the parent tag when you are in an <xsl:for-each select> of the child tag
Here is an illustration of what I want
this is the xml file
<?xml version="1.0" encoding="UTF-8"?> <World> <Country Name="Afghanistan"> <Region Name="Herat"> <City Name="Herat"></City> </Region> <City Name="Kabul"></City> <City Name="Kandahar"></City> <City Name="Mazar-e Sharif"></City> </Country> <Country Name="Albania"> <City Name="Shkoder"></City> <Region Name="test"> <City Name="Tirane"></City> </Region> </Country> </World>
<?xml version="1.0" encoding="UTF-8"?> <World> <Country Name="Afghanistan"> <Region Name="Herat"> <City Name="Herat"></City> </Region> <City Name="Kabul"></City> <City Name="Kandahar"></City> <City Name="Mazar-e Sharif"></City> </Country> <Country Name="Albania"> <City Name="Shkoder"></City> <City Name="Tirane"></City> </Country> </World>
The XSL code
<xsl:for-each select="World/Country/City"> <row> <country><xsl:value-of select="World/Country/@Name"/></country> <region><xsl:value-of select="Region/@Name"/></region> <city><xsl:value-of select="Region/City/@Name"/></city> </row>
This code does not give me the required result.
Thanks Priya Sincerely,
Priya Ann Pinto Software Engineer - Java Email : Priya.P@xxxxxxx
___________________________________________________________________
ITCC FZ L.L.C P.O. Box 74500 Dubai, United Arab Emirates Phone : +971 4 330 3778 Fax : +971 4 330 3779 Website : http://www.ITCC.ws
This message and any attachments are confidential to the ordinary user of the email address to which it is addressed and may also be legally privileged. If you are not the intended recipient, the printing, copying, forwarding, disclosure, or use of any part of this message or its attachments is strictly prohibited, and may be unlawful. If you have received this message in error, please inform the sender immediately by return e-mail and then promptly delete it from your system.
We strongly recommend that you read the complete version of this confidentiality note and disclaimer, available on our website at http://www.ITCC.ws/email_disclaimer.html
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] <xsl:for-each select> and ace, Priya Pinto | Thread | [xsl] xmlns:xsl=http://www.w3.org/T, Arne Borkowski \(bor |
Re: [xsl] Check for null value and , Jeni Tennison | Date | Re: [xsl] Node comparison, Jeni Tennison |
Month |