[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

replacing <!DOCTYPE> with <?xml-model?> in XSLT

Subject: replacing <!DOCTYPE> with <?xml-model?> in XSLT
From: "Chris Papademetrious christopher.papademetrious@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 27 Jul 2022 21:07:19 -0000
 replacing <!DOCTYPE> with <?xml-model?> in XSLT
Hi everyone,

Given the following XML input:

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

I would like to replace <!DOCTYPE> with <?xml-model?>. With the following:

<!-- remove the <!DOCTYPE> (works!) -->
<xsl:output doctype-system=""/>

<!-- add the <?xml-model?> (does not work) -->
<xsl:template match="/*">
  <xsl:processing-instruction
name="xml-model">href="urn:oasis:names:tc:dita:rng:topic.rng"
schematypens=http://relaxng.org/ns/structure/1.0</xsl:processing-instruction>
  <xsl:next-match/>
</xsl:template>

the <!DOCTYPE> removal works but the <?xml-model?> addition does not. Is there
a trick to emitting a PI before the root element?

If the <!DOCTYPE> gives you a problem when you fiddle with this, you could
probably remove it and just play with the PI addition.

Thanks in advance for any insights!

-----
Chris Papademetrious
Tech Writer, Implementation Group
(610) 628-9718 home office
(570) 460-6078 cell

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.