Removed one more array of tracking data.
Project: http://git-wip-us.apache.org/repos/asf/incubator-vxquery/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-vxquery/commit/cb903257 Tree: http://git-wip-us.apache.org/repos/asf/incubator-vxquery/tree/cb903257 Diff: http://git-wip-us.apache.org/repos/asf/incubator-vxquery/diff/cb903257 Branch: refs/heads/prestonc/parser Commit: cb90325765672ccf4ce0a37af41d6fa6ec721f85 Parents: ae89461 Author: Preston Carman <[email protected]> Authored: Sun Feb 16 21:45:40 2014 -0800 Committer: Preston Carman <[email protected]> Committed: Tue Feb 18 10:12:54 2014 -0800 ---------------------------------------------------------------------- .../vxquery/xmlparser/SAXContentHandler.java | 39 ++++++++++---------- 1 file changed, 19 insertions(+), 20 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-vxquery/blob/cb903257/vxquery-core/src/main/java/org/apache/vxquery/xmlparser/SAXContentHandler.java ---------------------------------------------------------------------- diff --git a/vxquery-core/src/main/java/org/apache/vxquery/xmlparser/SAXContentHandler.java b/vxquery-core/src/main/java/org/apache/vxquery/xmlparser/SAXContentHandler.java index 3ead13a..40a35b0 100644 --- a/vxquery-core/src/main/java/org/apache/vxquery/xmlparser/SAXContentHandler.java +++ b/vxquery-core/src/main/java/org/apache/vxquery/xmlparser/SAXContentHandler.java @@ -70,10 +70,10 @@ public class SAXContentHandler implements ContentHandler, LexicalHandler { // Structure and data. private final GrowableIntArray leavesKind; - private final GrowableIntArray leavesStart; +// private final GrowableIntArray leavesStart; private final GrowableIntArray leavesEnd; -// private final GrowableIntArray leavesDepth; -// private final GrowableIntArray leavesParent; + // private final GrowableIntArray leavesDepth; + // private final GrowableIntArray leavesParent; private final GrowableIntArray leavesAttributeCount; private final GrowableIntArray leavesChildrenCount; @@ -110,11 +110,11 @@ public class SAXContentHandler implements ContentHandler, LexicalHandler { pendingText = false; leavesKind = new GrowableIntArray(600); - leavesStart = new GrowableIntArray(600); + //leavesStart = new GrowableIntArray(600); leavesABVS = new ArrayBackedValueStorage(); leavesEnd = new GrowableIntArray(600); -// leavesDepth = new GrowableIntArray(600); -// leavesParent = new GrowableIntArray(600); + // leavesDepth = new GrowableIntArray(600); + // leavesParent = new GrowableIntArray(600); leavesAttributeCount = new GrowableIntArray(600); leavesChildrenCount = new GrowableIntArray(600); previousLeaf = new GrowableIntArray(600); @@ -209,11 +209,11 @@ public class SAXContentHandler implements ContentHandler, LexicalHandler { @Override public void startDocument() throws SAXException { leavesKind.clear(); - leavesStart.clear(); + //leavesStart.clear(); leavesABVS.reset(); leavesEnd.clear(); -// leavesDepth.clear(); -// leavesParent.clear(); + // leavesDepth.clear(); + // leavesParent.clear(); leavesAttributeCount.clear(); leavesChildrenCount.clear(); previousLeaf.clear(); @@ -381,10 +381,11 @@ public class SAXContentHandler implements ContentHandler, LexicalHandler { } db.write(abvs); + // leavesStart.getArray()[i] + int currentOffset = 0; for (int i = 0; i < leavesKind.getSize(); ++i) { if (leavesKind.getArray()[i] == LEAF_PRE_DOCUMENT) { - out.write(leavesABVS.getByteArray(), leavesStart.getArray()[i], - leavesEnd.getArray()[i] - leavesStart.getArray()[i]); + out.write(leavesABVS.getByteArray(), currentOffset, leavesEnd.getArray()[i] - currentOffset); int children = leavesChildrenCount.getArray()[i]; if (children > 0) { @@ -400,15 +401,13 @@ public class SAXContentHandler implements ContentHandler, LexicalHandler { enb.setMvs(abvs); enb.setTagHeader(nsCount, attrCount, childrenCount); - out.write(leavesABVS.getByteArray(), leavesStart.getArray()[i], - leavesEnd.getArray()[i] - leavesStart.getArray()[i]); + out.write(leavesABVS.getByteArray(), currentOffset, leavesEnd.getArray()[i] - currentOffset); if (attrCount > 0) { sequenceSlotStub(abvs, attrCount); for (int s = 0; s < attrCount; ++s) { ++i; - out.write(leavesABVS.getByteArray(), leavesStart.getArray()[i], leavesEnd.getArray()[i] - - leavesStart.getArray()[i]); + out.write(leavesABVS.getByteArray(), currentOffset, leavesEnd.getArray()[i] - currentOffset); updateSequenceSlot(abvs); } } @@ -423,10 +422,10 @@ public class SAXContentHandler implements ContentHandler, LexicalHandler { } else if (leavesKind.getArray()[i] == LEAF_POST_NODE) { updateSequenceSlot(abvs); } else { - out.write(leavesABVS.getByteArray(), leavesStart.getArray()[i], - leavesEnd.getArray()[i] - leavesStart.getArray()[i]); + out.write(leavesABVS.getByteArray(), currentOffset, leavesEnd.getArray()[i] - currentOffset); updateSequenceSlot(abvs); } + currentOffset = leavesEnd.getArray()[i]; } } @@ -462,13 +461,13 @@ public class SAXContentHandler implements ContentHandler, LexicalHandler { private void leafNodeStart(int kind) { leavesKind.append(kind); - leavesStart.append(leavesABVS.getLength()); -// leavesDepth.append(textCurrentDepth); + //leavesStart.append(leavesABVS.getLength()); + // leavesDepth.append(textCurrentDepth); leavesAttributeCount.append(0); leavesChildrenCount.append(0); int parent = previousLeaf.getArray()[textCurrentDepth - 1]; -// leavesParent.append(parent); + // leavesParent.append(parent); if (kind == LEAF_POST_NODE || kind == LEAF_POST_DOCUMENT) { // Skip Count } else if (kind == LEAF_ATTRIBUTE) {
