Re: Questions about prefix and namespace

Hi,

	check out level 3 methods such as lookupPrefix. You do not need to 
qualify the name as you describe unless you are hoping to serialize 
without calling normalizeDocument.

Gareth


On Wed, 23 Oct 2002, Luoh Ren-Shan wrote:

> Hi all,
> 
> Is there a function in the DOM spec to get namespace
> and prefix information from a given node?
> Do I have to write some function like
> "getPrefixList", "getNamespaceURIList",
> "getNamespaceURI2PrefixMap", etc. ?
>
> I have problem when using the "createElementNS"
> function which ask me to give a qualified name.
> I have to find which prefix to use (maybe the 
> prefix has been defined before).
> I have to always write code like
> createElementNS("..", myPrefix + ":" + myLocalName)
> to concatenate the name.
> And when serializing the DOM tree, I have to
> add "xmlns:myPrefix=".."" attributes manually
> at some appropriate places.
> 
> I'm not very familiar with the DOM API.
> Could some one tell me a better way to deal with it?
> 
> Thank you,
> Luoh Ren-Shan
> 
> 
> 
> 
> 

-- 
Gareth Reakes, Head of Product Development  
DecisionSoft Ltd.            http://www.decisionsoft.com
Office: +44 (0) 1865 203192

Received on Wednesday, 23 October 2002 04:39:47 UTC