Re: [xsl] Program to evaluate a set of DTD files

Subject: Re: [xsl] Program to evaluate a set of DTD files
From: "Tony Graham" <tgraham@xxxxxxxxxx>
Date: Wed, 6 Jun 2012 21:57:41 +0100 (IST)
On Wed, June 6, 2012 8:43 pm, Echlin, Robert wrote:
> Given a set of DTD files, with entities and parameter entities in two or
> more files, including entities redefined in more than one place
> (overridden), is there a way to ask a parser to describe the net effect
> for each element?
> For instance, can XSLT ask the parser for the allowed elements or
> attributes in a given element, and the actual element rule, example:
> -   title contains  (#PCDATA | b | i )*
>
> The purpose of this is to test that the result of using a given DTD is
> still unchanged after I change the entities, by for instance, replacing
> some text with a parameter entity.

The way that I usually do that sort of thing is with Perl rather than
XSLT.  See, e.g., DTDParse by Earl Hood [1] that includes "dtddiff (along
with dtddiff2html) ... that performs a context-like diff between two
parsed DTDs" [2].

If you can get an XML representation of each DTD, e.g., using dtd2xsd.pl
[3], then it becomes easier to process using XSLT.

Regards,


Tony Graham                                   tgraham@xxxxxxxxxx
Consultant                                 http://www.mentea.net
Mentea       13 Kelly's Bay Beach, Skerries, Co. Dublin, Ireland
 --  --  --  --  --  --  --  --  --  --  --  --  --  --  --  --
    XML, XSL-FO and XSLT consulting, training and programming

[1] http://www.mhonarc.org/release/SGML-DTDParse/2.00/
[2] http://www.mhonarc.org/release/SGML-DTDParse/2.00/Changes
[3] http://www.w3.org/2000/04/schema_hack/

Current Thread