|
From: W K <wka...@ho...> - 2015-05-19 22:38:03
|
This is an odd issue, and I am not sure if it is a bug or I am missing something ...
Here is what I am doing:
- Create a VTDNav instance by parsing an xml file
- Store this instance (vn) as a class variable
Method 1: isValidXml() (this function validates a section of the xml)
- I Create AutoPilot instance: new AutoPilot( vn )
- Add namespaces to ap instance
- eval xpath to navigate to an element
- get element via: getElementFragment() and then toRawString()
- add namespaces to root element via VTD-XML, but in a separate method.
Method 2: isValidNames() (this checks element values)
- I create another AutoPilot instance: new AutoPilot( vn )
- Add namespaces to ap instance
- eval xpath to get element values ... this produces the error:
java.lang.ArrayIndexOutOfBoundsException: 1073741900
at com.ximpleware.UniByteBuffer.byteAt(UniByteBuffer.java:42)
at com.ximpleware.VTDNav.getChar(VTDNav.java:635)
at com.ximpleware.VTDNav.compareRawTokenString(VTDNav.java:1996)
at com.ximpleware.VTDNav.matchRawTokenString(VTDNav.java:1854)
at com.ximpleware.VTDNav.matchElementNS(VTDNav.java:1832)
at com.ximpleware.NodeTest.eval(NodeTest.java:63)
at com.ximpleware.xpath.Step.eval(Step.java:116)
at com.ximpleware.LocationPathExpr.process_child(LocationPathExpr.java:285)
at com.ximpleware.LocationPathExpr.evalNodeSet(LocationPathExpr.java:1747)
at com.ximpleware.UnionExpr.evalNodeSet(UnionExpr.java:105)
at com.ximpleware.AutoPilot.evalXPath(AutoPilot.java:755)
...
What I do not understand is that IF I do Method 2 before Method 1, no issues. My question(s) are:
- Does getElementFragment() change or affect the original VTDNav instance (i.e. similar to adding an attribute, element, etc... the XMLModifier has to be 're-bound')?
- If so, how can I refresh the VTDNav instance so I am working with the same instance as I started?
- Does transforming that element fragment affect the VTDNav instance?
Thank you for any help in understanding what I may be doing incorrectly.
WK
|