[xsd-users] Does polymorphic serializer support streaming?

Danny Yue sheepduke at 163.com
Fri Jun 5 00:10:08 EDT 2015


Hi,

I'm using XSD to serialize some XML data with given XSD. The XML file
could be very large, so it must be serialized with streaming.
`xsi:type' style is used in generated XML.

When I serialize the whole tree using generated `Tree_' function,
`xsi:type' can be serialized normally. However, when I use the
serializer taken from `streaming' directory, those polymorphism
information is lost. All the elements start with their own type name
instead of their parent's type name and `xsi:type'. i.e.
What I want: <node xsi:type="A" attribute="some">
Reality: <A attribute="some">

So, the question is: 
Is there any way to serialize polymorphic elements with streaming?
Or, is it possible to serialize only one element with polymorphism?

I looked at the source code of Codesynthesis XSD tool and googled
a lot but didn't find any helpful information. I guess it's because
the document is 'sliced'. But I don't understand whether XSD or Xerces
holds the polymorphism information? How to "restore" the information
for each element? 

Other info:
OS: Gentoo Linux 4.0.4 
XSD: 4.0.0
Xerces-C: 3.1.1

Could someone please help me? 
Thanks a lot in advance :-)

Danny



More information about the xsd-users mailing list