Createing nodes dynamically

M

matauy

I want to modify the XMl dynamically

parent = thisXDocument.DOM.selectSingleNode("Place to add");
my_AgendaItem = thisXDocument.DOM.createElement("my:AgendaItem");
parent.appendChild(my_AgendaItem);

The error is: The namespace prefix my in the following element does not map
to a URI:
 
M

matauy

Justa aclosure..

I workd arround the answer by using createNode function insted of
createElement:

IXMLDOMElement parent = thisXDocument.DOM.selectSingleNode("place to add");

IXMLDOMElement my_AgendaItem = thisXDocument.DOM.createNode(1,
"my:AgendaItem", parent.namespaceURI);

parent.appendChild(my_AgendaItem);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top