[xsd-users] schema to c++ namespace mapping problem

Ashok Shenoy kashokshenoy at gmail.com
Tue Jul 2 21:47:23 EDT 2013


Thanks Boris,

It turned out that I had not given options in the proper order during XSD
compilation.
Everything is fine in .XSD compilation now.

However, once I have generated the .cxx files and compiled to an executable,
While the executable evaluates the schemas for .XML binding, I get the
following error:

:0:0 error: unable to open file '
http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd'

Here is a copy of my command line for xsd schema processing and options
file:

xsdcxx cxx-tree --options-file options.cfg PROTO-ASDCP-AM-20040311.xsd
PROTO-ASDCP-CPL-20040511.xsd PROTO-ASDCP-PKL-20040311.xsd
xmldsig-core-schema.xsd xml.xsd

--namespace-map http://www.w3.org/XML/1998/namespace=xml_ns
--namespace-map http://www.w3.org/2000/09/xmldsig#=xmldsig_ns

--location-map http://www.w3.org/2001/XMLSchema.dtd=XMLSchema.dtd
--location-map http://www.w3.org/2001/03/xml.xsd=xml.xsd
--location-map
http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd=xmldsig-core-schema.xsd

--namespace-map http://www.digicine.com/PROTO-ASDCP-PKL-20040311#=pkl_ns
--namespace-map http://www.digicine.com/PROTO-ASDCP-CPL-20040511#=cpl_ns
--namespace-map http://www.digicine.com/PROTO-ASDCP-AM-20040311#=am_ns

--location-map
http://www.digicine.com/PROTO-ASDCP-PKL-20040311.xsd=PROTO-ASDCP-PKL-20040311.xsd
--location-map
http://www.digicine.com/PROTO-ASDCP-CPL-20040511.xsd=PROTO-ASDCP-CPL-20040511.xsd
--location-map
http://www.digicine.com/PROTO-ASDCP-AM-20040311.xsd=PROTO-ASDCP-AM-20040311.xsd

this generates code, fine...which I then compile as follows:

g++ *.cxx -I . -lxerces-c -o xml_validator

this builds fine too...but when I run:

./xml_validator ASSETMAP_VALID.xml I get:

:0:0 error: unable to open file '
http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd'
http://www.digicine.com/PROTO-ASDCP-CPL-20040511.xsd:17:97 error: fatal
error during schema scan

What am I missing?

regards,

Ashok Shenoy.




On Tue, Jul 2, 2013 at 1:13 PM, Boris Kolpackov <boris at codesynthesis.com>wrote:

> Hi Ashok,
>
> Ashok Shenoy <kashokshenoy at gmail.com> writes:
>
> > under the namespace: http://www.digicine.com/PROTO-ASDCP-AM-20040311#
> >
> > yes there is a '#' at the end of the namespace!
> >
> > how can I do a --namespace-map for the same to a c++ namespace?
>
> I think the XSD compiler command line manual (man pages) has a
> pretty good description of this option and even an example:
>
> http://www.codesynthesis.com/projects/xsd/documentation/xsd.xhtml
>
> On Linux/UNIX you need to quote the option value because of the '#'
> character:
>
> --namespace-map 'http://www.digicine.com/PROTO-ASDCP-AM-20040311#=my_ns'
>
> Boris
>


More information about the xsd-users mailing list