Gareth,

 

Is it possible for you to explain what you mean here??

 

> Yes it is common. Its likely because you are not using on an element.

> Not all node types can be set this way.

 

Please. Can you give an example of what you are telling me or even correct my code:

 

 

 

 

 

DOMNodeList* list = docNode->getChildNodes();

DOMNode* aNode = NULL;

 

 

for(int i = 0; i<list->getLength(); i++)

{

 

aNode = list->item(i);

 

 

if(DOMNode::ELEMENT_NODE == aNode->getNodeType())

{

            char* nodeName = XMLString::transcode(aNode->getNodeName());

            if(strcmp(nodeName, szTag.c_str()) == 0)

            {

                  aNode->setTextContent(DOMStr("New Text"));    // ß I want this to work

                  break;

            }

}

}

 

 

Also, I had exception handling code set and the exception code returned was 9 = Not Supported Error

 

 

Thanks,

Enda

                       

 

-----Original Message-----
From: Gareth Reakes [mailto:[EMAIL PROTECTED]
Sent: 06 June 2006 16:07
To: [email protected]
Subject: Re: setNodeValue not working

 

Hi,

 

Mannion, Enda wrote:

> Thanks,

>

> I have read the function spec and the exception is of type DOMException,

>

> The msg content of the exception class was not returned so I am not sure

> if it refers to this

>

> DOMException  NO_MODIFICATION_ALLOWED_ERR: Raised when the node is

> readonly. 

 

Have you tried catching the DOMException and looking to see what type it is?

 

 

 

> Is it possible to see a sample of setTextContent() being called, surely

> this is a very common function.

 

Yes it is common. Its likely because you are not using on an element.

Not all node types can be set this way.

 

>

> Is this the standard way to update text in an XML tag?

 

This or add new children.

 

 

Gareth

 

--

Gareth Reakes, Managing Director           Embrace Mobile

+44-1865-811197              http://www.embracemobile.com

 

---------------------------------------------------------------------

To unsubscribe, e-mail: [EMAIL PROTECTED]

For additional commands, e-mail: [EMAIL PROTECTED]

 

Reply via email to