I'm sorry to insist with this, maybe I am very stupid but I still cannot
parse a Schema file.
if I try the code you sent me:
SchemaUnmarshaller schemaHandler = new SchemaUnmarshaller();
Parser parser = ParserFactory.makeParser();
parser.setDocumentHandler(schemaHandler);
parser.parse("file:"+inputFile);
Schema schema = schemaHandler.getSchema();
... = schema.getComplexTypes()
... = schema.getElementDecls()
then I see this kind of things:
[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>
[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>
[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>
which are not really usefull because what I want to do is display at the
screen a kind of tree that represents the tags of the schema file.
if I try to parse it a different way, like this:
Parser parser =
ParserFactory.makeParser("org.apache.xerces.parsers.SAXParser");
parser.setDocumentHandler(this);
parser.parse("file:test.xsd");
my class extends SchemaUnmarshaller and I redefines the methods
startElement, charracters and endElements.
Then I've got this result:
endElement xs:element =
endElement xs:maxLength =
endElement xs:minLength =
endElement xs:restriction
endElement xs:simpleType =
endElement xs:element =
endElement xs:schema =
This is not either the results I want.
What I need to display would be something like this:
REMISE
ID
ADRESS
EMAIL
FUNCTION
DEPARTMENT
ADRESS
TEL
thanks again for any help
Martial
-----Original Message-----
From: Andrew Fawcett [mailto:[EMAIL PROTECTED]
Sent: lundi 9 juillet 2001 15:22
To: '[EMAIL PROTECTED]'
Subject: RE: Schema parser
Hi,
// Parse XML Schema
SchemaUnmarshaller schemaHandler = new SchemaUnmarshaller();
Parser parser = ParserFactory.makeParser();
parser.setDocumentHandler(schemaHandler);
parser.parse("file:"+inputFile);
Schema schema = schemaHandler.getSchema();
... = schema.getComplexTypes()
... = schema.getElementDecls()
It's that easy! ;-)
-----Original Message-----
From: Arnaud Blandin [ mailto:[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> ]
Sent: 09 July 2001 14:17
To: [EMAIL PROTECTED]
Subject: RE: Schema parser
Hi,
Actually there are no examples on how to use the Schema Parser.
It is located under org.exolab.castor.xml.schema.reader.SchemaReader
The API is quite straight-forward and you would not find any problem using
it.
If so just let me know.
Arnaud
> -----Original Message-----
> From: Delahaye, Martial (CAP, CMF, COFRAMI)
> [ mailto:[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> ]
> Sent: Monday, July 09, 2001 1:50 PM
> To: [EMAIL PROTECTED]
> Subject: RE: Schema parser
>
>
> Hi Arnaud,
> Thanks for the advice, but actually which one of the examples
> handles shema
> parsing ?
> The directories of examples are named : dsml, dtx, jdo, myapp,
> oes, servlet,
> SourceGenerator
> I wasn't able to run all the examples. it appears to be a little bit
> difficult.
> Thanks
>
> Martial
>
> ps: any other help concerning Shema parsing would be welcomed.
>
> -----Original Message-----
> From: Arnaud Blandin [ mailto:[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> ]
> Sent: vendredi 6 juillet 2001 18:40
> To: [EMAIL PROTECTED]
> Subject: RE: Schema parser
>
>
> Hi Martial,
>
> you might want to take a look at Castor Schema Object Model
> (www.castor.org).
> It provides a full API to read a schema and write it back.
>
> Arnaud
>
> > -----Original Message-----
> > From: Delahaye, Martial (CAP, CMF, COFRAMI)
> > [ mailto:[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> ]
> > Sent: Friday, July 06, 2001 4:25 PM
> > To: [EMAIL PROTECTED]
> > Subject: Schema parser
> >
> >
> > Hi all,
> >
> > I would like to parse a schema in order to display the tags on
> the screen
> > and then be able to save them somewhere. Is there any way to do this ?
> > Thanks
> >
> > Martial
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]