<?xml version="1.0" encoding="utf-8"?><master xmlns:xi="http://www.w3.org/2001/XInclude" > <slave name="not_included"> <field name="idWhateverNotIncluded" /> <code>Code for not_included</code> </slave> <xi:include href="slave.xml" /></master>
<?xml version="1.0" encoding="utf-8"?><slave name="included"> <field name="idWhateverIncluded" /> <code>Code for included</code></slave>
<?xml version="1.0" encoding="UTF-8" ?><xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:output method="xml" indent="yes" /><xsl:strip-space elements="*" /><xsl:template match="/"> <xsl:apply-templates select="@*|node()" /></xsl:template><xsl:template match="node()"> <xsl:copy> <xsl:apply-templates select="*|@*" /> </xsl:copy></xsl:template><xsl:template match="@*"> <xsl:copy-of select="."/></xsl:template><xsl:template match="code"> <xsl:copy-of select="."/></xsl:template></xsl:stylesheet>
_transform.cmd file
nxslt2.exe master.xml process.xslt -o output.xmlIF [%1]==[] pause
<?xml version="1.0" encoding="utf-8"?><master xmlns:xi="http://www.w3.org/2001/XInclude"> <slave name="not_included"> <field name="idWhateverNotIncluded" /> <code>Code for not_included</code> </slave> <slave name="included" xml:base="slave.xml"> <field name="idWhateverIncluded" /> <code>Code for included</code> </slave></master>
<?xml version="1.0" encoding="utf-8"?><master xmlns:xi="http://www.w3.org/2001/XInclude"> <slave name="not_included"> <field name="idWhateverNotIncluded" /> <code>Code for not_included</code> </slave> <slave name="included" xml:base="slave.xml"> <field name="idWhateverIncluded" /> <code /> </slave></master>