W3C home > Mailing lists > Public > xmlschema-dev@w3.org > September 2006

Re: special tags

From: Debora Vanni <debora.vanni@tvblob.com>
Date: Fri, 22 Sep 2006 10:48:31 +0200
To: "G. Ken Holman" <gkholman@CraneSoftwrights.com>
Cc: xmlschema-dev@w3.org
Message-Id: <1158914911.8344.35.camel@localhost.localdomain>

Thank you very much for your help!
It works with "sequence" but not with "all".
We have user, client, server. User doesn't know nothing about xml, the
client send to me(server!!) the xml message but it can't garantee the
order of tags, that's why I must use "all".
I'm using an old version of libxml2, if you know if it possible to do
that with "all" or if you could try it with MSV, Altova, Saxon and
Xerces, I could insist for updating that library.
Thank you very much anyway
Debora Vanni

Il giorno gio, 21/09/2006 alle 20.01 -0400, G. Ken Holman ha scritto:
> At 2006-09-21 18:34 +0200, Debora Vanni wrote:
> >That it doesn't work: it says that element choice has an invalid
> >content.
> 
> A transcript below shows it working with MSV, Altova, Saxon and Xerces.
> 
> >I didn't find anywhere that I can write both "all" and "choice" inside
> >the same complextype, is that possible?
> >I probably need somenthing like "union" but for complex type, is there
> >somenting like that?
> 
> You haven't indicated why you are using 
> xs:all.  I've learned that when order is not 
> important, it is better for downstream processing 
> to impose one.  As well, the user doesn't get the 
> impression that they have to guess which order to 
> use, nor do they think they are getting any 
> additional semantic by choosing a particular order.
> 
> I'm sorry I have no other suggestions to offer you.
> 
> . . . . . . . . . . . . Ken
> 
> T:\ftemp>type debora.xml
> <?xml version="1.0" encoding="US-ASCII"?>
> <test>
>            <parameters>
>                  <family-name>Rossi</family-name>
>                  <first-name>Paolo</first-name>
>                  <cod-fisc>123123123</cod-fisc>
>                <home-address>via Vai</home-address>
>                <cell-phone>12354356</cell-phone>
>                <e-mail> pippo@yrr.it.net</e-mail>
>              </parameters>
> 
>            <parameters>
>                  <family-name>Rossi</family-name>
>                  <first-name>Paolo</first-name>
>                  <cod-fisc>123123123</cod-fisc>
>                <home-address>via Vai</home-address>
>                <cell-phone>12354356</cell-phone>
> 
>              </parameters>
> 
>            <parameters>
>                  <family-name>Rossi</family-name>
>                  <first-name>Paolo</first-name>
>                  <cod-fisc>123123123</cod-fisc>
>                <home-address>via Vai</home-address>
> 
>                <e-mail> pippo@yrr.it.net</e-mail>
>              </parameters>
> </test>
> 
> T:\ftemp>type debora.xsd
> <?xml version="1.0" encoding="US-ASCII"?>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
> 
> <xs:element name="test">
>    <xs:complexType>
>      <xs:sequence>
>        <xs:element ref="parameters" maxOccurs="unbounded"/>
>      </xs:sequence>
>    </xs:complexType>
> </xs:element>
> 
> <xs:element name="parameters">
>    <xs:complexType>
>      <xs:sequence>
>        <xs:element name="family-name" type = "simple_text"/>
>        <xs:element name="first-name" type = "simple_text"/>
>        <xs:element name="cod-fisc" type = "alfa_numeric"/>
>        <xs:element name="home-address" type = "simple_text"/>
>        <xs:choice>
>           <xs:sequence>
>             <xs:element name="cell-phone" type = "simple_text"/>
>             <xs:element name="e-mail" type = "simple_text" minOccurs="0"/>
>           </xs:sequence>
>           <xs:sequence>
>             <xs:element name="e-mail" type = "simple_text"/>
>             <xs:element name="cell-phone" type = "simple_text" minOccurs="0"/>
>           </xs:sequence>
>        </xs:choice>
>      </xs:sequence>
>    </xs:complexType>
> </xs:element>
> 
> <xs:simpleType name="simple_text">
>    <xs:restriction base="xs:string"/>
> </xs:simpleType>
> 
> <xs:simpleType name="alfa_numeric">
>    <xs:restriction base="xs:string"/>
> </xs:simpleType>
> 
> </xs:schema>
> 
> T:\ftemp>call w3cschema-msv debora.xsd debora.xml
> No validation errors.
> 
> T:\ftemp>call w3cschema-altova debora.xsd debora.xml
> Altova
> The XML data is valid
> 
> T:\ftemp>call w3cschema-saxon debora.xsd debora.xml
> 
> T:\ftemp>call w3cschema-xerces debora.xsd debora.xml
> No validation errors.
> 
> 
> --
> UBL/XML/XSLT/XSL-FO training: Vårø, Denmark 2006-10-02/06,11-20/24
> UBL International 2006  2006-11-13/17 http://www.ublconference.com
> World-wide corporate, govt. & user group UBL, XSL, & XML training.
> G. Ken Holman                 mailto:gkholman@CraneSoftwrights.com
> Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/x/
> Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
> Male Cancer Awareness Aug'05  http://www.CraneSoftwrights.com/x/bc
> Legal business disclaimers:  http://www.CraneSoftwrights.com/legal
> 
> 
> 
-- 
 Debora Vanni - TVBLOB S.r.l.
 Software Engineer

 Via G. Paisiello, 9 20131 Milano, Italia
 -----------------------------------------
 Phone +39 02 36562440
 Fax +39 02 20408347
 Web Site http://www.tvblob.com
 E-mail debora.vanni@tvblob.com
Received on Friday, 22 September 2006 08:49:02 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:55 GMT