Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » XML Schema Definition (XSD) » Unique Particle Attribution
Unique Particle Attribution [message #46630] Wed, 02 June 2004 10:44 Go to next message
Joachim Lusiardi is currently offline Joachim Lusiardi
Messages: 18
Registered: July 2009
Junior Member
Hey folks,
is there a simple way of checking wether a schema violates this rule or not?
Thanks for your answers in advance
greets Joachim Lusiardi
Re: Unique Particle Attribution [message #46650 is a reply to message #46630] Wed, 02 June 2004 10:54 Go to previous messageGo to next message
Eclipse User
Originally posted by: merks.ca.ibm.com

--------------574DD4982E3CFB6498A84D5F
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Joachim,

The XSD model does validate this rule. The sample in org.eclipse.xsd.test/test
supports

xsd-test.bat -validate <*.xsd>

that will produce messages for all the problems in the schema. You can also
call validate() programmatically on an XSDComplexTypeDefinition to just check
it. You can even call XSDParticle.getDFA to look at the state machine itself.


Joachim Lusiardi wrote:

> Hey folks,
> is there a simple way of checking wether a schema violates this rule or not?
> Thanks for your answers in advance
> greets Joachim Lusiardi

--------------574DD4982E3CFB6498A84D5F
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Joachim,
<p>The XSD model does validate this rule.&nbsp;&nbsp; The sample in org.eclipse.xsd.test/test
supports
<blockquote>xsd-test.bat -validate&nbsp; &lt;*.xsd></blockquote>
that will produce messages for all the problems in the schema.&nbsp; You
can also call validate() programmatically on an XSDComplexTypeDefinition
to just check it.&nbsp; You can even call XSDParticle.getDFA to look at
the state machine itself.
<br>&nbsp;
<p>Joachim Lusiardi wrote:
<blockquote TYPE=CITE>Hey folks,
<br>is there a simple way of checking wether a schema violates this rule
or not?
<br>Thanks for your answers in advance
<br>greets Joachim Lusiardi</blockquote>
</html>

--------------574DD4982E3CFB6498A84D5F--
Re: Unique Particle Attribution [message #46667 is a reply to message #46650] Wed, 02 June 2004 11:58 Go to previous messageGo to next message
Joachim Lusiardi is currently offline Joachim Lusiardi
Messages: 18
Registered: July 2009
Junior Member
Ok this works, i get diagnotic messages from a schema via
schema.validate();
EList diags = schema.getAllDiagnostics();
but in this EList all message appear twice. what do i do wrong?
greets joachim

Ed Merks wrote:
> Joachim,
>
> The XSD model does validate this rule. The sample in
> org.eclipse.xsd.test/test supports
>
> xsd-test.bat -validate <*.xsd>
>
> that will produce messages for all the problems in the schema. You can
> also call validate() programmatically on an XSDComplexTypeDefinition to
> just check it. You can even call XSDParticle.getDFA to look at the
> state machine itself.
>
>
> Joachim Lusiardi wrote:
>
>> Hey folks,
>> is there a simple way of checking wether a schema violates this rule
>> or not?
>> Thanks for your answers in advance
>> greets Joachim Lusiardi
>
Re: Unique Particle Attribution [message #46682 is a reply to message #46667] Wed, 02 June 2004 12:11 Go to previous messageGo to next message
Eclipse User
Originally posted by: merks.ca.ibm.com

Joachim,

That's not what I see. Can you provide more details?

Joachim Lusiardi wrote:

> Ok this works, i get diagnotic messages from a schema via
> schema.validate();
> EList diags = schema.getAllDiagnostics();
> but in this EList all message appear twice. what do i do wrong?
> greets joachim
>
> Ed Merks wrote:
> > Joachim,
> >
> > The XSD model does validate this rule. The sample in
> > org.eclipse.xsd.test/test supports
> >
> > xsd-test.bat -validate <*.xsd>
> >
> > that will produce messages for all the problems in the schema. You can
> > also call validate() programmatically on an XSDComplexTypeDefinition to
> > just check it. You can even call XSDParticle.getDFA to look at the
> > state machine itself.
> >
> >
> > Joachim Lusiardi wrote:
> >
> >> Hey folks,
> >> is there a simple way of checking wether a schema violates this rule
> >> or not?
> >> Thanks for your answers in advance
> >> greets Joachim Lusiardi
> >
Re: Unique Particle Attribution [message #46751 is a reply to message #46682] Wed, 02 June 2004 12:15 Go to previous messageGo to next message
Joachim Lusiardi is currently offline Joachim Lusiardi
Messages: 18
Registered: July 2009
Junior Member
ok i have the following XSD:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3.org/2001/XMLSchema
file:/home/shing19m/bin/Exchanger%20XML%20Editor/types/XML%2 0Schema/Validation/XMLSchema.xsd ">
<!--
Definition eines Elements mit Verweis auf den SimpleType
-->
<xs:element name="Name" type="MyComplexType" />
<!--
Definition eines simplen Typs
-->
<xs:complexType name="MyComplexType">
<!--minOccurs="2" maxOccurs="3"-->
<xs:sequence>
<xs:element name="a" type="xs:string" />
<xs:choice minOccurs="1" maxOccurs="2">
<xs:sequence>
<xs:element name="b" type="xs:string" />
<xs:element name="f" type="xs:string" />
</xs:sequence>
<xs:sequence>
<xs:element name="b" type="xs:string" />
<xs:element name="d" type="xs:string" />
</xs:sequence>
<!--
<xs:sequence>
<xs:element name="t3" type="xs:byte" />
</xs:sequence>
-->
</xs:choice>
</xs:sequence>
<xs:attribute name="att" type="xs:string" />
</xs:complexType>
</xs:schema>

and the following code here:

private void validateSchema(XSDSchema schema) {
schema.validate();
EList diags = schema.getAllDiagnostics();
int count = diags.size();
for (int i = 0; i < count; i++) {
XSDDiagnostic diag = (XSDDiagnostic) diags.get(i);
System.out.println(i
+ " "
+ diag.getMessage()
+ " "
+ diag.getLocation()
+ " "
+ diag.getLine()
+ " "
+ diag.getColumn()
+ " "
+ diag.getAnnotationURI());
}

}

if i call the code i get as result these 2 lines:

0 XSD: The element '#b' may not overlap with another element ll1.xsd 15
4 null

1 XSD: The element '#b' may not overlap with another element ll1.xsd 15
4 null

the XSDDiagnostic Objects are not equal (hashvalue different)

tell me what details you need and i will try to get them.
greets joachim
Ed Merks wrote:
> Joachim,
>
> That's not what I see. Can you provide more details?
>
> Joachim Lusiardi wrote:
>
>
>>Ok this works, i get diagnotic messages from a schema via
>> schema.validate();
>> EList diags = schema.getAllDiagnostics();
>>but in this EList all message appear twice. what do i do wrong?
>>greets joachim
>>
>>Ed Merks wrote:
>>
>>>Joachim,
>>>
>>>The XSD model does validate this rule. The sample in
>>>org.eclipse.xsd.test/test supports
>>>
>>> xsd-test.bat -validate <*.xsd>
>>>
>>>that will produce messages for all the problems in the schema. You can
>>>also call validate() programmatically on an XSDComplexTypeDefinition to
>>>just check it. You can even call XSDParticle.getDFA to look at the
>>>state machine itself.
>>>
>>>
>>>Joachim Lusiardi wrote:
>>>
>>>
>>>>Hey folks,
>>>>is there a simple way of checking wether a schema violates this rule
>>>>or not?
>>>>Thanks for your answers in advance
>>>>greets Joachim Lusiardi
>>>
>
Re: Unique Particle Attribution [message #46786 is a reply to message #46751] Wed, 02 June 2004 13:46 Go to previous message
Eclipse User
Originally posted by: merks.ca.ibm.com

Joachim,

Each "b" overlaps with the other "b". It's hard to give good locations for these errors because
by using model group references or element references, it's possible that none of the stuff that
causes a problem actually appears nested in the complex type but rather is only referenced and
appears elsewhere.


Joachim Lusiardi wrote:

> ok i have the following XSD:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://www.w3.org/2001/XMLSchema
> file:/home/shing19m/bin/Exchanger%20XML%20Editor/types/XML%2 0Schema/Validation/XMLSchema.xsd ">
> <!--
> Definition eines Elements mit Verweis auf den SimpleType
> -->
> <xs:element name="Name" type="MyComplexType" />
> <!--
> Definition eines simplen Typs
> -->
> <xs:complexType name="MyComplexType">
> <!--minOccurs="2" maxOccurs="3"-->
> <xs:sequence>
> <xs:element name="a" type="xs:string" />
> <xs:choice minOccurs="1" maxOccurs="2">
> <xs:sequence>
> <xs:element name="b" type="xs:string" />
> <xs:element name="f" type="xs:string" />
> </xs:sequence>
> <xs:sequence>
> <xs:element name="b" type="xs:string" />
> <xs:element name="d" type="xs:string" />
> </xs:sequence>
> <!--
> <xs:sequence>
> <xs:element name="t3" type="xs:byte" />
> </xs:sequence>
> -->
> </xs:choice>
> </xs:sequence>
> <xs:attribute name="att" type="xs:string" />
> </xs:complexType>
> </xs:schema>
>
> and the following code here:
>
> private void validateSchema(XSDSchema schema) {
> schema.validate();
> EList diags = schema.getAllDiagnostics();
> int count = diags.size();
> for (int i = 0; i < count; i++) {
> XSDDiagnostic diag = (XSDDiagnostic) diags.get(i);
> System.out.println(i
> + " "
> + diag.getMessage()
> + " "
> + diag.getLocation()
> + " "
> + diag.getLine()
> + " "
> + diag.getColumn()
> + " "
> + diag.getAnnotationURI());
> }
>
> }
>
> if i call the code i get as result these 2 lines:
>
> 0 XSD: The element '#b' may not overlap with another element ll1.xsd 15
> 4 null
>
> 1 XSD: The element '#b' may not overlap with another element ll1.xsd 15
> 4 null
>
> the XSDDiagnostic Objects are not equal (hashvalue different)
>
> tell me what details you need and i will try to get them.
> greets joachim
> Ed Merks wrote:
> > Joachim,
> >
> > That's not what I see. Can you provide more details?
> >
> > Joachim Lusiardi wrote:
> >
> >
> >>Ok this works, i get diagnotic messages from a schema via
> >> schema.validate();
> >> EList diags = schema.getAllDiagnostics();
> >>but in this EList all message appear twice. what do i do wrong?
> >>greets joachim
> >>
> >>Ed Merks wrote:
> >>
> >>>Joachim,
> >>>
> >>>The XSD model does validate this rule. The sample in
> >>>org.eclipse.xsd.test/test supports
> >>>
> >>> xsd-test.bat -validate <*.xsd>
> >>>
> >>>that will produce messages for all the problems in the schema. You can
> >>>also call validate() programmatically on an XSDComplexTypeDefinition to
> >>>just check it. You can even call XSDParticle.getDFA to look at the
> >>>state machine itself.
> >>>
> >>>
> >>>Joachim Lusiardi wrote:
> >>>
> >>>
> >>>>Hey folks,
> >>>>is there a simple way of checking wether a schema violates this rule
> >>>>or not?
> >>>>Thanks for your answers in advance
> >>>>greets Joachim Lusiardi
> >>>
> >
Re: Unique Particle Attribution [message #587957 is a reply to message #46630] Wed, 02 June 2004 10:54 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 26054
Registered: July 2009
Senior Member
--------------574DD4982E3CFB6498A84D5F
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Joachim,

The XSD model does validate this rule. The sample in org.eclipse.xsd.test/test
supports

xsd-test.bat -validate <*.xsd>

that will produce messages for all the problems in the schema. You can also
call validate() programmatically on an XSDComplexTypeDefinition to just check
it. You can even call XSDParticle.getDFA to look at the state machine itself.


Joachim Lusiardi wrote:

> Hey folks,
> is there a simple way of checking wether a schema violates this rule or not?
> Thanks for your answers in advance
> greets Joachim Lusiardi

--------------574DD4982E3CFB6498A84D5F
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Joachim,
<p>The XSD model does validate this rule.&nbsp;&nbsp; The sample in org.eclipse.xsd.test/test
supports
<blockquote>xsd-test.bat -validate&nbsp; &lt;*.xsd></blockquote>
that will produce messages for all the problems in the schema.&nbsp; You
can also call validate() programmatically on an XSDComplexTypeDefinition
to just check it.&nbsp; You can even call XSDParticle.getDFA to look at
the state machine itself.
<br>&nbsp;
<p>Joachim Lusiardi wrote:
<blockquote TYPE=CITE>Hey folks,
<br>is there a simple way of checking wether a schema violates this rule
or not?
<br>Thanks for your answers in advance
<br>greets Joachim Lusiardi</blockquote>
</html>

--------------574DD4982E3CFB6498A84D5F--
Re: Unique Particle Attribution [message #587967 is a reply to message #46650] Wed, 02 June 2004 11:58 Go to previous message
Joachim Lusiardi is currently offline Joachim Lusiardi
Messages: 18
Registered: July 2009
Junior Member
Ok this works, i get diagnotic messages from a schema via
schema.validate();
EList diags = schema.getAllDiagnostics();
but in this EList all message appear twice. what do i do wrong?
greets joachim

Ed Merks wrote:
> Joachim,
>
> The XSD model does validate this rule. The sample in
> org.eclipse.xsd.test/test supports
>
> xsd-test.bat -validate <*.xsd>
>
> that will produce messages for all the problems in the schema. You can
> also call validate() programmatically on an XSDComplexTypeDefinition to
> just check it. You can even call XSDParticle.getDFA to look at the
> state machine itself.
>
>
> Joachim Lusiardi wrote:
>
>> Hey folks,
>> is there a simple way of checking wether a schema violates this rule
>> or not?
>> Thanks for your answers in advance
>> greets Joachim Lusiardi
>
Re: Unique Particle Attribution [message #587978 is a reply to message #46667] Wed, 02 June 2004 12:11 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 26054
Registered: July 2009
Senior Member
Joachim,

That's not what I see. Can you provide more details?

Joachim Lusiardi wrote:

> Ok this works, i get diagnotic messages from a schema via
> schema.validate();
> EList diags = schema.getAllDiagnostics();
> but in this EList all message appear twice. what do i do wrong?
> greets joachim
>
> Ed Merks wrote:
> > Joachim,
> >
> > The XSD model does validate this rule. The sample in
> > org.eclipse.xsd.test/test supports
> >
> > xsd-test.bat -validate <*.xsd>
> >
> > that will produce messages for all the problems in the schema. You can
> > also call validate() programmatically on an XSDComplexTypeDefinition to
> > just check it. You can even call XSDParticle.getDFA to look at the
> > state machine itself.
> >
> >
> > Joachim Lusiardi wrote:
> >
> >> Hey folks,
> >> is there a simple way of checking wether a schema violates this rule
> >> or not?
> >> Thanks for your answers in advance
> >> greets Joachim Lusiardi
> >
Re: Unique Particle Attribution [message #587985 is a reply to message #46682] Wed, 02 June 2004 12:15 Go to previous message
Joachim Lusiardi is currently offline Joachim Lusiardi
Messages: 18
Registered: July 2009
Junior Member
ok i have the following XSD:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3.org/2001/XMLSchema
file:/home/shing19m/bin/Exchanger%20XML%20Editor/types/XML%2 0Schema/Validation/XMLSchema.xsd ">
<!--
Definition eines Elements mit Verweis auf den SimpleType
-->
<xs:element name="Name" type="MyComplexType" />
<!--
Definition eines simplen Typs
-->
<xs:complexType name="MyComplexType">
<!--minOccurs="2" maxOccurs="3"-->
<xs:sequence>
<xs:element name="a" type="xs:string" />
<xs:choice minOccurs="1" maxOccurs="2">
<xs:sequence>
<xs:element name="b" type="xs:string" />
<xs:element name="f" type="xs:string" />
</xs:sequence>
<xs:sequence>
<xs:element name="b" type="xs:string" />
<xs:element name="d" type="xs:string" />
</xs:sequence>
<!--
<xs:sequence>
<xs:element name="t3" type="xs:byte" />
</xs:sequence>
-->
</xs:choice>
</xs:sequence>
<xs:attribute name="att" type="xs:string" />
</xs:complexType>
</xs:schema>

and the following code here:

private void validateSchema(XSDSchema schema) {
schema.validate();
EList diags = schema.getAllDiagnostics();
int count = diags.size();
for (int i = 0; i < count; i++) {
XSDDiagnostic diag = (XSDDiagnostic) diags.get(i);
System.out.println(i
+ " "
+ diag.getMessage()
+ " "
+ diag.getLocation()
+ " "
+ diag.getLine()
+ " "
+ diag.getColumn()
+ " "
+ diag.getAnnotationURI());
}

}

if i call the code i get as result these 2 lines:

0 XSD: The element '#b' may not overlap with another element ll1.xsd 15
4 null

1 XSD: The element '#b' may not overlap with another element ll1.xsd 15
4 null

the XSDDiagnostic Objects are not equal (hashvalue different)

tell me what details you need and i will try to get them.
greets joachim
Ed Merks wrote:
> Joachim,
>
> That's not what I see. Can you provide more details?
>
> Joachim Lusiardi wrote:
>
>
>>Ok this works, i get diagnotic messages from a schema via
>> schema.validate();
>> EList diags = schema.getAllDiagnostics();
>>but in this EList all message appear twice. what do i do wrong?
>>greets joachim
>>
>>Ed Merks wrote:
>>
>>>Joachim,
>>>
>>>The XSD model does validate this rule. The sample in
>>>org.eclipse.xsd.test/test supports
>>>
>>> xsd-test.bat -validate <*.xsd>
>>>
>>>that will produce messages for all the problems in the schema. You can
>>>also call validate() programmatically on an XSDComplexTypeDefinition to
>>>just check it. You can even call XSDParticle.getDFA to look at the
>>>state machine itself.
>>>
>>>
>>>Joachim Lusiardi wrote:
>>>
>>>
>>>>Hey folks,
>>>>is there a simple way of checking wether a schema violates this rule
>>>>or not?
>>>>Thanks for your answers in advance
>>>>greets Joachim Lusiardi
>>>
>
Re: Unique Particle Attribution [message #587994 is a reply to message #46751] Wed, 02 June 2004 13:46 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 26054
Registered: July 2009
Senior Member
Joachim,

Each "b" overlaps with the other "b". It's hard to give good locations for these errors because
by using model group references or element references, it's possible that none of the stuff that
causes a problem actually appears nested in the complex type but rather is only referenced and
appears elsewhere.


Joachim Lusiardi wrote:

> ok i have the following XSD:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://www.w3.org/2001/XMLSchema
> file:/home/shing19m/bin/Exchanger%20XML%20Editor/types/XML%2 0Schema/Validation/XMLSchema.xsd ">
> <!--
> Definition eines Elements mit Verweis auf den SimpleType
> -->
> <xs:element name="Name" type="MyComplexType" />
> <!--
> Definition eines simplen Typs
> -->
> <xs:complexType name="MyComplexType">
> <!--minOccurs="2" maxOccurs="3"-->
> <xs:sequence>
> <xs:element name="a" type="xs:string" />
> <xs:choice minOccurs="1" maxOccurs="2">
> <xs:sequence>
> <xs:element name="b" type="xs:string" />
> <xs:element name="f" type="xs:string" />
> </xs:sequence>
> <xs:sequence>
> <xs:element name="b" type="xs:string" />
> <xs:element name="d" type="xs:string" />
> </xs:sequence>
> <!--
> <xs:sequence>
> <xs:element name="t3" type="xs:byte" />
> </xs:sequence>
> -->
> </xs:choice>
> </xs:sequence>
> <xs:attribute name="att" type="xs:string" />
> </xs:complexType>
> </xs:schema>
>
> and the following code here:
>
> private void validateSchema(XSDSchema schema) {
> schema.validate();
> EList diags = schema.getAllDiagnostics();
> int count = diags.size();
> for (int i = 0; i < count; i++) {
> XSDDiagnostic diag = (XSDDiagnostic) diags.get(i);
> System.out.println(i
> + " "
> + diag.getMessage()
> + " "
> + diag.getLocation()
> + " "
> + diag.getLine()
> + " "
> + diag.getColumn()
> + " "
> + diag.getAnnotationURI());
> }
>
> }
>
> if i call the code i get as result these 2 lines:
>
> 0 XSD: The element '#b' may not overlap with another element ll1.xsd 15
> 4 null
>
> 1 XSD: The element '#b' may not overlap with another element ll1.xsd 15
> 4 null
>
> the XSDDiagnostic Objects are not equal (hashvalue different)
>
> tell me what details you need and i will try to get them.
> greets joachim
> Ed Merks wrote:
> > Joachim,
> >
> > That's not what I see. Can you provide more details?
> >
> > Joachim Lusiardi wrote:
> >
> >
> >>Ok this works, i get diagnotic messages from a schema via
> >> schema.validate();
> >> EList diags = schema.getAllDiagnostics();
> >>but in this EList all message appear twice. what do i do wrong?
> >>greets joachim
> >>
> >>Ed Merks wrote:
> >>
> >>>Joachim,
> >>>
> >>>The XSD model does validate this rule. The sample in
> >>>org.eclipse.xsd.test/test supports
> >>>
> >>> xsd-test.bat -validate <*.xsd>
> >>>
> >>>that will produce messages for all the problems in the schema. You can
> >>>also call validate() programmatically on an XSDComplexTypeDefinition to
> >>>just check it. You can even call XSDParticle.getDFA to look at the
> >>>state machine itself.
> >>>
> >>>
> >>>Joachim Lusiardi wrote:
> >>>
> >>>
> >>>>Hey folks,
> >>>>is there a simple way of checking wether a schema violates this rule
> >>>>or not?
> >>>>Thanks for your answers in advance
> >>>>greets Joachim Lusiardi
> >>>
> >
Previous Topic:Unique Particle Attribution
Next Topic:xsd plugin directory structure
Goto Forum:
  


Current Time: Sat Sep 20 18:13:28 GMT 2014

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

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