oleksii.sapov-erlinger
oleksii.sapov-erlinger

Reputation: 412

Copy !DOCTYPE using xslt

How can <!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">

be copied when applying an XSLT transformation?

This is an DTD schema declaration, am I right?

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="utils_documentation_home">
    <title>Documentation</title>
    <body>
        
    </body>
</topic>

I tried

<xsl:output method="xml" doctype-public="-//OASIS//DTD DITA Topic//EN" doctype-system="topic.dtd"/>

XSLT 3.0/4.0

Upvotes: 1

Views: 66

Answers (1)

oleksii.sapov-erlinger
oleksii.sapov-erlinger

Reputation: 412

I don't know why it did not work at the beginning, but currently this instruction makes the job:

 <xsl:output doctype-public="-//OASIS//DTD DITA Topic//EN" doctype-system="topic.dtd" indent="yes" method="xml"/>

Though there are some formatting changes, but I think it is not relevant.

Comparison before and after transformation

Upvotes: 1

Related Questions