Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » XML Schema Definition (XSD) » Automata from a XSD schema
Automata from a XSD schema [message #72611] Wed, 27 June 2007 10:15 Go to next message
Eclipse UserFriend
Originally posted by: kemoon.tin.it

Hi,
we want to use org.eclipse.xsd library to extract
finite state automata from a schema. How would you do it?
Do you think is enough to extract it from a XSDElementDeclaration?


XSDParticle.DFA dfa =
(XSDParticle.DFA) elemDeclaration.getType().getComplexType().getDFA();


Is there any other way to get a complete list of DFA from a schema?
Re: Automata from a XSD schema [message #72629 is a reply to message #72611] Wed, 27 June 2007 10:39 Go to previous message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Francesca,

Yes, that's the way. Just be careful of a null pointer exception if the
element's type is not complex and getComplexType returns null. At the
root level of a document, any global element from any schema may appear,
but from there on, the approach below for the gives the DFA for the
elements allowed by the current element's type. Note that with an
xsi:type in the instance document, it's really the DFA for this type
that you want to be using to validate the content.


Francesca wrote:
> Hi,
> we want to use org.eclipse.xsd library to extract finite state
> automata from a schema. How would you do it?
> Do you think is enough to extract it from a XSDElementDeclaration?
>
>
> XSDParticle.DFA dfa = (XSDParticle.DFA)
> elemDeclaration.getType().getComplexType().getDFA();
>
> Is there any other way to get a complete list of DFA from a schema?
>
Re: Automata from a XSD schema [message #602457 is a reply to message #72611] Wed, 27 June 2007 10:39 Go to previous message
Eclipse UserFriend
Francesca,

Yes, that's the way. Just be careful of a null pointer exception if the
element's type is not complex and getComplexType returns null. At the
root level of a document, any global element from any schema may appear,
but from there on, the approach below for the gives the DFA for the
elements allowed by the current element's type. Note that with an
xsi:type in the instance document, it's really the DFA for this type
that you want to be using to validate the content.


Francesca wrote:
> Hi,
> we want to use org.eclipse.xsd library to extract finite state
> automata from a schema. How would you do it?
> Do you think is enough to extract it from a XSDElementDeclaration?
>
>
> XSDParticle.DFA dfa = (XSDParticle.DFA)
> elemDeclaration.getType().getComplexType().getDFA();
>
> Is there any other way to get a complete list of DFA from a schema?
>
Previous Topic:Automata from a XSD schema
Next Topic:handle import of other documents
Goto Forum:
  


Current Time: Mon Feb 17 19:00:48 GMT 2025

Powered by FUDForum. Page generated in 0.03719 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top