replaceChild

[email protected]
Newsgroups gmane.text.xml.french.tech
Message-ID <OFFD374E42.9F8CB3DF-ONC1257139.0039F131-C1257139.003A2EA9@mpsa.com>



Bonjour :-)

Je suis en train d'essayer d'utiliser la methode replaceChild mais j'ai une
erreur:
org.w3c.dom.DOMException: NOT_FOUND_ERR: Tentative de référencement d'un
noeud dans un contexte où il n'existe pas.

En fait j'ai un xpath, je recupere le parent du Node que j'obtiens avec le
xpath. Une fois que j'ai le parent, je remplace l'enfant par un nouveau
node ...


NodeList listNouvellePhraseNode = xInterrogate.evaluate(xpath,
xmlDocument);
Node blocTexteNouvellePhraseNode = listNouvellePhraseNode.item(0);
Node blocTexteNouvellePhraseParentNode =
blocTexteNouvellePhraseNode.getParentNode();

Node newNode = getPhraseTemporaireNode();

blocTexteNouvellePhraseParentNode.replaceChild(blocTexteNouvellePhraseNode,newNode);

Merci de me dire si vous voyez quelque chose d'etrange
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.