Re: [xml] Set Default Namespace



On 22/08/2008, Niels Van Hoef <niels vanhoef gmail com> wrote:

 When generating an XML document I want to set a default namespace as
 recommended on the namespaces page of the xmlsoft website. The
 function "xmlNewNs" only allows me to set a namespace with a prefix
 but not change/insert a default namespace.

I may be missing the point here, but just pass NULL as the prefix to
xmlNewNs? Also note, for the root element, you need to create the
element, then the ns, then use xmlSetNs, see
<http://mail.gnome.org/archives/xml/2008-June/msg00069.html> and
related thread.

Martin



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]