Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: special tags

From: "G. Ken Holman" <gkholman@----------------.--->
To: xmlschema-dev@--.---
Date: 9/21/2006 4:02:00 PM
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@y...</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@y...</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=E5r=F8, 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@C...
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


From werner.guttmann@g... Fri Sep 22 01:29:34 2006
Received: from wiggum.w3.org ([128.30.52.23])
	by frink.w3.org with esmtp (Exim 4.50)
	id 1GQZrC-0001DB


transparent
Print
Mail
Digg
delicious
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