Re: [xsl] extending the DTD

Subject: Re: [xsl] extending the DTD
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Thu, 14 Sep 2006 09:52:21 +0200
Hi Jeff,

I saw you already found your solution, using saxon extension functions. Just for the sake of completeness, for others to find, here's a summary of what you are likely to have found:

<!-- defining an entity using a doctype declaration -->
       <saxon:doctype xsl:extension-element-prefixes="saxon">
           <dtd:doctype
               name      = "index"
               system    = "D:\RND\ECW\Asiatype DTD\ATI_1.4.dtd"
               xmlns:dtd = "http://saxon.sf.net/dtd";
               xsl:exclude-result-prefixes="dtd">
               <dtd:entity name="test">'Some text'</dtd:entity>
           </dtd:doctype>
       </saxon:doctype>

<!-- using the entity reference -->
<saxon:entity-ref name="test" xsl:extension-element-prefixes="saxon"/>

Cheers,
Abel Braaksma
http://abelleba.metacarpus.com



Jeff Sese wrote:
Hi,

Is it possible to extend a DTD using XSLT? I can declare a system DTD using the doctype-sytem attribute in the xsl:output element, however I want to add extra entity declarations into the system dtd that I added. I want to achieve an out like the one below:

<!DOCTYPE index SYSTEM "D:\RND\ECW\Asiatype DTD\ATI_1.4.dtd" [
<!ENTITY test "some text">
]>
<element>
   <text>&test;</text>
</element>
Thanks,

Current Thread