mini thomas schrieb:
> std::string s2 = "<root><nmspace:test1 hh=\"yyy\"></root>"
> xmlDocPtr myDoc = xmlParseDoc((const unsigned char*)s2.c_str());
This is not namespace-well-formed. Not even well-formed.
> I get the error "namespace error .. namespace prefix nmspace on test1
> is not declared"
>
> Is it possible to suppress this error ?
If it was possible and you used that, you could also consider using Perl
and regular expressions to do the parsing. I mean it would be counter to
the specification.
> When I call xmlNodeDump(root_node) I get the following result
> <root><test1 hh="yyy"></root>. Why is the namespace removed ? Is
> there any when to serialize the DOM to a string with the namespace ?
You don't have a namespace there. If you want a namespace, make
your
document namespace-well-formed:
<root xmlns:nmspace="urn:this-is-my-namespace-uri">
<nmspace:test1 hh="yyy"/>
</root>
I suggest you ask Google how XML namespaces work. It is not too
complicated. Much, much less complicated then C pointers.
-- Michael Ludwig
_______________________________________________
xml mailing list, project page
http://xmlsoft.org/xml gnome orghttp://mail.gnome.org/mailman/listinfo/xml