Hello,
If you want all attributes (including class) to be pulled from the DTD into the DITA file, all you need is a copy stylesheet:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml"/>
<!-- Match document -->
<xsl:template match="/">
<xsl:apply-templates mode="copy" select="."/>
</xsl:template>
<!-- Deep copy template -->
<xsl:template match="*|text()|@*" mode="copy">
<xsl:copy>
<xsl:apply-templates mode="copy" select="@*"/>
<xsl:apply-templates mode="copy"/>
</xsl:copy>
</xsl:template>
<!-- Handle default matching -->
<xsl:template match="*"/>
</xsl:stylesheet>
Note however that when applying this against the DITA document, the DOCTYPE, comments and processing instructions (including the Oxygen change tracking markers) will be stripped.
To include the DOCTYPE you can either manually re-add it, or change the xsl:output to include the appropriate public/system IDs.
e.g. for a DITA Topic
Code: Select all
<xsl:output method="xml" doctype-public="-//OASIS//DTD DITA Topic//EN" doctype-system="http://docs.oasis-open.org/dita/v1.1/OS/dtd/topic.dtd"/>
Also, if you want to strip some of the attribute pulled from the DTD, you can simply add another xsl:template that matches them, but does not forward them to the output.
e.g. This strips down the
ditaarch:DITAArchVersion and
domains attributes.
Code: Select all
<xsl:template match="@ditaarch:DITAArchVersion|@domains" mode="copy"/>
Let me know if you need something more specific.
Regards,
Adrian