Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: XS expressivity problem

From: George Cristian Bina <george@----.-->
To: Ciprian Ciubotariu <cheepeero@---.--->
Date: 8/5/2004 8:36:00 PM
Hi Ciprian,

Actually your DTD is not valid, see [1]

<quote 
source="http://www.w3.org/TR/2004/REC-xml-20040204/#sec-element-content">
  For compatibility, it is an error if the content model allows an 
element to match more than one occurrence of an element type in the 
content model. For more information, see E Deterministic Content Models.
</quote>

and further [2]

However, as Tim Bray notes [3] in his annotated XML specification [4] 
this rule will not generally be checked by XML processors.

In general the solution is to write the DTD so that it is deterministic, 
in your case the grammar accepts:
STOCKS
STOCKS, PRICE
STOCKS, STOCKS, PRICE
...
KIT, STOCKS

You can write it as
(KIT, STOCKS) | (STOCKS+, Price?)

[1] http://www.w3.org/TR/2004/REC-xml-20040204/#sec-element-content
[2] http://www.w3.org/TR/2004/REC-xml-20040204/#determinism
[3] http://www.xml.com/axml/notes/Determinism.html
[4] http://www.xml.com/axml/testaxml.htm

Best Regards,
George
-----------------------------------------------
George Cristian Bina
<oXygen/> XML Editor & XSLT Editor/Debugger
www.---.com


Ciprian Ciubotariu wrote:
> Should I also understand that DTDs are not fully convertible to XML schemas?
> Here's an excerpt of a DTD:
> 
> <!ELEMENT ... ((KIT? , STOCKS) | (STOCKS+ , PRICE , ...))
> 
> and here is an excerpt of the XSD generated with oXygen (I found it in your
> signature)
> 
>         <xs:choice>
>           <xs:sequence>
>             <xs:element minOccurs="0" ref="KIT"/>
>             <xs:element ref="STOCKS"/>
>           </xs:sequence>
>           <xs:sequence>
>             <xs:element maxOccurs="unbounded" ref="STOCKS"/>
>             ....
>           </xs:sequence>
>         </xs:choice>
> 
> As you can see, it is almost the same situation as above. Or is it that the
> DTD is not valid? oXygen says it is valid, and I have no further knowledge
> on this issue. As a regular expression it is very valid (at least imo)
> 
> Regards,
> 
> Cipi
> 
> "George Cristian Bina" <george@s...> wrote in message
> news:41121214.90003@s......
> 
>>Hi Ciprian,
>>
>> > I planned to use the following in a schema: inside an <choice> group
>>having
>> > several elements with the same name but different types. Can I write
>>this in
>> > a schema?
>>[...]
>> > 1. Is this construction allowed by the W3C schema specifications?
>>
>>No, you cannot do this in a W3C XML Schema.
>>See http://www.w3.org/TR/xmlschema-1/#cos-element-consistent for details.
>>
>>Best Regards,
>>George
>>-----------------------------------------------
>>George Cristian Bina
>><oXygen/> XML Editor & XSLT Editor/Debugger
>>www.---.com
>>
>>
> 
> 
> 

From w3-xmlschema-dev@m...  Thu Aug  5 11:33:30 2004
Return-Path: <w3-xmlschema-dev@m...>
X-Original-To: xmlsch


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent