XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Lee HumphriesSubject: SS4.5 103k Bug: DTD to XSD wizard makes bad schema
Author: Lee Humphries
Date: 24 Nov 2002 09:59 PM
The attached DTD when run through the DTD to XSD wizard generates an XSD schema that fails validation - specifically the Unique Particle Attribution rule.


DocumentTree(1).dtd


DocumentTree(1).xsd
The resultant XSD that fails validation

Postnext
Ivan PedruzziSubject: RE: SS4.5 103k Bug: DTD to XSD wizard makes bad schema
Author: Ivan Pedruzzi
Date: 24 Nov 2002 11:29 PM
Lee,
My understanding is that your DTD can't be mapped to xsd (1:1)
The following should be a reasonable solution

{?xml version="1.0"?}
{xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"}
{xsd:element name="Leaf" type="xsd:string"/}
{xsd:element name="Flower" type="xsd:string"/}
{xsd:element name="Branch"}
{xsd:complexType}
{xsd:sequence}
{xsd:choice}
{xsd:element ref="Leaf"/}
{xsd:element ref="Flower"/}
{/xsd:choice}
{xsd:sequence}
{xsd:element ref="Leaf"/}
{xsd:element ref="Flower"/}
{/xsd:sequence}
{/xsd:sequence}
{/xsd:complexType}
{/xsd:element}
{xsd:element name="Root"}
{xsd:complexType}
{xsd:sequence maxOccurs="unbounded"}
{xsd:element ref="Branch"/}
{/xsd:sequence}
{/xsd:complexType}
{/xsd:element}
{/xsd:schema}

Ivan

> -----Original Message-----
> From: stylus-studio-tech Listmanager [mailto:listmanager]
> Sent: Sunday, November 24, 2002 10:16 PM
> To: Recipients of 'stylus-studio-tech' suppressed
> Subject: SS4.5 103k Bug: DTD to XSD wizard makes bad schema
>
>
> From: "Lee Humphries"
>
> The attached DTD when run through the DTD to XSD wizard
> generates an XSD schema that fails validation - specifically
> the Unique Particle Attribution rule.
>
>
>
> To reply: mailto:stylus-studio-tech.6051@edn.exln.com
> To start a new topic: mailto:stylus-studio-tech@edn.exln.com
> To login: http://edn.exln.com/~SSDN
>
>

Postnext
Lee HumphriesSubject: RE: SS4.5 103k Bug: DTD to XSD wizard makes bad schema
Author: Lee Humphries
Date: 25 Nov 2002 12:42 AM
Sorry Ivan, not even close.
What you've written is effectively:
((Leaf | Flower), Leaf, Flower)
Whereas I'm wanting:
(Leaf | Flower | (Leaf, Flower))
i.e. Leaf or Flower or both

Peculiarly this seems to be something very difficult to do with XML schemas, even though it's dead easy with DTDs. That was why I was trying your DTD to XSD wizard.

I've checked the standard and the construct the Wizard generated very definitely violates the Unique Particle Attribution rule. But what I find odd is that it's the rule itself that seems to have the bug. http://www.w3.org/TR/xmlschema-1/#non-ambig
"A content model will violate the unique attribution constraint if it contains two particles which ˇoverlapˇ and which either
are both in the {particles} of a choice or all group "

Postnext
Ivan PedruzziSubject: RE: SS4.5 103k Bug: DTD to XSD wizard makes bad schema
Author: Ivan Pedruzzi
Date: 25 Nov 2002 01:59 AM

Yes you are absolutely right.
This one is the closest definition I can think.

{xsd:element name="Branch"}
{xsd:complexType}>
{xsd:sequence}
{xsd:element ref="Leaf" minOccurs="0"/}
{xsd:element ref="Flower" minOccurs="0"/}
{/xsd:sequence}
{/xsd:complexType}
{/xsd:element}

It validates Leaf or Flower or both but also an empty content.
May be someone will come out with a better idea.

Ivan


> -----Original Message-----
> From: stylus-studio-tech Listmanager [mailto:listmanager]
> Sent: Monday, November 25, 2002 12:59 AM
> To: Recipients of 'stylus-studio-tech' suppressed
> Subject: RE: SS4.5 103k Bug: DTD to XSD wizard makes bad schema
>
>
> From: "Lee Humphries"
>
> Sorry Ivan, not even close.
> What you've written is effectively:
> ((Leaf | Flower), Leaf, Flower)
> Whereas I'm wanting:
> (Leaf | Flower | (Leaf, Flower))
> i.e. Leaf or Flower or both
>
> Peculiarly this seems to be something very difficult to do
> with XML schemas, even though it's dead easy with DTDs. That
> was why I was trying your DTD to XSD wizard.
>
> I've checked the standard and the construct the Wizard
> generated very definitely violates the Unique Particle
> Attribution rule. But what I find odd is that it's the rule
> itself that seems to have the bug.
> http://www.w3.org/TR/xmlschema-1/#non-ambig
> "A content model
> will violate the unique attribution constraint if it contains
> two particles which .overlap. and which either
> are both in the {particles} of a choice or all group "
>
>
>
> To reply: mailto:stylus-studio-tech.6053@edn.exln.com
> To start a new topic: mailto:stylus-studio-tech@edn.exln.com
> To login: http://edn.exln.com/~SSDN
>
>

Postnext
Lee HumphriesSubject: RE: SS4.5 103k Bug: DTD to XSD wizard makes bad schema
Author: Lee Humphries
Date: 25 Nov 2002 06:27 PM
Hi Ivan,

I've received some advice that
(Leaf | Flower (Leaf, Flower))
is actually bad DTD, and
((Leaf, Flower?) | Flower)
is much better. I tried this and it worked after converting to XSD.

However, I also tried
(Leaf | (Leaf? | Flower))
and converted that to an XSD and I still got a Unique Particle Attribution rule failure.

Any ideas why there's a difference?

Regards, Lee

Posttop
Ivan PedruzziSubject: RE: SS4.5 103k Bug: DTD to XSD wizard makes bad schema
Author: Ivan Pedruzzi
Date: 26 Nov 2002 11:36 AM
Lee,

After discussing with Alby, this is what I believe is happening

1) it validates

When the validator encounter "Leaf" it knows that it could find
"Flower" too.
The presence of "Leaf" is not ambiguous






minOccurs="0"/>






2) it doesn't validate

When the validator encounter "Leaf" it can not determine what
branch of choice to pick
The presence of "Leaf" is ambiguous







minOccurs="0"/>





Ivan






> -----Original Message-----
> From: stylus-studio-tech Listmanager [mailto:listmanager]
> Sent: Monday, November 25, 2002 6:44 PM
> To: Recipients of 'stylus-studio-tech' suppressed
> Subject: RE: SS4.5 103k Bug: DTD to XSD wizard makes bad schema
>
>
> From: "Lee Humphries"
>
> Hi Ivan,
>
> I've received some advice that
> (Leaf | Flower (Leaf, Flower))
> is actually bad DTD, and
> ((Leaf, Flower?) | Flower)
> is much better. I tried this and it worked after converting to XSD.
>
> However, I also tried
> (Leaf | (Leaf? | Flower))
> and converted that to an XSD and I still got a Unique
> Particle Attribution rule failure.
>
> Any ideas why there's a difference?
>
> Regards, Lee
>
>
>
> To reply: mailto:stylus-studio-tech.6057@edn.exln.com
> To start a new topic: mailto:stylus-studio-tech@edn.exln.com
> To login: http://edn.exln.com/~SSDN
>
>

 
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.