Parse XML Schema in Java

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Anna

    Parse XML Schema in Java

    Hi all.
    I need to parse an XML Schema and get the following information out of
    it:
    list of elements allowed in schema
    list of attributes for each element - which are required and which
    optional
    given an element name get elements that it can contain
    etc.

    Parsing with JDOM XPath seems to be complicated, because there are
    many ways to say something in schema, although it would be my
    preferred way.

    I also looked at JAXB and Xerces, but their APIs seem to be more
    complicated than I need.

    Is there a simple API for doing what I need?

    Thank you very much for help.

    Anna
  • Martin Honnen

    #2
    Re: Parse XML Schema in Java



    Anna wrote:

    [color=blue]
    > I need to parse an XML Schema and get the following information out of
    > it:
    > list of elements allowed in schema
    > list of attributes for each element - which are required and which
    > optional
    > given an element name get elements that it can contain
    > etc.
    >
    > Parsing with JDOM XPath seems to be complicated, because there are
    > many ways to say something in schema, although it would be my
    > preferred way.
    >
    > I also looked at JAXB and Xerces, but their APIs seem to be more
    > complicated than I need.
    >
    > Is there a simple API for doing what I need?[/color]

    The W3C DOM Level 3 has validation module with an API that should allow
    you to get the information that you describe above, it is documented at

    The Oracle XML developers kit as documented at
    Access cloud trials and software downloads for Oracle applications, middleware, database, Java, developer tools, and more.

    claims to implement
    DOM Level 3.0 Validation(work ing draft dated 8th October 2002)
    but I haven't tested that. I don't know whether there are other
    implementations of that DOM specification available, the implementation
    report at

    speaks of three implementations .

    Other than that I think Xerces is the way to go but you have had a look
    at that already as you said.
    --

    Martin Honnen


    Comment

    Working...