[xsd-users] Inconsistency in Qname serialization/parsing

brice salva salva.brice at gmail.com
Wed Jan 2 07:42:39 EST 2013


Hi Boris,

In line with your comment, I have just added the suffix explicitly at the
DOM creation step and now the namespace of the root element is prefixed and
my generated xml does not contain a default namespace anymore, which is
perfect. Using the xml_schema::Qname constructor with the namespace as
first parameter and the value as second parameter allows me to specify the
appropriate prefix in the soap fault Value element.

Thanks for the time spent on my questions.

Best Regards,
Brice





On Mon, Dec 31, 2012 at 6:52 PM, Boris Kolpackov <boris at codesynthesis.com>wrote:

> Hi Brice,
>
> brice salva <salva.brice at gmail.com> writes:
>
> > Yet, with xsd codesynthesis, I cannot customize the default namespace
> > prefix when I use the *element-type* and *element-map* parse/serialize
> > methods to exchange xml messages (no properties as parameter).
>
> With element type/map you create the DOM document into which you
> will be serializing yourself which means that you will need to
> establish the namespace-prefix yourself as well. In your case,
> this should be as simple as adding the "env:" prefix to the name
> you pass as the second argument to createDocument() (see the
> 'messaging' example for a reference).
>
> You can also add other mappings by simply adding DOM attributes.
> Q 3.1, "How do I create an empty Xerces-C++ DOM document?" in the
> C++/Tree FAQ shows how to do this:
>
> http://wiki.codesynthesis.com/Tree/FAQ
>
> Boris
>


More information about the xsd-users mailing list