Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » 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 User
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 User
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
Ed Merks is currently offline Ed Merks
Messages: 26137
Registered: July 2009
Senior Member
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: Thu Oct 23 06:52:27 GMT 2014

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

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