[xsd-users] newly added node not in list?

Boris Kolpackov boris at codesynthesis.com
Tue Apr 11 05:19:27 EDT 2006


Oliver,

Oliver.Kowalke at infineon.com <Oliver.Kowalke at infineon.com> writes:

> The problems are caused by following:
> Reading an xml document conforming to hello.xsd is working (I can
> extract text and embedded xml document -> 'text', '<embed
> xmlns="xyz"><t>some text</t></embed>' from the example).
> Now I've problems to build an xml document with xsd generated classes
> (especially the c-node which can contain text or xml document).
>
> Question: How to build up xml document which contains nodes of type
> xsd:any?


The answer really depends on what you are going to do with such a
document. Are you going to serialize it? Are you going to pass it
to other parts of your program that are going to extract the xsd:any
info using DOM API?

If you are going to serialize it then you will need to (1) serialize
statically-typed tree to a DOM document, (2) insert content corresponding
to xsd:any into the DOM document, and (3) serialize DOM document to
XML. In this case there is no point in trying to build statically-typed
tree with nodes that correspond to xsd:any since they are not going
to be picked up by the serialization process.

On the other hand, if you need to build a statically-typed tree as if
it was just read from a file, then I will need to add a _node (DOMNode*)
function to assign DOM nodes to newly created tree nodes. Let me know
if this is the case.

hth,
-boris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 652 bytes
Desc: Digital signature
Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20060411/9f10ebd7/attachment.pgp


More information about the xsd-users mailing list