[xsd-users] Problem with mixed content

Boris Kolpackov boris at codesynthesis.com
Fri Jul 30 10:41:42 EDT 2010


Hi Mattia,

Mattia Donna Bianco <mattia.db at gmail.com> writes:

> 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,

How do you write this XML? If it is using the generated code, then
you must have done something extra to support mixed content. Are
you doing something similar to what is shown in the 'mixed' or
'custom/mixed' examples?


> 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 checked the types involved in parsing this fragment and I don't
see how they can trigger this exception. The exception is thrown only
by the internal text_content() function that is only used to extract
data for simple types like xs:string. And the type hierarchy involved
does not inherit from a simple type. Is the exception thrown from
the parsing code or is it perhaps your own code that calls 
text_content()?

If it is thrown by the generated code, can you send a complete XML
document that triggers this error so that I can try to reproduce it?

Boris



More information about the xsd-users mailing list