xsl-list
[Top] [All Lists]

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

2004-02-12 10:25:46
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
ID:
<xsl:output method="xml"
     doctype-public="...."
     doctype-system="...."
     indent="no"
     encoding="ISO-8859-1" />,

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

Is this expected behavior?

Yes.

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(_at_)CraneSoftwrights(_dot_)com
Crane Softwrights Ltd.           http://www.CraneSoftwrights.com/s/
Box 266, Kars, Ontario CANADA K0A-2E0     +1(613)489-0999 (F:-0995)
Male Breast Cancer Awareness   http://www.CraneSoftwrights.com/s/bc


XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>
  • Re: internal subset of DTD lost in output - but want to keep it, G. Ken Holman <=