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

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] UBL 2, W3C Schema extensibility, and multiple

[ Lists Home | Date Index | Thread Index ]

At 2006-05-23 15:57 +0100, Fraser Goffin wrote:
>I realise this has been a bit painful so I'll try not to prolong this,

It is my fault, Fraser, in my haste I mistyped:

>but for my benefit :-
>
>>   <xs:complexType name="extension">
>>     <xs:sequence>
>>       <xs:any namespace="##other" processContents="skip"
>>               minOccurs="0" maxOccurs="unbounded"/>
>>     </xs:sequence>
>>   </xs:complexType>

In fact it has to be:

   <xs:complexType name="extension">
     <xs:sequence>
       <xs:any namespace="##any" processContents="skip"
               minOccurs="0" maxOccurs="unbounded"/>
     </xs:sequence>
   </xs:complexType>

>I appreciate that you have processContents='skip' and therefore from
>an XSD validating parser perspective that content will (must) not be
>validated (but you will or may be validating it elsewhere right),

I'm hoping to find a W3C Schema pure way of restricting the above to 
include an extension namespace specific to a country or industry sector.

>but
>doesn't the complexType still act as a sort of specification what the
>allowable content is (at least to a reader who may not have yet gotten
>to a description of the layered validation approach that you are
>promoting), and in this case specifically dis-allows content that has
>no namespace affiliation as the immediate child of the extension
>element ?

That was my mistake ... I meant to do ##other and copied the wrong fragment.

>I guess this may be what you want though so, in that case does this :-

No ... I believe because of the W3C Schema restriction that I cannot 
exclude more than one namespace (I have at least four to exclude), I 
have to solve this issue on another layer.

>>and make it a layered business rule that UBL-namespaced constructs
>>(of the four namespaces) are not allowed as immediate children of the
>>UBL extension point based on your earlier comment:
>
>also need to state that the UBL extension MUST also *not * contain an
>immediate child that has no namespace affiliation (or are you
>proposing that so long as its not UBL namespaced content you don't
>care).

That won't apply when I improve my copy/paste skills.

Below is an illustration of what I need that works in ISO/IEC 19757-2 
RELAX-NG ... this is what I would have to be able to do in W3C Schema 
to enforce this without a layer.

Thanks for spotting that mistake of mine, Fraser.

. . . . . . . Ken

Z:\data\kendata\dev\nvdl\ublext>type excl.rnc
namespace a = "urn:x-a"
namespace b = "urn:x-b"
namespace c = "urn:x-c"
namespace d = "urn:x-d"

start = element x
    {
      element * - ( a:* | b:* | c:* | d:* )
       {
          attribute * - ( a:* | b:* | c:* | d:* ) { text }*,
          any
       }*
    }

any = ( text | element * { attribute * { text }*, any } )*

# end
Z:\data\kendata\dev\nvdl\ublext>type excl1.xml
<?xml version="1.0" encoding="US-ASCII"?>
<x>
   <a xmlns="urn:x-a">hello</a>
   <e/>
   <b xmlns="urn:x-b">hello</b>
   <f xmlns="urn:x-f">hello</f>
   <c xmlns="urn:x-c">hello</c>
</x>
Z:\data\kendata\dev\nvdl\ublext>jing -c excl.rnc excl1.xml
Z:\data\kendata\dev\nvdl\ublext\excl1.xml:3: error: element "a" from 
namespace "
urn:x-a" not allowed in this context
Z:\data\kendata\dev\nvdl\ublext\excl1.xml:5: error: element "b" from 
namespace "
urn:x-b" not allowed in this context
Z:\data\kendata\dev\nvdl\ublext\excl1.xml:7: error: element "c" from 
namespace "
urn:x-c" not allowed in this context

Z:\data\kendata\dev\nvdl\ublext>type excl2.xml
<?xml version="1.0" encoding="US-ASCII"?>
<x>
   <e/>
   <f xmlns="urn:x-f">hello</f>
</x>
Z:\data\kendata\dev\nvdl\ublext>jing -c excl.rnc excl2.xml

Z:\data\kendata\dev\nvdl\ublext>


--
Registration open for XSLT/XSL-FO training: Wash.,DC 2006-06-12/16
Also for XSL-FO/XSLT training:    Minneapolis, MN 2006-07-31/08-04
Also for XML/XSLT/XSL-FO/UBL 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/u/
Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
Male Cancer Awareness Aug'05  http://www.CraneSoftwrights.com/u/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS