[xsd-users] Re: Global elements Re: reading and writing non root elements

Boris Kolpackov boris at codesynthesis.com
Thu Nov 30 09:14:46 EST 2006


Hi Greg,

Greg Carter <greg at permedia.ca> writes:

> That was going to be my comment, why wouldn't XSD generate root element
> code for all global elements.  But now I see that it does.  Of course I
> am a little confused why you didn't just mention that to begin with ;)

I thought I did in my first reply to this thread (where I talked
about two strategies to handle XML fragments, the first being to
define global elements and the second being to do XML-to-DOM parsing
yourself and then use the constructors).

But I think I know where the confusion came from. In that reply I
suggest that you define a separate schema with those additional
global elements. I think you understood this as defining a separate
schema for each element (presumably because XSD cannot generate
parsing/serialization functions for more than one element) while I
meant to define one schema with all the extra elements just for
architectural cleanness (e.g., external consumers of your XML may
not need to see these elements). There is nothing that prevents you
from putting the extra elements in the original schema.

Sorry about the confusion :-)

-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/20061130/4e904462/attachment.pgp


More information about the xsd-users mailing list