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
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
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?
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Automata from a XSD schema
Next Topic:handle import of other documents
Goto Forum:
  


Current Time: Thu Apr 25 01:24:08 GMT 2024

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

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

Back to the top