XSLT For Each Not Carrying Attribute To Target in XSLT/XSL-FO Posted May 13, 2014 · Edited May 13, 2014 by bjr149 I am mapping from the same variable to itself trying to figure out why the attributes won't carry over. Source XML <ns1:Data-Structure Name="Interchange"><ns1:Lookup Name="InterchangeSenderID">95000</ns1:Lookup><ns1:Property Name="InterchangeSenderID">95000</ns1:Property><ns1:Data-Structure Name="Group"><ns1:Lookup Name="GroupSenderID">195000</ns1:Lookup></ns1:Data-Structure></ns1:Data-Structure> Target XML After XSLT <ns1:Data-Structure ns1:Name=""><ns1:Lookup ns1:Name="">95000</ns1:Lookup><ns1:Property ns1:Name="">95000</ns1:Property><ns1:Data-Structure ns1:Name=""><ns1:Lookup>195000</ns1:Lookup></ns1:Data-Structure></ns1:Data-Structure> The attributes won't be copied. here is the XSLT can you see what the issue is? <ns1:Data-Structure> <xsl:attribute name="ns1:Name"> <xsl:value-of select="/ns1:Canonical850/ns1:Internal-Properties/ns1:Data-Structure/@ns1:Name"/> </xsl:attribute> <ns1:Lookup> <xsl:attribute name="ns1:Name"> <xsl:value-of select="/ns1:Canonical850/ns1:Internal-Properties/ns1:Data-Structure/ns1:Lookup/@ns1:Name"/> </xsl:attribute> <xsl:value-of select="/ns1:Canonical850/ns1:Internal-Properties/ns1:Data-Structure/ns1:Lookup"/> </ns1:Lookup> <ns1:Property> <xsl:attribute name="ns1:Name"> <xsl:value-of select="/ns1:Canonical850/ns1:Internal-Properties/ns1:Data-Structure/ns1:Property/@ns1:Name"/> </xsl:attribute> <xsl:value-of select="/ns1:Canonical850/ns1:Internal-Properties/ns1:Data-Structure/ns1:Property"/> </ns1:Property> <ns1:Data-Structure> <xsl:attribute name="ns1:Name"> <xsl:value-of select="/ns1:Canonical850/ns1:Internal-Properties/ns1:Data-Structure/ns1:Data-Structure/@ns1:Name"/> </xsl:attribute> <ns1:Lookup> <xsl:if test="/ns1:Canonical850/ns1:Internal-Properties/ns1:Data-Structure/ns1:Data-Structure/ns1:Lookup/@ns1:Name"> <xsl:attribute name="ns1:Name"> <xsl:value-of select="/ns1:Canonical850/ns1:Internal-Properties/ns1:Data-Structure/ns1:Data-Structure/ns1:Lookup/@ns1:Name"/> </xsl:attribute> </xsl:if> <xsl:value-of select="/ns1:Canonical850/ns1:Internal-Properties/ns1:Data-Structure/ns1:Data-Structure/ns1:Lookup"/> </ns1:Lookup> <ns1:Property> <xsl:attribute name="ns1:Name"> <xsl:value-of select="/ns1:Canonical850/ns1:Internal-Properties/ns1:Data-Structure/ns1:Data-Structure/ns1:Property/@ns1:Name"/> </xsl:attribute> <xsl:value-of select="/ns1:Canonical850/ns1:Internal-Properties/ns1:Data-Structure/ns1:Data-Structure/ns1:Property"/> </ns1:Property> </ns1:Data-Structure> </ns1:Data-Structure>
XSLT For Each Not Carrying Attribute To Target
in XSLT/XSL-FO
Posted · Edited by bjr149
I am mapping from the same variable to itself trying to figure out why the attributes won't carry over.
Source XML
Target XML After XSLT
The attributes won't be copied. here is the XSLT can you see what the issue is?