[xsd-users] Namespace mapping problem
Boris Kolpackov
boris at codesynthesis.com
Mon Jan 19 08:22:30 EST 2015
Hi Joseph,
Gagnon, Joseph - 0558 - MITLL <Joseph.Gagnon at ll.mit.edu> writes:
> I tried using the -namespace-map and -namespace-regex options but was unable
> to make any progress.
>
> [...]
>
> I cannot figure out what is wrong or what I need to do to correct the
> problem. I'm not sure if I used the --namespace* options correctly,
> although the --namespace-map option seemed pretty straightforward.
Since you haven't provided any concrete information on what you
have tried and what exactly doesn't work, I can only say that
the --namespace-map option has the following general usage:
--namespace-map http://some-oms-website.mil/=SomeCppNamespace
It is indeed very hard to misuse.
> As a side note, I had originally run XSD with no options, but got the error:
>
> C:\Users\jo24447\xml_output\config\IE6\OMS_Extension_IE6_ExportControlled.xs
> d: warning T004: generating parsing functions for 13 global elements
>
> C:\Users\jo24447\xml_output\config\IE6\OMS_Extension_IE6_ExportControlled.xs
> d: info: use --root-element-* options to specify document root(s)
This is not an error. It is a warning.
> I'm not sure what 13 global elements it was referring to, but decided to add
> the --root-element-all option.
In XML Schema every global element is a valid document root element.
But global elements are also often used for other things (e.g., to
'ref' in multiple places or for substitution groups). At the same
time there is normally (but not always) only one actual document
root. As a result, when your schema has multiple global elements,
XSD will assume that all of them are valid root elements and
generate a set of parsing/serialization functions for each of
them. Since this is normally wasteful (code bloat), XSD issues
this warning.
Boris
More information about the xsd-users
mailing list