I have an exception when I'm trying to run the following code :
- Code: Select all
Body body = (Body) main.getJAXBNodesViaXPath("//w:body", true).get(0);
- Code: Select all
javax.xml.transform.TransformerException: Unable to evaluate expression using this context
at com.sun.org.apache.xpath.internal.XPath.execute(XPath.java:363)
at com.sun.org.apache.xpath.internal.jaxp.XPathImpl.eval(XPathImpl.java:213)
at com.sun.org.apache.xpath.internal.jaxp.XPathImpl.evaluate(XPathImpl.java:275)
at org.docx4j.XmlUtils.xpath(XmlUtils.java:778)
at org.docx4j.XmlUtils.xpath(XmlUtils.java:765)
at org.docx4j.XmlUtils.getJAXBNodesViaXPath(XmlUtils.java:750)
at org.docx4j.openpackaging.parts.WordprocessingML.MainDocumentPart.getJAXBNodesViaXPath(MainDocumentPart.java:138)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoCachedMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:229)
at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:52)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:129)
I've checked into the docx document if my w:body is present.
Any idea why I'v got this exception??
Environment :
Windows XP
grails-1.3.4
docx4j-2.5.0.jar
JAXB: Using Java 6 implementation.
Julien