JJ wrote:
I need to basically copy an entire XML document to another XML document.
The first needs to be an exact copy of the second, and I need to do it a
node at a time as I am omitting certain nodes that have certain attributes.
An exact copy omits certain nodes?
Whats the best way of doing this?
Sounds like an easy job for an XSLT stylesheet with two templates, one
the identity transformation, the second for those elements to be omitted
e.g.
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()" />
</xsl:copy>
</xsl:template>
<xsl:template match="element-name[@attribute-name]" />
You can run XSLT transformations in .NET 1.x with XslTransform, in .NET
2.x with XslCompiledTransform.
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/