On Thu, 31 May 2001, felix wrote:

> In the next code, this error appears 
> "org.w3c.dom.DOMException: DOM005 Wrong document":
> 
> 
> ......
> Node nodeChild=nl.item(0);
> DOMParser dp=new DOMParser();
> dp.parse(new InputSource(new 
> StringReader("<"+sNameElement+">"+"</"+sNameElement+">")));
> Element root=dp.getDocument().getDocumentElement();
> root.setAttribute("Order",sOrderElement);
> root.setNodeValue(sValueElement);
> nodeChild.appendChild(root);
> ....
> 
> I don't know where is the problem, any help would be appreciate

You can't do nodeChild.appendChild(root) as the two nodes come from
different Documents.  You need to use the importNode method of the
Document which nodeChild belongs to.  The JavaDocs should tell you the
rest (or look at the list archives - this question is frequently asked).

Ian

-- 
Ian Roberts, Software Engineer        DecisionSoft Ltd.
Telephone: +44-1865-203192            http://www.decisionsoft.com



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

Reply via email to