This Should be simple but ugh who knows these days
I have this XSLT that i am using to try and merge 2 XML documents programamtically. Basically 1 document will be used to fill in gaps on the second document.
I understand now how to load a document inta variable and use that but what happens when i try to go and use the original document that the XSLT is being applied to.
LIke the following. It doesn't recognize this or something because I don't get any data back from this statement but this statemtn seems to be what i want. Any Ideas??
<xsl:for-each select="ToSales/Customer/Model/Standard/Elevation"> <--- THis is the line that stops working Any help is appreciated...
Rico
<xsl:stylesheet xmlns:xsl=" version="1.0">
<xslutput method="xml" indent="yes"/>
<!-- load the merge file -->
<xsl:variable name="ssnetData"
select="document('ssnetlayout.xml')"/>
<xsl:template match="/">
<salescenterimport>
<builder action="update" >
<xsl:attribute name="code">
<xsl:value-of select="$ssnetData/builder/@code" />
</xsl:attribute>
<name>
<xsl:value-of select="$ssnetData/builder/@name" />
</name>
<county>
<xsl:value-of select="$ssnetData/builder/@country" />
</county>
</builder>
<xsl:for-each select="$ssnetData/builder/division">
<division action="update">
<code>
<xsl:value-of select="@code" />
</code>
<name>
<xsl:value-of select="@name" />
</name>
<xsl:for-each select="ToSales/Customer/Model/Standard/Elevation">
<option action="update">
<code>
<xsl:value-of select="@ID" />
</code>
<description>
<xsl:value-of select="@Description" />
</description>
<longdescription>
<xsl:value-of select="@BaseComment" />
</longdescription>
<price>
<xsl:value-of select="@PkgAmount" />
</price>
</option>
</xsl:for-each>
</division>
</xsl:for-each>
</salescenterimport>
</xsl:template>
</xsl:stylesheet>
I have this XSLT that i am using to try and merge 2 XML documents programamtically. Basically 1 document will be used to fill in gaps on the second document.
I understand now how to load a document inta variable and use that but what happens when i try to go and use the original document that the XSLT is being applied to.
LIke the following. It doesn't recognize this or something because I don't get any data back from this statement but this statemtn seems to be what i want. Any Ideas??
<xsl:for-each select="ToSales/Customer/Model/Standard/Elevation"> <--- THis is the line that stops working Any help is appreciated...
Rico
<xsl:stylesheet xmlns:xsl=" version="1.0">
<xslutput method="xml" indent="yes"/>
<!-- load the merge file -->
<xsl:variable name="ssnetData"
select="document('ssnetlayout.xml')"/>
<xsl:template match="/">
<salescenterimport>
<builder action="update" >
<xsl:attribute name="code">
<xsl:value-of select="$ssnetData/builder/@code" />
</xsl:attribute>
<name>
<xsl:value-of select="$ssnetData/builder/@name" />
</name>
<county>
<xsl:value-of select="$ssnetData/builder/@country" />
</county>
</builder>
<xsl:for-each select="$ssnetData/builder/division">
<division action="update">
<code>
<xsl:value-of select="@code" />
</code>
<name>
<xsl:value-of select="@name" />
</name>
<xsl:for-each select="ToSales/Customer/Model/Standard/Elevation">
<option action="update">
<code>
<xsl:value-of select="@ID" />
</code>
<description>
<xsl:value-of select="@Description" />
</description>
<longdescription>
<xsl:value-of select="@BaseComment" />
</longdescription>
<price>
<xsl:value-of select="@PkgAmount" />
</price>
</option>
</xsl:for-each>
</division>
</xsl:for-each>
</salescenterimport>
</xsl:template>
</xsl:stylesheet>