Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


xsl duplicates data

From: 1984to911@-----.---
To: NULL
Date: 9/9/2008 1:40:00 PM
I have an XML of the form

<grandparent>
<top_element>
data
<special_element>special data</special_element>
</top_element>

<second_element>
<some_element>some data</some_element>
<special_element>other special data </special_element>
<some_other_element>some other data</some_other_element>
<second_element>
</grandparent>

I'm trying to get html output of the form

<div>
some data
<div>other special data </div>
some other data
</div>


so far the best I can get is
<div>
some data
other special data
some other data
<div>other special data</div>
</div>

by using
<xsl:template match="second_element">
<div><xsl:value-of select="."/>

<xsl:apply-templates select=".//special_element"/>
</div>
</xsl:template>

<xsl:template match="//second_element//special_element">
<div >
<xsl:value-of select="."/></div>
</xsl:template>


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent