[xml] xmlNewNs or xmlNewGlobalNs ??


I am a newbie to libxml.  so please excuse my stupid mistakes.
actually i am converting a C++  program to C code.
in C++ i was using following Xerces C++ parser.
at one place in my C++ code , I have statement :

DOM_Document doc;
DOMString prefix("urn:iana:xml:ns:");
DOM_Element elm = doc.createElementNS(prefix + ns, ns);

which actually creates an element of the given qualified name and namespace URI.

where" ns " is DOMString.
and then later I set attrbutes of element "elm" using::

elm.setAttribute("xmlns", "urn:iana:xml:ns:" + ns);

I want to do same in  my C code
I am not sure which function to use whether

xmlNewNs  ??

threre is one more dobut that since  both funtions return "xmlNsPtr"

how would i get ELEMENT which i was getting in C++ version and if
i dont get element how would i set the attributesof that element ??
(which actually is happening in the next line)

Please enlighten me.


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