Hello,
I've been trying to use jxpath 1.2 with jdom 1.0, and when executing the
following code, I get a strange exception:
private void testModel()
{
JXPathContext context = JXPathContext.newContext(this.doc);
Pointer pointer = context.getPointer("form/name");
// the following works
Element elt = (Element) pointer.getNode();
elt.addContent("bla");
// the folloing throws an exception
pointer.setValue("bla");
}
The exception I get is:
Exception in thread "main" java.lang.NoSuchMethodError:
org.jdom.Element.addContent(Lorg/jdom/Text;)Lorg/jdom/Element;
at
org.apache.commons.jxpath.ri.model.jdom.JDOMNodePointer.setValue(JDOMNod
ePointer.java:303)
at com.aci.test.XMLFormsTest.testModel(XMLFormsTest.java:59)
The document (this.doc) is a jdom document containint the following xml
structure:
<form>
<name />
</form>
When stepping through the code, I see that the JDOMNodePointer uses the
same java statement to set the value of the element.
I noticed that in 2004, the same problem had been seen, and that it was
an incompatibility
http://mail-archives.apache.org/mod_mbox/jakarta-commons-user/200403.mbo
x/[EMAIL PROTECTED]
What has been fixed and is there a workaround?
(actually I found this while trying to use XmlForm, so a workaround is
somewhat difficult to make).
Cheers,
Bas Velthuizen
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]