On Wed, Nov 26, 2008 at 10:48:53AM +0100, RĂ¼diger Ranft wrote:
> Hi all,
>
> I need to transform the default namespace of a document to a prefixed
> one. Is it ok to assign a string to the namespace, or do I need to
> create a new namespace and replace it in the document?
> if ( NULL == nsp->prefix )
> {
> nsp->prefix = xmlMemoryStrdup( "hc" );
> break;
xmlStrdup() instead, but yes that should work. Usually the parser
would allocate the prefix from the document dictionary if it has one
(doc->dict see dict.h on how to allocate from them), but a duplicated
string should still work.
Daniel
--
Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
[EMAIL PROTECTED] | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library http://libvirt.org/
_______________________________________________
xml mailing list, project page http://xmlsoft.org/
[email protected]
http://mail.gnome.org/mailman/listinfo/xml