W3C home > Mailing lists > Public > xmlschema-dev@w3.org > November 2002

Re: Mixed content woes (

From: Francis Brouns <francis.brouns@ou.nl>
Date: Tue, 19 Nov 2002 15:54:16 +0100
Message-ID: <000b01c28fdb$883f3a10$91b01491@otecdev.pwo.ou.nl>
To: <xmlschema-dev@w3.org>


> Are you sure?  Note that your declaration only allows _one_ of a, b or
> c inside x.  Please send sample instance doc't and XSV error message.

Well, I am sure that XSV reports an error. I am not sure whether my model is
correct. In the DTD the model is <!ELEMENT x (#PCDATA | a | b | c)*. This
should be transformed to the corresponding xml schema complex type. As far
as I know, the * is required for mixed content models in a DTD. This
particular instance should specify that x contains either #pcdata, or a, or
b, or c. Maybe I have to specify a minOccurs on the choice compositor??

Below are the schema and relevant documents

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified">
 <xs:element name="x" type="xtype"/>
 <xs:complexType name="xtype" mixed="true">
   <xs:element ref="a"/>
   <xs:element ref="b"/>
   <xs:element ref="c"/>
 <xs:element name="a" type="xs:string"/>
 <xs:element name="b" type="btype"/>
 <xs:element name="c">
   <xs:attributeGroup ref="attr.ref"/>
 <xs:attributeGroup name="attr.ref">
  <xs:attribute name="ref" use="required"/>
 <xs:complexType name="btype">
   <xs:element name="k"/>
   <xs:element name="l"/>
   <xs:element name="m"/>
   <xs:element name="n"/>
   <xs:element name="o"/>

<?xml version="1.0" encoding="UTF-8"?>
<z xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 <y ref="refid"/>

<xsv xmlns='http://www.w3.org/2000/05/xsv' docElt="{None}z"
     instanceAssessed="true" instanceErrors="1" schemaErrors="0"
     schemaLocs="None -> Document.xsd; None -> Document.xsd"
     target="file:/C:/fbr/untitled5.xml" validation="lax"
     version="XSV 2.0-3 of 2002/11/08 15:08:04">
  <schemaDocAttempt URI="file:/C:/fbr/Document.xsd" outcome="success"
  <schemaDocAttempt URI="file:/C:/fbr/Document.xsd" outcome="redundant"
  <invalid char="9" code="cvc-complex-type.1.2.4" line="5"
    content of x is not allowed to end here (1), expecting
, &apos;{None}:a&apos;, &apos;{None}:b&apos;]:

      <node id="1">
        <edge dest="2" label="{None}:a"/>
        <edge dest="2" label="{None}:b"/>
        <edge dest="2" label="{None}:c"/>
      <node final="true" id="2"/>
Received on Tuesday, 19 November 2002 09:53:01 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:58 UTC