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

Re: Q: SW for parsing DTD's

  • From: rbourret@d... (Ron Bourret)
  • To: xml-dev@i...
  • Date: Mon, 25 May 1998 13:46:07 +0200

.getdtd msxml
Stefan Mintert wrote:

> For the project I'm currently working on, I need to parse DTD's and query
> information like this:
> 
> - which elements are valid in a given context?
> - which elements can contain an element of a certain type?
> 
> 
> 
> Now I'm looking for software that does the parsing for me (Java classe are
> preferred) and provides a high-level interface.

MSXML returns DTD information in the form of a tree of XML-Data elements.  This 
will save you from parsing the DTD, but you will need to traverse this tree or 
build an additional tree structure on top of it to answer the questions you 
have.

There was a comment earlier on this list that MSXML cannot return information 
from external DTDs.  I haven't yet found where this is true, but I don't access 
schema information in all possible ways -- I just call tree.getDTD().getSchema() 
to return the root of the XML-Data tree.

XML-Data is probably richer than you need.  To explore the basic structure of a 
DTD, I use the following XML-Data elements and attributes (Simon -- here's a 
starting point):

Element Tag   Relevent part of the content model    Relevant attributes
-----------   ----------------------------------    --------------------
schema        elementType*                          id

elementType   ((element | group)* | empty | any |   id
               string | mixed)?, attribute*

element       essentially EMPTY                     type, occurs

group         (element | group)+                    occurs
                                                    groupOrder (SEQ and OR only)

empty         EMPTY                                 --

any           EMPTY                                 --

string        EMPTY                                 --

mixed         element+                              --

attribute     ???????                               --

-- Ron Bourret

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i...
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo@i... the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@i... the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@i...)


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.