<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<STYLE type=text/css>DIV {
        MARGIN: 0px
}
</STYLE>
<META content="MSHTML 6.00.2900.2912" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=284514412-02082006><FONT face=Arial
color=#0000ff size=2>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.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=284514412-02082006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=284514412-02082006><FONT face=Arial
color=#0000ff size=2>Michael Kay</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=284514412-02082006><FONT face=Arial
color=#0000ff size=2>http://www.saxonica.com/</FONT></SPAN></DIV><BR>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> enis enis [mailto:enis_ch2001@yahoo.fr]
<BR><B>Sent:</B> 02 August 2006 13:29<BR><B>To:</B> Michael Kay;
jdom-interest@jdom.org<BR><B>Subject:</B> Re : [jdom-interest] Parsing an XML
Schema<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV
style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">
<DIV style="TEXT-ALIGN: left">Is there an XML Schema processor that makes this
analysis ?<BR></DIV><FONT size=+0><FONT face="Arial, Helvetica, sans-serif"
color=#330099><BR></FONT></FONT>>>>>>>><BR>
<DIV
style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman,new york,times,serif">
<DIV
style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman,new york,times,serif">
<STYLE type=text/css>DIV {
        MARGIN: 0px
}
</STYLE>
<DIV dir=ltr align=left><SPAN class=215241717-01082006><FONT face=Arial
color=#0000ff size=2>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.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=215241717-01082006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=215241717-01082006><FONT face=Arial
color=#0000ff size=2>Michael Kay</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=215241717-01082006><FONT face=Arial
color=#0000ff size=2><SPAN><A href="http://www.saxonica.com/"
target=_blank>http://www.saxonica.com/</A></SPAN></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=215241717-01082006></SPAN> </DIV><BR>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: rgb(0,0,255) 2px solid; MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> jdom-interest-bounces@jdom.org
[mailto:jdom-interest-bounces@jdom.org] <B>On Behalf Of </B>enis
enis<BR><B>Sent:</B> 01 August 2006 16:41<BR><B>To:</B> Kevin POCHAT;
jdom-interest@jdom.org<BR><B>Subject:</B> Re : [jdom-interest] Parsing an
XML Schema<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV
style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman,new york,times,serif">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
parcours).<BR><BR>>>>>>>><BR>
<DIV
style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman,new york,times,serif">
<DIV
style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman,new york,times,serif">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).<BR>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) ? <BR><BR><BR>
<DIV><SPAN class=gmail_quote>2006/7/31, enis enis <<A id=bodyLinks
href="mailto:enis_ch2001@yahoo.fr" target=_blank
rel=nofollow>enis_ch2001@yahoo.fr</A>>:</SPAN>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: 1px solid">
<DIV>
<DIV>
<DIV
style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman,new york,times,serif"></DIV>
<DIV><SPAN class=q>
<DIV style="TEXT-ALIGN: left"><FONT size=3><SPAN
style="FONT-FAMILY: monospace"></SPAN>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 ?
<BR><BR></FONT><FONT size=3><A id=bodyLinks target=_blank
rel=nofollow></A></FONT></DIV><FONT
size=3></FONT></SPAN></DIV></DIV></DIV></BLOCKQUOTE></DIV><BR>
<DIV>_______________________________________________<BR>To control your
jdom-interest membership:<BR><A id=bodyLinks
href="http://www.jdom.org/mailman/options/jdom-interest/youraddr@yourhost.com"
target=_blank
rel=nofollow>http://www.jdom.org/mailman/options/jdom-interest/youraddr@yourhost.com</A></DIV></DIV><BR></DIV></DIV></BLOCKQUOTE></DIV><BR></DIV></DIV></BLOCKQUOTE></BODY></HTML>