[jdom-interest] Parsing an XML Schema

Michael Kay mike at saxonica.com
Wed Aug 2 05:46:45 PDT 2006

Yes, every schema processor does this analysis. And some of them give you an
API to access the compiled schema. Saxon does, and Xerces does. (As I think
I mentioned about 30 messages ago). But we're way off topic for a JDOM list
by now.
Michael Kay


From: enis enis [mailto:enis_ch2001 at yahoo.fr] 
Sent: 02 August 2006 13:29
To: Michael Kay; jdom-interest at jdom.org
Subject: Re : [jdom-interest] Parsing an XML Schema

Is there an XML Schema processor that makes this analysis ?


No, you need to do a lot more than parsing the schema. You already hint at
this when you talk about "starting from the root": you don't mean the XML
root here, you mean some kind of semantic root. (You're wrong to imagine
that a schema is structured as a tree. It's a graph, and quite a complex
one.) To do what you are attempting, you need to do much more than parse the
schema, you need to analyze the information in it. Since that analysis is
complex, and since there are off-the-shelf schema processors that do it for
you, I would suggest that you use them rather than trying to write your own.
Michael Kay


From: jdom-interest-bounces at jdom.org [mailto:jdom-interest-bounces at jdom.org]
On Behalf Of enis enis
Sent: 01 August 2006 16:41
To: Kevin POCHAT; jdom-interest at jdom.org
Subject: Re : [jdom-interest] Parsing an XML Schema

I just need to parse the schema (dtd or xml schema corresponding) as a tree
structure, it means starting from the root, and then the children (prefix


True, the XML Schema never declares a root element for its instances (valid
xml files), but there is one for the schema itself (the <schema> tag).
Seeing your answer, I can't hold myself to ask you this : Are you trying to
parse your XML Schema file (.xsd) ? or your XML files valid against your
schema (.xml or anything else) ? 

2006/7/31, enis enis <enis_ch2001 at yahoo.fr>: 

The problem is that a schema does not define a "root" element , and that's
the main point for me, because I need to work on the file (xml schema or
dtd) as a tree structure, it means the parsing must start by the root
element and then the chidren of the current element (from left to right ->
prefix). So how can I do that ? 

To control your jdom-interest membership:

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.jdom.org/pipermail/jdom-interest/attachments/20060802/9f989dca/attachment.htm

More information about the jdom-interest mailing list