[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] How to "copy" a DTD reference?


Subject: Re: [xsl] How to "copy" a DTD reference?
From: "Mark R. Diggory" <mdiggory@xxxxxxxxxxxxxxxxx>
Date: Wed, 13 Aug 2003 15:22:15 -0400

Yes, I do mean DOCTYPE declaration's.

And I suspected as much, but I was unsure. Good thing I've also got xsd versions of my DTD's as well. I'm at the point of deciding if I want to continue to try to support the transforms of XML that maintain the DTD references in the output. Since theres no simple parser/transformer solution I'm starting to feel emphatically "no".

-thanks guys,
Mark

J.Pietschmann wrote:
>
> Not easily. You can specify a public and system id for a DTD to be
> referenced in a DOCTYPE decl in the result using xsl:output, but there
> is no way to retrieve them from the input from within the style sheet.
> You can't use the usual trick of passing the values as parameters
> either, because (AFAIK) xsl:output properties are constants. Some
> processors allow the values to be AVTs, check whether it works with
> yours.
>
> If you use the XSLT from Java (JAXP), you could try to get the
> input DTD from an entity resolver and use it to set the output
> properties of the transformer object.
>
> J.Pietschmann


Wendell Piez wrote:
Hi Mark,

If by "DTD reference" you mean a DOCTYPE declaration's SYSTEM and/or PUBLIC identifiers, the short answer is (sadly) "no".

You can specify a string value for these identifiers in the doctype-system and doctype-public attributes on xsl:output, but they have to be string literals, they can't be copied from the input. (The parser doesn't preserve these values for the processor in any case, so there's nowhere to copy them from.)

Workarounds include using literal values (which must be known to the stylesheet in advance) and post-processing.

Cheers,
Wendell



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



Current Thread
Keywords