[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Parsing a DTD

  • To: "Terry Chilvers" <terrychilvers@b...>,<xml-dev@l...>
  • Subject: RE: Parsing a DTD
  • From: "Roche, Conrad (Cognizant)" <Conrad.Roche@c...>
  • Date: Fri, 25 Jul 2003 10:12:58 -0700
  • Thread-index: AcNQ87OGoRpsSVZyS1ujVKv2SARSDAB2cr/Q
  • Thread-topic: Parsing a DTD

terry chilvers
Title: Message
Hi Terry,
 
If you are looking for java classes to parse the DTD you could try matra[1]. You can parse standalone DTDs or DTDs with multiple modules included within it.
 
Disclaimer: The code is around 3 years old and is in an alpha state. It works on most DTDs, but there might be a few bugs here and there. I had planned to fix them, but never got down to doing it ... If you face a problem with the code feel free to contact me.
 
You'll also find DTDTree in the project. It displays the structure of the DTD is a simple (or simplistic!!) tree structure [2] - showing the parent-child relationship between the elements. I find it pretty useful while trying to decipher the structure of a DTD.
 
[1] You can find matra at -
https://sourceforge.net/projects/matra/
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/matra/
 
[2] Here a snippet of an eg tree ...

schema (targetNamespace, version, xmlns="http://www.w3.org/1999/XMLSchema", finalDefault="", blockDefault="", id, elementFormDefault="unqualified", attributeFormDefault="unqualified")

|

|- include (schemaLocation)

|  |

|  +- annotation

|     |

|     |- appinfo (source)

|     | 

|     +- documentation (source, xml:lang)

|       

|- import (namespace, schemaLocation)

|  |

|  +- annotation

|     |

|     |- appinfo (source)

|     | 

|     +- documentation (source, xml:lang)

|       

|- annotation

|  |

|  |- appinfo (source)

|  | 

|  +- documentation (source, xml:lang)

...

 

cheers
Conrad
-----Original Message-----
From: Terry Chilvers [mailto:terrychilvers@b...]
Sent: Wednesday, July 23, 2003 1:22 AM
To: xml-dev@l...
Subject: Parsing a DTD

Hi,
I would like to parse/process a DTD in order to extract, for each element, a list of available/valid child elements and attributes.
I've been looking through the MSXML4.0 reference and can't see anything that looks like it would help. I've also spent several hours searching the web looking for example code and tools, but no joy.
The DTD in question (at the moment anyway) is DocBook, but I want something generic. DocBook seems to use quite a few seperate files for the DTD, so I'd need to be able to handle this.
 
Any suggestions for code or tools, or pointers in the right direction or even alternative methods would be greatly appreciated.
 
Thanks in advance.
Terry Chilvers

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.