![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries [Thread Prev] >Thread Next - RE: XSL to Combine attributes from two nodes XSL to Combine attributes from two nodesTo: NULL Date: 12/7/2006 2:41:00 PM I have what seems like a simple XSL question. I want to combine the attributes of two different nodes together. Here is some sample XML: <?xml version="1.0" encoding="utf-8" ?> <S Number="21002" Name="North" State="Georgia" > <U DateLoaded="2006-11-28" ></U> </S> The goal is for the XML to look like so (really, just add the DateLoaded attribute to <S>: <S Number="21002" Name="North" State="Georgia" DateLoaded="2006-11-28"> Here is some XSL that is NOT adding the correct value for "DateLoaded" to the result, rather, the value is blank: <xsl:template match="root"> <xsl:element name="root" namespace="http://tempuri.org/root.xsd"> <xsl:apply-templates/> </xsl:element> </xsl:template> <xsl:template match="S"> <xsl:element name="s" use-attribute-sets="sAttributes" /> </xsl:template> <xsl:attribute-set name="sAttributes"> <xsl:attribute name="Number"> <xsl:value-of select="@Number"/> </xsl:attribute> <xsl:attribute name="Name"> <xsl:value-of select="@Name"/> </xsl:attribute> <xsl:attribute name="DateLoaded"> <xsl:value-of select="u[@DateLoaded]"/> </xsl:attribute> <xsl:attribute name="State" > <xsl:value-of select="@State"/> </xsl:attribute> </xsl:attribute-set> Thanks for your help. J | ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
