[xsd-users] Example of Anonymous Types

Boris Kolpackov boris at codesynthesis.com
Fri Jun 1 08:23:35 EDT 2007


Hi Lester,

Lester Memmott <lmemmott at yahoo.com> writes:

> So my question is:  I've seen some info about "--morph-anonymous" and
> have seen some info in the docs about using anonymous types but I've
> not found any examples in order to complete a working copy showing
> this in action.  The key idea is that I would like to still use VS2005
> to create the schema but I don't want to go to all the work and convert
> the anonymous types to named types.  Is it possible?  Can someone point
> in to the right documentation and examples?

Yes, it is possible with the --morph-anonymous option. With this option
all anonymous types will be automatically named with their names derived
from the names of enclosing elements/attributes. I see that when you
named the types manually, you added the _type suffix. You can do this
too by adding the --anonymous-regex option, e.g.:

--anonymous-regex "%.* .* (.+/)*(.+)%$2_type%"

This option allows you to alter the process of name derivation used by XSD.
For more information on these and other (e.g., --anonymous-regex-trace)
options see the XSD Compiler Command Line Manual:

http://www.codesynthesis.com/projects/xsd/documentation/xsd.xhtml


The C++/Tree Mapping FAQ entry 1.1 also has some relevant information:

http://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/faq/#1.1


BTW, in the next release of XSD the automatic anonymous type naming will
be turned on by default.

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/20070601/cacdfcc6/attachment.pgp


More information about the xsd-users mailing list