[xsd-users] Help me: Borland C++ Builder 2007 compiled program has unwanted prefix and all property values are missing.

Boris Kolpackov boris at codesynthesis.com
Tue Oct 13 09:54:14 EDT 2009


Hi James,

James Mei <jxmei3 at gmail.com> writes:

> Even I use the same namespace (no change on the namespace, write the xml
> file right after reading), it still has a "p1" prefix

Your schema and consequently your XML documents *DO* use namespaces.
In the object model the information about the namespace-prefix mappings
that was used in your input XML is not preserved. As a result, during 
serialization, you have two choices: you can either assign prefixes
to namespaces used in your vocabulary manually, or generic ones (like
p1, p2, etc.) will be assigned automatically.

For details see Section 6.1, "Namespace and Schema Information" in the 
C++/Tree Mapping Getting Started Guide:

http://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/guide/#6.1


>     SCL_(outfile, *h);

Change this to be:

xml_schema::namespace_infomap map;

map[""].name = "http://www.iec.ch/61850/2003/SCL";
map[""].schema = "SCL.xsd";

SCL_(outfile, *h, map);

Boris



More information about the xsd-users mailing list