Re: [xml] Fwd: Determing element namespace prefix

On Sat, Jan 06, 2007 at 12:04:59AM -0800, Akarsha Kumar wrote:
Hi Rush. Thanks for the response.

I had tried>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 xmlns:SomePrefix="bla">
<SomePrefix:MyElement> Some data </SomePrefix:MyElement>

  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).


Red Hat Virtualization group
Daniel Veillard      | virtualization library
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

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