Re: [xsl] internal subset of DTD lost in output - but want to keep it

Subject: Re: [xsl] internal subset of DTD lost in output - but want to keep it
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Thu, 12 Feb 2004 12:25:46 -0500
At 2004-02-12 11:55 -0500, Jiang, Peiyun wrote:
I have a document that has a doctype with public ID , system ID and an
internal subset of DTD.

When I do XLST translation with xml output and specify System ID and public
<xsl:output method="xml"
     encoding="ISO-8859-1" />,

the internal subset of DTD is lost in the output document.

Is this expected behavior?


Is there a way to keep the internal subset of DTD?

No. The internal declaration subset is considered an aspect of the syntax of the input document, and it is not preserved in the data model for XPath upon which XSLT operates. Therefore, there is no way to copy that information to the result tree, which is also constructed using the data model for XPath. Without representation in the data model, there is no way your input can be preserved for the output.

You have two choices:

(1) - create a mini-DTD that contains your internal declaration subset plus a parameter entity reference to your main DTD
- you can then point to the mini-DTD in your <xsl:output>, without an internal declaration subset, and the resulting file will find those declarations and the main body through the parameter entity reference

(2) - craft your own resulting internal declaration subset using a text node and disable-output-escaping.

I hope this helps.

............................. Ken

-- Public courses: upcoming world tour of hands-on XSL training events Each week: Monday-Wednesday: XSLT/XPath; Thursday-Friday: XSL-FO Washington, DC: 2004-03-15 San Francisco, CA: 2004-03-22 Hong Kong: 2004-05-17 Germany: 2004-05-24 England: 2004-06-07 World-wide on-site corporate, government & user group XML training!

G. Ken Holman                  mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd. 
Box 266, Kars, Ontario CANADA K0A-2E0     +1(613)489-0999 (F:-0995)
Male Breast Cancer Awareness

XSL-List info and archive:

Current Thread