[xsd-users] Problem with mixed content

Mattia Donna Bianco mattia.db at gmail.com
Fri Jul 30 09:26:59 EDT 2010


Dear Boris,
I'm Mattia Donna Bianco. I used Xsd for some time and it always worked.
Currently I'm working on a LASeR project (a mpeg standard for 
richmedia). In the schema svg3.xsd I have this:

<complexType name="textType" mixed="true">
  <complexContent>
   <extension base="svg:tspanType">
    <sequence>
     <element ref="svg:tspan" minOccurs="0" maxOccurs="unbounded" />
    </sequence>
    <attributeGroup ref="svg:locatable"/>
    <attribute name="editable" type="typ:editableType" use="optional"/>
    <attribute name="rotate" type="typ:floatListType"/>
   </extension>
  </complexContent>
</complexType>
<element name="text" type="svg:textType"/>
<complexType name="tspanType" mixed="true">
  <complexContent>
   <extension base="svg:objectText">
    <attributeGroup ref="svg:properties"/>
    <attributeGroup ref="svg:basic"/>
    <attributeGroup ref="svg:focus"/>
    <attribute name="focusHighlight" type="typ:focusHighlightType"/>
    <attribute name="x" type="typ:coordinateType" />
    <attribute name="y" type="typ:coordinateType" />
    <attribute name="dx" type="typ:coordinateType" />
    <attribute name="dy" type="typ:coordinateType" />
   </extension>
  </complexContent>
</complexType>
<element name="tspan" type="svg:tspanType"/>

When I write a xml file where there is a <tspan> inside a <text>, for 
example

<svg:text id="text1" x="1" y="1">my text
  <svg:tspan>example</svg:tspan>
</svg:text>

there is no problem, but when I try to parse the file created previously
XSD throws this exception:

exception: xsd::cxx::tree::expected_text_content<char> at memory location

I'm using VS 2008 and XSD 3.3.0 on Windows 7.
The schemas validate using the validation tool online provided by w3c 
(http://validate.openlaboratory.net/).
The command I give are:

  xsd cxx-tree --generate-xml-schema --generate-serialization 
--generate-polymorphic XMLSchema.xsd

and

  xsd cxx-tree --generate-wildcard --extern-xml-schema XMLSchema.hxx
  --generate-serialization --generate-polymorphic --file-per-type
  --namespace-map urn:mpeg:mpeg4:LASeR:types:2005=mxm_dataobject::laser
  --namespace-map http://www.w3.org/2000/svg=mxm_dataobject::laser::svg
  --namespace-map urn:mpeg:mpeg4:LASeR:2005=mxm_dataobject::laser
  --namespace-map urn:mpeg:mpeg4:LASeR:types:2005=mxm_dataobject::laser
  --namespace-map http://www.w3.org/2001/xml-events=mxm_dataobject::laser
  --namespace-map http://www.w3.org/XML/1998/namespace=mxm_dataobject::laser
  --namespace-map http://www.w3.org/1999/xlink=mxm_dataobject::laser
  --namespace-map http://www.w3.org/2005/SMIL21=mxm_dataobject::laser
  saf2.xsd

This is the link to download the schemas: 
http://www.mediafire.com/?8o8sa3pp0grk373.
Any helps will be appreciated.
Thanks for the attention, best regards
-- 
Mattia



More information about the xsd-users mailing list