I have following XML
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE ONIXMessage SYSTEM "http://www.editeur.org/onix/2.1/reference/onix-international.dtd">
<ONIXMessage>
<Header>
<FromEANNumber>5013546111661</FromEANNumber>
<FromCompany>NielsenBookData</FromCompany>
<FromPerson>Angela Kendall</FromPerson>
<FromEmail>
[email protected]</FromEmail>
<SentDate>20061213</SentDate>
<DefaultLanguageOfText>eng</DefaultLanguageOfText>
</Header>
<Product>
<RecordReference>9780643091610</RecordReference>
<NotificationType>03</NotificationType>
<RecordSourceType>04</RecordSourceType>
<RecordSourceName>Nielsen BookData</RecordSourceName>
<RecordSourceIdentifierType>02</RecordSourceIdentifierType>
<RecordSourceIdentifier>NBD</RecordSourceIdentifier>
<ProductIdentifier>
<ProductIDType>15</ProductIDType>
<IDValue>9780643091610</IDValue>
</ProductIdentifier>
</Product>
</ONIXMessage>
and have following XSL
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:MyDateTime="urn:MyDateTime" exclude-result-prefixes="MyDateTime">
<xsl:output method="xml" version="1.0" encoding="ISO-8859-1" omit-xml-declaration="no" indent="yes"/>
<xsl:output doctype-system="http://www.editeur.org/onix/2.1/reference/onix-international.dtd"/>
<xsl:template match="/">
<xsl:comment>Transformed by ONIX Loader to make this valid XML file on <xsl:value-of select="MyDateTime:ToString()"/></xsl:comment>
<ONIXMessage>
<Header>
<xsl:apply-templates select="ONIXMessage/Header/node()"/>
</Header>
<Product>
<xsl:apply-templates select="ONIXMessage/Product/RecordReference"/>
<xsl:apply-templates select="ONIXMessage/Product/NotificationType"/>
<xsl:apply-templates select="ONIXMessage/Product/RecordSourceType"/>
<xsl:apply-templates select="ONIXMessage/Product/RecordSourceIdentifierType"/>
<xsl:apply-templates select="ONIXMessage/Product/RecordSourceIdentifier"/>
<xsl:apply-templates select="ONIXMessage/Product/RecordSourceName"/>
<xsl:apply-templates select="ONIXMessage/Product/node()"/>
</Product>
</ONIXMessage>
</xsl:template>
<xsl:template match="*">
<xsl:copy>
<xsl:copy-of select="node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
Output is
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE ONIXMessage SYSTEM "http://www.editeur.org/onix/2.1/reference/onix-international.dtd">
<ONIXMessage>
<Header>
<FromEANNumber>5013546111661</FromEANNumber>
<FromCompany>NielsenBookData</FromCompany>
<FromPerson>Angela Kendall</FromPerson>
<FromEmail>
[email protected]</FromEmail>
<SentDate>20061213</SentDate>
<DefaultLanguageOfText>eng</DefaultLanguageOfText>
</Header>
<Product>
<RecordReference>9780643091610</RecordReference>
<NotificationType>03</NotificationType>
<RecordSourceType>04</RecordSourceType>
<RecordSourceIdentifierType>02</RecordSourceIdentifierType>
<RecordSourceIdentifier>NBD</RecordSourceIdentifier>
<RecordSourceName>Nielsen BookData</RecordSourceName>
<RecordReference>9780643091610</RecordReference>
<NotificationType>03</NotificationType>
<RecordSourceType>04</RecordSourceType>
<RecordSourceName>Nielsen BookData</RecordSourceName>
<RecordSourceIdentifierType>02</RecordSourceIdentifierType>
<RecordSourceIdentifier>NBD</RecordSourceIdentifier>
<ProductIdentifier>
<ProductIDType refname="ProductIDType" shortname="b221">15</ProductIDType>
<IDValue refname="IDValue" shortname="b244">9780643091610</IDValue>
</ProductIdentifier>
<ProductForm>BB</ProductForm>
</Product>
</ONIXMessage>
I just do not want tags coming in Red color (do not want to repeat again)