OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

ubl message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: SV: SV: [ubl] Revised discussion paper on UBL 2.0 subsets, extensions, versions, validation and interchange


At 2006-06-20 14:24 +0200, Bryan  Rasmussen wrote:
>Note that the examples down below the non-determinism actually happens in
>LineItem which is unbounded, instead of in TotalAmount which is  minOccurs 0,
>sorry for the mistake but it is the same problem, by having minOccurs=0 in
>TotalAmount not only do I not know if TotalAmount should be validated strict
>or skip but I don't know if the any LineItem above 1 should either.
>
>Sorry if this was confusing, but I was didn't really pay attention to the
>unboundedness of LineItem until just now.
>
>If I remove LineItem from the schema:
>
>  <xs:complexType>
>       <xs:sequence>
>        <xs:element minOccurs="0" ref="u:Extension"/>
>         <xs:element ref="u:OrderNumber"/>
>         <xs:element ref="u:TotalAmount" minOccurs="0"/>
>         <xs:group ref="u:FutureVersions"/>
>       </xs:sequence>
>     </xs:complexType>
>
>and run it again I get the following from MSXML:
>---------------------------
>Windows Script Host
>---------------------------
>Script: C:\projects\tests\installs\validators\xsv\validate.js
>Linje:  30
>Tegn:   4
>Fejl:
>file:///C:/projects/tests/installs/validators/xsv/kens.xsd#/schema[1]/element
>[position() = 1 and @name = 'Order']/complexType[1]/sequence[1]
>Schema is non-deterministic.
>[{urn:x-oasis:Order-2}TotalAmount]
>Kode:   80004005
>Kilde:  msxml4.dll
>
>---------------------------
>OK
>---------------------------
>and the following from XSV:
>
><xsv docElt="{urn:x-oasis:Order-2}Order" instanceAssessed="true"
>instanceErrors="0" rootType="[Anonymous]" schemaDocs="kens.xsd"
>schemaErrors="1"
>target="file:///C:/projects/tests/installs/validators/xsv/kens.xml"
>validation="strict" version="XSV 2.10-1 of 2005/04/22 13:10:49">
><schemaDocAttempt
>URI="file:///C:/projects/tests/installs/validators/xsv/kens.xsd"
>outcome="success" source="command line"/>
>-
>         <schemaError char="5" line="7" phase="instance"
>resource="file:///C:/projects/tests/installs/validators/xsv/kens.xsd">
>non-deterministic content model for type None: {Wildcard:
>##any}/{urn:x-oasis:Order-2}:TotalAmount
></schemaError>
></xsv>
>
>Obviously without a minOccurs the documents are valid.

Making the above change I again find no errors with Xerces or MSV.

But I see the point you are making ... "just by 
an analysis of the content model a particle might 
either be satisfied by the optional total or by 
the wild card, hence it is non-deterministic".

But in the presence of a set of particles, it is 
absolutely deterministic that if the particle at 
hand is total, it is handled in one direction, 
and if the particle at hand is not total, it is 
handled in another direction.  There is no non-determinism.

If you recall, my comment about non-determinism 
was related to the use of choice groups ... I think you will agree that:

    ( a , b ) | ( a , c )

is non-deterministic.  When I get an "a" I cannot 
tell if it is a particle of the first of the 
choice or the second of the choice.

To reduce your issue, I created the following:

    ( a?, wildcard* )

The above can be illustrated as follows:

T:\br>type is-this-nd.xsd
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";
   elementFormDefault="qualified">
   <xs:element name="test">
     <xs:complexType>
       <xs:sequence>
         <xs:element name="a" minOccurs="0"/>
         <xs:any namespace="##any" processContents="skip"
                 minOccurs="0" maxOccurs="unbounded"/>
       </xs:sequence>
     </xs:complexType>
   </xs:element>
</xs:schema>

T:\br>type is-this-nd.xml
<test><a/><a/></test>

T:\br>xjparse -S is-this-nd.xsd is-this-nd.xml
No validation errors.

T:\br>w3cschema-msv is-this-nd.xsd is-this-nd.xml
No validation errors.

T:\br>

I'm expecting that you will find the above will 
throw errors in Microsoft's processor ... please let me know.

Thank you again, Bryan, for bringing this to 
light with a demonstrative example ... I see your 
point very clearly.  Well done.  I'm pleased to see constructive criticism.

I am willing to accept your assessment and can 
withdraw the proposal based on 
non-implementability (is that a word?) ... can 
anyone else offer a comment on the 
non-determinism?  Does anyone have an opinion 
regarding which processor is correct?

. . . . . . . . . . Ken

--
Registration open for UBL training:    Montréal, Canada 2006-08-07
Also for XSL-FO/XSLT training:    Minneapolis, MN 2006-07-31/08-04
Also for UBL/XML/XSLT/XSL-FO training: Varo,Denmark 06-09-25/10-06
World-wide corporate, govt. & user group UBL, XSL, & XML training.
G. Ken Holman                 mailto:gkholman@CraneSoftwrights.com
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/o/
Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
Male Cancer Awareness Aug'05  http://www.CraneSoftwrights.com/o/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]