At 01:23 PM 10/3/2003 -0600, you wrote:
Let's see if I got this right.

Start with a document that has a DTD in the document.
Write the document out using a Transformer and you loose the DTD.

Start with a document that has a DTD in the document.
Add your DTD to the XSLT (so that you have duplicated it).
Write the document out using a Transformer and you keep the DTD.

Sounds like bad design to me.  Every time you change the DTD in the document
you have to modify duplicated data in the XSLT.  Duplicated data is almost
always a idea.

Is this really what you have to do?

Ok, I'll grant you your criticism in the context of the original question. However, normally if you are going to use a Transformer, you are converting the document from one type of markup to another. For instance, from plain old XML to XHTML in which case, the original XML document probably wouldn't have the DTD of the new document anyway. I guess it seems kind of odd to me that one would be using Transformation on a document which doesn't seem to be changing types. Do you have a use-case for why one would even do this? Why not just manipulate the DOM and serialize it. Why transform it? When serializing an XML document, the DTD should stay in-tact. Of course it wouldn't for an HTML document because the HTML DOM doesn't support document type nodes. Based on the original question, however, it seems as if we are dealing with XML, not HTML.


Jake

Thanks,

Donald Holliday
(719) 481-7501            V
[EMAIL PROTECTED]


-----Original Message----- From: Jacob Kjome [mailto:[EMAIL PROTECTED] Sent: Friday, October 03, 2003 11:18 AM To: [EMAIL PROTECTED] Subject: Re: Problem in Saving XML file with DTD


At 06:54 PM 10/3/2003 +0200, you wrote: >I should mention that I'm using the Transformator in order to write the >DOM document to a file, but it seems to skip the DTD section when writing >the new updated XML file. >Why is it happening and how can I keep the DTD??

Have you added the following to your XSLT?...

<xsl:output
     method="xml"
     indent="yes"
     doctype-public="-//W3C//DTD XHTML 1.1//EN"
     doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"; />

Add your own doctype info there and it will show up in the resulting
document.

Jake


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to