Automata from a XSD schema [message #72611] |
Wed, 27 June 2007 10:15  |
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  |
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  |
Eclipse User |
|
|
|
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?
>
|
|
|
Powered by
FUDForum. Page generated in 0.03719 seconds