Re: [xml] Change default namespace to prefixed namespace
- From: Daniel Veillard <veillard redhat com>
- To: Rüdiger Ranft <_rdi_ web de>
- Cc: xml gnome org
- Subject: Re: [xml] Change default namespace to prefixed namespace
- Date: Thu, 27 Nov 2008 15:34:18 +0100
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/
daniel veillard com | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library http://libvirt.org/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]