Questions about prefix and namespace

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

Received on Wednesday, 23 October 2002 04:30:06 UTC