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

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

Subject: RE: [xsl] Program to evaluate a set of DTD files
From: "Echlin, Robert" <Robert.Echlin@xxxxxxxxxxxxx>
Date: Thu, 7 Jun 2012 16:18:46 +0000

Hi, Tony.
I will look at the Perl solution.
I hoped there was a native, maybe even canonical, solution.
Do those SGML utilities do the right thing for XML DTD's?
Do the differences matter when you are dealing with DTD's?
I haven't touched SGML since I was at OmniMark in 2004.


Rob Echlin, 1.613.270.5796 | Skype: rob.echlin.wr

-----Original Message-----
From: Tony Graham [mailto:tgraham@xxxxxxxxxx]
Sent: Wednesday, June 06, 2012 4:58 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [xsl] Program to evaluate a set of DTD files

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.


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