Re: [xml] Fwd: Determing element namespace prefix
- From: Daniel Veillard <veillard redhat com>
- To: Akarsha Kumar <akikumar gmail com>
- Cc: xml gnome org
- Subject: Re: [xml] Fwd: Determing element namespace prefix
- Date: Mon, 8 Jan 2007 10:19:16 -0500
On Sat, Jan 06, 2007 at 12:04:59AM -0800, Akarsha Kumar wrote:
Hi Rush. Thanks for the response.
I had tried xmlNode.properties->ns->prefix earlier, but it returns a valid
prefix string even for elements/attributes whose names aren't explicitly
qualified with a namespace prefix. I'd like to detect the difference between
the following two element definitions:
<SomeTopLevelElement xmlns:SomePrefix="bla">
<MyElement> Some data </MyElement>
</SomeTopLevelElement>
VS
<SomeTopLevelElement xmlns:SomePrefix="bla">
<SomePrefix:MyElement> Some data </SomePrefix:MyElement>
</SomeTopLevelElement>
In the first case the namespace for MyElement is NULL at the C level
(assuming your example is the complete document, for a fragment a default
namespace may change this).
Daniel
--
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard | virtualization library http://libvirt.org/
veillard redhat com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]