W3C home > Mailing lists > Public > www-dom@w3.org > October to December 2002

Re: Questions about prefix and namespace

From: Gareth Reakes <gareth@decisionsoft.com>
Date: Wed, 23 Oct 2002 09:39:11 +0100 (BST)
To: Luoh Ren-Shan <luors@iii.org.tw>
cc: www-dom@w3.org
Message-ID: <Pine.LNX.4.44.0210230936420.1479-100000@somme.dsl.local>

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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:56 GMT