You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@vxquery.apache.org by pr...@apache.org on 2015/06/18 22:10:39 UTC

[1/9] vxquery git commit: n

Repository: vxquery
Updated Branches:
  refs/heads/prestonc/xmark c14424972 -> 232e62f6c


n


Project: http://git-wip-us.apache.org/repos/asf/vxquery/repo
Commit: http://git-wip-us.apache.org/repos/asf/vxquery/commit/86f65b71
Tree: http://git-wip-us.apache.org/repos/asf/vxquery/tree/86f65b71
Diff: http://git-wip-us.apache.org/repos/asf/vxquery/diff/86f65b71

Branch: refs/heads/prestonc/xmark
Commit: 86f65b7106466bcbe177c56ebb634adfe4a9e730
Parents: 2b2dd22
Author: Shivani Mall <sm...@ucr.edu>
Authored: Wed Jun 3 14:14:45 2015 -0700
Committer: Shivani Mall <sm...@ucr.edu>
Committed: Wed Jun 3 14:14:45 2015 -0700

----------------------------------------------------------------------
 src/site/apt/development_xml_document.apt       | 519 +++++++++++++++++++
 .../java/org/apache/vxquery/cli/VXQuery.java    |  79 +--
 .../query/VXQueryCompilationListener.java       | 107 ++++
 .../org/apache/vxquery/xtest/TestRunner.java    |  38 +-
 .../org/apache/vxquery/xtest/XTestOptions.java  |  21 +
 .../cat/GhcndRecordsPartition1Queries.xml       |   6 +
 .../cat/GhcndRecordsPartition2Queries.xml       |   6 +
 .../cat/GhcndRecordsPartition4Queries.xml       |   6 +
 8 files changed, 706 insertions(+), 76 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/vxquery/blob/86f65b71/src/site/apt/development_xml_document.apt
----------------------------------------------------------------------
diff --git a/src/site/apt/development_xml_document.apt b/src/site/apt/development_xml_document.apt
new file mode 100644
index 0000000..035518e
--- /dev/null
+++ b/src/site/apt/development_xml_document.apt
@@ -0,0 +1,519 @@
+~~ Licensed to the Apache Software Foundation (ASF) under one or more
+~~ contributor license agreements.  See the NOTICE file distributed with
+~~ this work for additional information regarding copyright ownership.
+~~ The ASF licenses this file to You under the Apache License, Version 2.0
+~~ (the "License"); you may not use this file except in compliance with
+~~ the License.  You may obtain a copy of the License at
+~~
+~~     http://www.apache.org/licenses/LICENSE-2.0
+~~
+~~ Unless required by applicable law or agreed to in writing, software
+~~ distributed under the License is distributed on an "AS IS" BASIS,
+~~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+~~ See the License for the specific language governing permissions and
+~~ limitations under the License.
+
+VXQuery's XML Document Model 
+
+
+*Byte Array Break Down
+
+  Every XML document in VXQuery is stored in memory as one continuous array of bytes.
+  Pointables are used to refer to these bytes in the memory.
+  This document attempts to cover all the different types of elements of an XML document 
+  and their representation in VXQuery. As a result, we use a lots of pointables (same and different) 
+  through out the document. To simplify explanations, each pointable is explicitly assigned a NodeID only on this web page. 
+  Refer to the following link for details on the various pointables used: 
+  {{{http://vxquery.apache.org/development_xml_node_details.html} XML Node Details }}.
+
+**XML Document
+
+---
+<?xml version="1.0"?>
+<catalog xmlns:ex="http://example.org/" >
+  <ex:book isbn="0812416139">
+    <!--top secret-->
+    <title>Macbeth</title>
+    <?hide?>
+  </ex:book>
+</catalog>
+---
+
+**{Bytes}
+
+***  <<<107, 3, 0, 0, 0, 0, 0, 0, 0, -109, 0, 0, 0, 7, 0, 0, 0, 6, 0, 0, 0, 19, 0, 0, 0, 44, 0, 0, 0, 54, 0, 0, 0, 62, 0, 0, 0, 72, 0, 0, 0, 83, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 5, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 7, 99, 97, 116, 97, 108, 111, 103, 0, 0, 0, 1, 0, 19, 104, 116, 116, 112, 58, 47, 47, 101, 120, 97, 109, 112, 108, 101, 46, 111, 114, 103, 47, 0, 0, 0, 2, 0, 4, 98, 111, 111, 107, 0, 0, 0, 3, 0, 2, 101, 120, 0, 0, 0, 4, 0, 4, 105, 115, 98, 110, 0, 0, 0, 5, 0, 5, 116, 105, 116, 108, 101, 0, 0, 0, 6, 101, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 102, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 10, 0, 0, 0, -42, 0, 0, 0, -34, 104, 0, 0, 0, 2, 0, 3, 10, 32, 32, 102, 6, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 30, 103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 4, 14, 0, 10, 48, 56, 49, 50, 52, 49, 54, 49, 51, 57, 0, 0, 0, 7, 0, 0, 0, 12, 0, 0, 0, 29, 0, 0, 0, 41, 0, 0, 0, 81, 0, 0, 0, 93, 
 0, 0, 0, 106, 0, 0, 0, 116, 104, 0, 0, 0, 5, 0, 5, 10, 32, 32, 32, 32, 105, 0, 0, 0, 6, 0, 10, 116, 111, 112, 32, 115, 101, 99, 114, 101, 116, 104, 0, 0, 0, 7, 0, 5, 10, 32, 32, 32, 32, 102, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 8, 0, 0, 0, 1, 0, 0, 0, 14, 104, 0, 0, 0, 9, 0, 7, 77, 97, 99, 98, 101, 116, 104, 104, 0, 0, 0, 10, 0, 5, 10, 32, 32, 32, 32, 106, 0, 0, 0, 11, 0, 4, 104, 105, 100, 101, 0, 0, 104, 0, 0, 0, 12, 0, 3, 10, 32, 32, 104, 0, 0, 0, 13, 0, 1, 10>>>
+
+
+=========================================================================
+
+
+** {Node Tree Pointable} (NTP)
+
+  Refer to this link to view the {{Bytes}} for the NTP.
+
+  XML Documents in VXQuery are wrapped in Node Tree Pointables. As a side note, every 
+  result produced as an output of a function is also wrapped in a NTP.
+  
+  <<< 107 >>>  Value tag for Node Tree Pointable
+
+  <<< 3 >>>  Header byte (One byte) that uses the lowest three bit to denote if
+
+          ** bit <Node Id> exists: <Yes>
+          
+          ** bit <Dictionary> exists: <Yes>
+          
+          ** bit <Header Type> exists: <No>
+          
+  <<< 0, 0, 0, 0 >>>  These 4 bytes represent the <Node Id> which has value <<0>>
+
+  Following are the byte contents of the {{Dictionary}}. The byte array break 
+  down is explained in details further ahead.
+ 
+*** <<<0, 0, 0, -109, 0, 0, 0, 7, 0, 0, 0, 6, 0, 0, 0, 19, 0, 0, 0, 44, 0, 0, 0, 54, 0, 0, 0, 62, 0, 0, 0, 72, 0, 0, 0, 83, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 5, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 7, 99, 97, 116, 97, 108, 111, 103, 0, 0, 0, 1, 0, 19, 104, 116, 116, 112, 58, 47, 47, 101, 120, 97, 109, 112, 108, 101, 46, 111, 114, 103, 47, 0, 0, 0, 2, 0, 4, 98, 111, 111, 107, 0, 0, 0, 3, 0, 2, 101, 120, 0, 0, 0, 4, 0, 4, 105, 115, 98, 110, 0, 0, 0, 5, 0, 5, 116, 105, 116, 108, 101, 0, 0, 0, 6>>>
+ 
+  Element Node in NTP(root node):
+  
+  In this NTP, the Element Node or the root node is a Document Node Pointable (DNP) ({{NodeID:0}}). Note that this root node can represent any pointable type. 
+  For example: ElementNodePointable, Attribute Node Pointable or Text Node Pointable.
+ 
+  <<<101>>> This is the <Value Tag> for Document Node Pointable.
+ 
+  Following are the byte contents for the Document Node Pointable ({{NodeID:0}}). 
+  The byte array break down is explained further ahead.
+ 
+*** <<<101, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 102, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 10, 0, 0, 0, -42, 0, 0, 0, -34, 104, 0, 0, 0, 2, 0, 3, 10, 32, 32, 102, 6, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 30, 103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 4, 14, 0, 10, 48, 56, 49, 50, 52, 49, 54, 49, 51, 57, 0, 0, 0, 7, 0, 0, 0, 12, 0, 0, 0, 29, 0, 0, 0, 41, 0, 0, 0, 81, 0, 0, 0, 93, 0, 0, 0, 106, 0, 0, 0, 116, 104, 0, 0, 0, 5, 0, 5, 10, 32, 32, 32, 32, 105, 0, 0, 0, 6, 0, 10, 116, 111, 112, 32, 115, 101, 99, 114, 101, 116, 104, 0, 0, 0, 7, 0, 5, 10, 32, 32, 32, 32, 102, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 8, 0, 0, 0, 1, 0, 0, 0, 14, 104, 0, 0, 0, 9, 0, 7, 77, 97, 99, 98, 101, 116, 104, 104, 0, 0, 0, 10, 0, 5, 10, 32, 32, 32, 32, 106, 0, 0, 0, 11, 0, 4, 104, 105, 100, 101, 0, 0, 104, 0, 0, 0, 12, 0, 3, 10, 32, 32, 104, 0, 0, 0, 13, 0, 1, 10>>>
+
+=========================================================================
+
+**  {Dictionary}
+
+  Byte Array for the Dictionary
+  
+***  <<<0, 0, 0, -109, 0, 0, 0, 7, 0, 0, 0, 6, 0, 0, 0, 19, 0, 0, 0, 44, 0, 0, 0, 54, 0, 0, 0, 62, 0, 0, 0, 72, 0, 0, 0, 83, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 5, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 7, 99, 97, 116, 97, 108, 111, 103, 0, 0, 0, 1, 0, 19, 104, 116, 116, 112, 58, 47, 47, 101, 120, 97, 109, 112, 108, 101, 46, 111, 114, 103, 47, 0, 0, 0, 2, 0, 4, 98, 111, 111, 107, 0, 0, 0, 3, 0, 2, 101, 120, 0, 0, 0, 4, 0, 4, 105, 115, 98, 110, 0, 0, 0, 5, 0, 5, 116, 105, 116, 108, 101, 0, 0, 0, 6>>>
+ 
+***  <<< 0, 0, 0, -109 >>> 
+  
+  These 4 bytes represent the <Size of Dictionary> in signed integer format. 
+  After conversion to unsigned integer format the value is <<147>>.
+  
+*** <<<0, 0, 0, 7>>> 
+
+  These 4 bytes represent the <Number of items> in the dictionary: <<7>>
+
+*** <<<0, 0, 0, 6, 0, 0, 0, 19, 0, 0, 0, 44, 0, 0, 0, 54, 0, 0, 0, 62, 0, 0, 0, 72, 0, 0, 0, 83>>> 
+    
+  This is a list of <Offsets> for each item in the dictionary. There are 7 offsets. 
+  Each offset is 4 bytes long. Following are the 7 offsets: <<6, 19, 44, 54, 62, 72, 83>>
+
+*** <<<0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 5, 0, 0, 0, 6>>>
+  
+  This is a sorted list of keys in alphabetical order. Each key is 4 byte long. 
+  Each key is mapped to a string in the dictionary. The keys are the numbers <<1>> through <<6>>.
+   
+  Following are the data values in the dictionary.Each data value is a 
+  StringPointable. Each StringPointable maps to XML document strings.  
+
+***  <<<0, 0, 0, 0, 0, 0>>> 
+
+  The <Size> of the string is <<0>>. The <String Value> is <<null>>. 
+  The StringPointable is followed by the key which is <<0>>.
+  
+***  <<<0, 7, 99, 97, 116, 97, 108, 111, 103, 0, 0, 0, 1>>>
+  
+  The <Size> of the string is <<7>>. The <String Value> is <<catalog>>. 
+  The StringPointable is followed by the key which is <<1>>.
+ 
+***  <<<0, 19, 104, 116, 116, 112, 58, 47, 47, 101, 120, 97, 109, 112, 108, 101, 46, 111, 114, 103, 47, 0, 0, 0, 2>>> 
+ 
+  The <Size> of the string is <<19>>. The <String Value> is <<http://example.org/>>. The StringPointable is followed by the key which is <<2>>.
+ 
+***  <<<0, 4, 98, 111, 111, 107, 0, 0, 0, 3>>>
+ 
+  The <Size> of the string is <<4>>. The <String Value> is <<book>>. The StringPointable is followed by the key which is <<3>>. 
+ 
+*** <<<0, 2, 101, 120, 0, 0, 0, 4>>>
+ 
+  The <Size> of the string is <<2>>. The <String Value> is <<ex>>. The StringPointable is followed by the key which is <<4>>.
+ 
+*** <<<0, 4, 105, 115, 98, 110, 0, 0, 0, 5>>>
+ 
+  The <Size> of the string is <<4>>. The <String Value> is <<isbn>>. The StringPointable is followed by the key which is <<5>>.
+ 
+*** <<<0, 5, 116, 105, 116, 108, 101, 0, 0, 0, 6>>>
+
+  The <Size> of the string is <<4>>. The <String Value> is <<title>>. The StringPointable is followed by the key which is <<6>>.
+
+
+================================================================ 
+
+
+** Document Node Pointable ({NodeID:0})
+  
+  This child is contained in the parent {{Node Tree Pointable}}.
+  
+  Byte Array for DNP NodeID:0
+  
+***  <<<101, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 102, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 10, 0, 0, 0, -42, 0, 0, 0, -34, 104, 0, 0, 0, 2, 0, 3, 10, 32, 32, 102, 6, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 30, 103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 4, 14, 0, 10, 48, 56, 49, 50, 52, 49, 54, 49, 51, 57, 0, 0, 0, 7, 0, 0, 0, 12, 0, 0, 0, 29, 0, 0, 0, 41, 0, 0, 0, 81, 0, 0, 0, 93, 0, 0, 0, 106, 0, 0, 0, 116, 104, 0, 0, 0, 5, 0, 5, 10, 32, 32, 32, 32, 105, 0, 0, 0, 6, 0, 10, 116, 111, 112, 32, 115, 101, 99, 114, 101, 116, 104, 0, 0, 0, 7, 0, 5, 10, 32, 32, 32, 32, 102, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 8, 0, 0, 0, 1, 0, 0, 0, 14, 104, 0, 0, 0, 9, 0, 7, 77, 97, 99, 98, 101, 116, 104, 104, 0, 0, 0, 10, 0, 5, 10, 32, 32, 32, 32, 106, 0, 0, 0, 11, 0, 4, 104, 105, 100, 101, 0, 0, 104, 0, 0, 0, 12, 0, 3, 10, 32, 32, 104, 0, 0, 0, 13, 0, 1, 10>>>
+  
+    
+  <<< 101 >>>  Value tag for Document Node Pointable
+  
+  <<< 0, 0, 0, 0 >>>  These 4 bytes represent the <Node Id> which has value <<0>>
+ 
+  Every Document Node Pointable contains a Sequence Pointable. This is analogous 
+  to a collection of items(data). In VXQuery, the items(data) 
+  in the Sequence Pointable are preceded by the number of items in the sequence 
+  and item size.
+ 
+ Sequence Content:
+ 
+  <<<0, 0, 0, 1>>>  These 4 bytes represents the <Number of Items> in the sequence which is <<1>> 
+ 
+  <<<0, 0, 1, 0>>>  These 4 bytes represents the <Size of the item> which is <<257>>
+ 
+  <Data in the Sequence>: Here the (item)data in the sequence is an 
+  Element Node Pointable ({{NodeID:1}}). Note that the data can represent any type of pointable or element.
+  
+*** <<<102, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 10, 0, 0, 0, -42, 0, 0, 0, -34, 104, 0, 0, 0, 2, 0, 3, 10, 32, 32, 102, 6, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 30, 103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 4, 14, 0, 10, 48, 56, 49, 50, 52, 49, 54, 49, 51, 57, 0, 0, 0, 7, 0, 0, 0, 12, 0, 0, 0, 29, 0, 0, 0, 41, 0, 0, 0, 81, 0, 0, 0, 93, 0, 0, 0, 106, 0, 0, 0, 116, 104, 0, 0, 0, 5, 0, 5, 10, 32, 32, 32, 32, 105, 0, 0, 0, 6, 0, 10, 116, 111, 112, 32, 115, 101, 99, 114, 101, 116, 104, 0, 0, 0, 7, 0, 5, 10, 32, 32, 32, 32, 102, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 8, 0, 0, 0, 1, 0, 0, 0, 14, 104, 0, 0, 0, 9, 0, 7, 77, 97, 99, 98, 101, 116, 104, 104, 0, 0, 0, 10, 0, 5, 10, 32, 32, 32, 32, 106, 0, 0, 0, 11, 0, 4, 104, 105, 100, 101, 0, 0, 104, 0, 0, 0, 12, 0, 3, 10, 32, 32, 104, 0, 0, 0, 13, 0, 1, 10>>>
+ 
+ 
+================================================================ 
+
+
+**  Element Node Pointable ({NodeID:1})
+
+  This child is contained in the parent Document Node Pointable ({{NodeID:0}}).
+  
+  Byte Array for ENP NodeID:1
+  
+***  <<<102, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 10, 0, 0, 0, -42, 0, 0, 0, -34, 104, 0, 0, 0, 2, 0, 3, 10, 32, 32, 102, 6, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 30, 103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 4, 14, 0, 10, 48, 56, 49, 50, 52, 49, 54, 49, 51, 57, 0, 0, 0, 7, 0, 0, 0, 12, 0, 0, 0, 29, 0, 0, 0, 41, 0, 0, 0, 81, 0, 0, 0, 93, 0, 0, 0, 106, 0, 0, 0, 116, 104, 0, 0, 0, 5, 0, 5, 10, 32, 32, 32, 32, 105, 0, 0, 0, 6, 0, 10, 116, 111, 112, 32, 115, 101, 99, 114, 101, 116, 104, 0, 0, 0, 7, 0, 5, 10, 32, 32, 32, 32, 102, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 8, 0, 0, 0, 1, 0, 0, 0, 14, 104, 0, 0, 0, 9, 0, 7, 77, 97, 99, 98, 101, 116, 104, 104, 0, 0, 0, 10, 0, 5, 10, 32, 32, 32, 32, 106, 0, 0, 0, 11, 0, 4, 104, 105, 100, 101, 0, 0, 104, 0, 0, 0, 12, 0, 3, 10, 32, 32, 104, 0, 0, 0, 13, 0, 1, 10>>>
+ 
+  <<< 102 >>>  Value tag for Element Node Pointable
+  
+  <<< 4 >>>  Header byte (One byte) that uses the lowest three bits to denote if
+
+          ** bit <Namespace Chunk> exists: <No>
+          
+          ** bit <Attribute Chunk> exists: <No>
+          
+          ** bit <Children Chunk> exists: <Yes>
+          
+   <<<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1>>> This is a <Name Pointer> which is an array of integers(4 bytes) of size <<3>> 
+ 
+  <<<0, 0, 0, 1>>> This is the <Local Node Id> which uses 4 bytes.
+ 
+  Children Chunk is a Sequence Pointable. This is analogous to a collection of items(data). In VXQuery, the items(data) 
+  in the Sequence Pointable are preceded by the number of items in the sequence and item size. 
+
+  Sequence Content childrenChunk:
+
+  <<<0, 0, 0, 3>>>  <Number of Items> in the SequencePointable <children chunk> is <<3>>
+ 
+  <<<0, 0, 0, 10>>>  <Offset> of the first item is <<10>>
+ 
+  <<<0, 0, 0, -42>>>  <Offset> of the second item is <<214>>
+   
+  <<<0, 0, 0, -34>>>  <Offset> of the third item is <<222>>
+  
+  <Data in the Sequence>: Here the items(data) in the sequence are Text Node Pointables ({{NodeID:2}}), 
+  ({{NodeID:13}}) and Element Node Pointable ({{NodeID:3}}). 
+  Note that the data can represent any type of pointable or element.
+  
+***  <<<104, 0, 0, 0, 2, 0, 3, 10, 32, 32, 102, 6, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 30, 103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 4, 14, 0, 10, 48, 56, 49, 50, 52, 49, 54, 49, 51, 57, 0, 0, 0, 7, 0, 0, 0, 12, 0, 0, 0, 29, 0, 0, 0, 41, 0, 0, 0, 81, 0, 0, 0, 93, 0, 0, 0, 106, 0, 0, 0, 116, 104, 0, 0, 0, 5, 0, 5, 10, 32, 32, 32, 32, 105, 0, 0, 0, 6, 0, 10, 116, 111, 112, 32, 115, 101, 99, 114, 101, 116, 104, 0, 0, 0, 7, 0, 5, 10, 32, 32, 32, 32, 102, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 8, 0, 0, 0, 1, 0, 0, 0, 14, 104, 0, 0, 0, 9, 0, 7, 77, 97, 99, 98, 101, 116, 104, 104, 0, 0, 0, 10, 0, 5, 10, 32, 32, 32, 32, 106, 0, 0, 0, 11, 0, 4, 104, 105, 100, 101, 0, 0, 104, 0, 0, 0, 12, 0, 3, 10, 32, 32, 104, 0, 0, 0, 13, 0, 1, 10>>>
+
+
+================================================================
+
+
+** Text Node Pointable ({NodeID:2}) 
+  
+   This child is contained in the parent Element Node Pointable ({{NodeID:1}}).
+  
+  Byte Array for TNP NodeID:2
+  
+***  <<<104, 0, 0, 0, 2, 0, 3, 10, 32, 32>>>
+ 
+  <<< 104 >>>  Value tag for Text Node Pointable
+
+  <<<0, 0, 0, 2>>> This is the <Node Id> that uses 4 bytes and has value <<2>> 
+ 
+  <<<0, 3, 10, 32, 32>>> This is the <UTF8String> which has a size <<3>> and value <<10, 32, 32>>
+
+
+================================================================
+
+
+** Element Node Pointable ({NodeID:3})
+  
+  This child is contained in the parent Element Node Pointable ({{NodeID:1}}).
+   
+  Byte Array for TNP NodeID:3
+   
+***  <<<102, 6, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 30, 103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 4, 14, 0, 10, 48, 56, 49, 50, 52, 49, 54, 49, 51, 57, 0, 0, 0, 7, 0, 0, 0, 12, 0, 0, 0, 29, 0, 0, 0, 41, 0, 0, 0, 81, 0, 0, 0, 93, 0, 0, 0, 106, 0, 0, 0, 116, 104, 0, 0, 0, 5, 0, 5, 10, 32, 32, 32, 32, 105, 0, 0, 0, 6, 0, 10, 116, 111, 112, 32, 115, 101, 99, 114, 101, 116, 104, 0, 0, 0, 7, 0, 5, 10, 32, 32, 32, 32, 102, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 8, 0, 0, 0, 1, 0, 0, 0, 14, 104, 0, 0, 0, 9, 0, 7, 77, 97, 99, 98, 101, 116, 104, 104, 0, 0, 0, 10, 0, 5, 10, 32, 32, 32, 32, 106, 0, 0, 0, 11, 0, 4, 104, 105, 100, 101, 0, 0, 104, 0, 0, 0, 12, 0, 3, 10, 32, 32>>>
+  
+  <<< 102 >>>  Value tag for Element Node Pointable
+  
+  <<< 6 >>>  Header byte (One byte) that uses the three lowest bit to denote if
+
+          ** bit <Namespace Chunk> exists: <No>
+          
+          ** bit <Attribute Chunk> exists: <Yes>
+          
+          ** bit <Children Chunk> exists: <Yes>
+ 
+  <<<0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 3>>> This is a <Name Pointer> which is an array of integers(4 bytes) of size <<3>> 
+ 
+  <<<0, 0, 0, 3>>> This is the <Local Node Id> which uses 4 bytes.
+ 
+  Attribute Chunk is a Sequence Pointable.
+  
+  Sequence Content attributeChunk:
+  
+  <<<0, 0, 0, 1>>>  <Number of Items> in the SequencePointable <attribute chunk> is <<1>>
+ 
+  <<<0, 0, 0, 30>>>  <Size> of the first item is <<30>>
+  
+   <Data in the Sequence>: Here the item(data) in the sequence is an 
+   Attribute Node Pointable ({{NodeID:4}}). Note that the data can represent any type of pointable or element.
+  
+***  <<< 103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 4, 14, 0, 10, 48, 56, 49, 50, 52,  49, 54, 49, 51, 57>>>
+
+  Children Chunk is a Sequence Pointable. This is analogous to a collection of 
+  items(data). In VXQuery, the items(data) 
+  in the Sequence Pointable are preceded by the number of items in the sequence and item size. 
+  
+  Sequence Content childrenChunk:
+
+  <<<0, 0, 0, 7>>>  <Number of Items> in the SequencePointable <children chunk> is <<3>>
+ 
+  <<<0, 0, 0, 12>>>  <Offset> of the first item is <<12>>
+ 
+  <<<0, 0, 0, 29>>>  <Offset> of the second item is <<12>>
+   
+  <<<0, 0, 0, 41>>>  <Offset> of the third item is <<41>>
+  
+  <<<0, 0, 0, 81>>>  <Offset> of the fourth item is <<81>>
+
+  <<<0, 0, 0, 93>>>  <Offset> of the fifth item is <<93>>
+
+  <<<0, 0, 0, 106>>>  <Offset> of the sixth item is <<106>>
+
+  <<<0, 0, 0, 116>>>  <Offset> of the seventh item is <<116>>
+  
+  <Data in the Sequence>: Here the items(data) in the sequence are Text Node Pointables
+  ({{NodeID:5}}), ({{NodeID:7}}), ({{NodeID:10}}), ({{NodeID:12}}), 
+  ElementNodePointable ({{NodeID:8}}), CommentNodePointable ({{NodeID:6}}) and
+  PINodePointable ({{NodeID:11}}). 
+   
+***  <<<104, 0, 0, 0, 5, 0, 5, 10, 32, 32, 32, 32, 105, 0, 0, 0, 6, 0, 10, 116, 111, 112, 32, 115, 101, 99, 114, 101, 116, 104, 0, 0, 0, 7, 0, 5, 10, 32, 32, 32, 32, 102, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 8, 0, 0, 0, 1, 0, 0, 0, 14, 104, 0, 0, 0, 9, 0, 7, 77, 97, 99, 98, 101, 116, 104, 104, 0, 0, 0, 10, 0, 5, 10, 32, 32, 32, 32, 106, 0, 0, 0, 11, 0, 4, 104, 105, 100, 101, 0, 0, 104, 0, 0, 0, 12, 0, 3, 10, 32, 32, 104, 0, 0, 0, 13, 0, 1, 10>>>
+
+
+================================================================
+
+
+** Attribute Node Pointable ({NodeID:3})
+
+  This child is contained in the parent Element Node Pointable ({{NodeID:3}}).
+  
+  Byte Array for ANP NodeID:3
+  
+***  <<<103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 4, 14, 0, 10, 48, 56, 49, 50, 52, 49, 54, 49, 51, 57>>>
+  
+  <<< 103 >>>  Value tag for Attribute Node Pointable
+ 
+  <<<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5,>>> This is a <Name Pointer> 
+  which is an array of integers(4 bytes) of size <<3>>. It consists of <PrefixCode>, <NamespaceCode>, <LocalCode>.
+
+  <<<0, 0, 0, 4>>> This is the <NodeId> which has a value of <<4>>.
+ 
+  <<<14, 0, 10, 48, 56, 49, 50, 52,  49, 54, 49, 51, 57 >>> This is a 
+  string of length <<10>> and the length of the string is  <<0812416139>>
+
+
+================================================================
+
+
+** Text Node Pointable ({NodeID:5})
+
+  This child is contained in the parent Element Node Pointable ({{NodeID:3}}) childrenChunnk.
+  
+  Byte Array for TNP NodeID:5
+  
+***  <<<104, 0, 0, 0, 5, 0, 5, 10, 32, 32, 32, 32>>>
+ 
+  <<< 104 >>>  Value tag for Text Node Pointable
+
+  <<<0, 0, 0, 5>>> This is the <Node Id> that uses 4 bytes and has value <<2>> 
+ 
+  <<< 0, 5, 10, 32, 32, 32, 32>>> This is the <UTF8String> which has a size <<5>> 
+  and value represents a <<new line>> and 4 <<spaces>>
+
+
+================================================================
+
+
+** Comment Node Pointable ({NodeID:6})
+
+  This child is contained in the parent Element Node Pointable ({{NodeID:3}}) childrenChunnk.
+  
+  Byte Array for TNP NodeID:6
+ 
+*** <<<105, 0, 0, 0, 6, 0, 10, 116, 111, 112, 32, 115, 101, 99, 114, 101, 116>>>
+  
+  <<< 105 >>>  Value tag for Comment Node Pointable
+ 
+  <<<0, 0, 0, 6>>> This is the <Node Id> that uses 4 bytes and has value <<6>> 
+ 
+  <<< 0, 10, 116, 111, 112, 32, 115, 101, 99, 114, 101, 116>>> This is the <UTF8String> which has a size <<10>> and value <<top secret>>
+ 
+ 
+================================================================
+ 
+ 
+** Text Node Pointable ({NodeID:7})
+ 
+  This child is contained in the parent Element Node Pointable ({{NodeID:3}}) childrenChunnk.
+  
+  Byte Array for TNP NodeID:7
+  
+***  <<< 104, 0, 0, 0, 7, 0, 5, 10, 32, 32, 32, 32>>>  
+ 
+  <<< 104 >>>  Value tag for Text Node Pointable
+
+  <<<0, 0, 0, 7>>> This is the <Node Id> that uses 4 bytes and has value <<7>> 
+ 
+  <<< 0, 5, 10, 32, 32, 32, 32>>> This is the <UTF8String> which has a size <<5>> and value represents a <<new line>> and 4 <<spaces>>
+
+
+================================================================
+
+
+** Element Node Pointable ({NodeID:8})
+
+  This child is contained in the parent Element Node Pointable ({{NodeID:3}}) childrenChunnk.
+  
+  Byte Array for TNP NodeID:8
+  
+***  <<<102, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 8, 0, 0, 0, 1, 0, 0, 0, 14, 104, 0, 0, 0, 9, 0, 7, 77, 97, 99, 98, 101, 116, 104>>>
+ 
+  <<< 102 >>>  Value tag for Element Node Pointable
+  
+  <<< 4 >>>  Header byte (One byte) that uses the lowest three bits to denote if
+
+          ** bit <Namespace Chunk> exists: <No>
+          
+          ** bit <Attribute Chunk> exists: <No>
+          
+          ** bit <Children Chunk> exists: <Yes>
+ 
+  <<<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6>>> This is a <Name Pointer> which is an array of integers(4 bytes) of size <<3>> 
+ 
+  <<<0, 0, 0, 8>>> This is the <Node Id> that uses 4 bytes and has value <<8>> 
+  
+  Following is a SequencePointable.
+  
+  Sequence Content childrenChunk
+
+  <<<0, 0, 0, 1>>> <Number of Items> in the SequencePointable <children chunk> is <<1>>
+  
+  <<<0, 0, 0, 14>>> <Offset> of the first item is <<14>>
+  
+  <Data in the Sequence>: Here the (item)data in the sequence is an Text Node Pointable ({{NodeID:9}}).
+  
+***   <<< 104, 0, 0, 0, 9, 0, 7, 77, 97, 99, 98, 101, 116, 104>>>
+ 
+ 
+================================================================
+ 
+ 
+** Text Node Pointable ({NodeID:9})
+
+  This child is contained in the parent Element Node Pointable ({{NodeID:8}}).
+  
+  Byte Array for TNP NodeID:9
+  
+***  <<<104, 0, 0, 0, 9, 0, 7, 77, 97, 99, 98, 101, 116, 104>>>
+ 
+  <<< 104 >>>  Value tag for Text Node Pointable
+
+  <<<0, 0, 0, 9>>> This is the <Node Id> that uses 4 bytes and has value <<9>> 
+ 
+  <<<0, 7, 77, 97, 99, 98, 101, 116, 104>>> This is the <UTF8String> which has a size <<7>> and value <<Macbeth>>
+
+
+================================================================
+
+
+** Text Node Pointable ({NodeID:10})
+   
+  This child is contained in the parent Element Node Pointable ({{NodeID:3}}) childrenChunnk.
+   
+  Byte Array for TNP NodeID:10
+  
+***  <<<104, 0, 0, 0, 10, 0, 5, 10, 32, 32, 32, 32>>>
+    
+  <<< 104 >>>  Value tag for Text Node Pointable
+
+  <<<0, 0, 0, 10>>> This is the <Node Id> that uses 4 bytes and has value <<2>> 
+ 
+  <<<0, 5, 10, 32, 32, 32, 32>>> This is the <UTF8String> which has a size <<5>> 
+  and value represents a <<new line>> and 4 <<spaces>>
+
+
+================================================================
+
+
+** PI Node Pointable ({NodeID:11})
+
+  This child is contained in the parent Element Node Pointable ({{NodeID:3}}) childrenChunnk.
+  
+  Byte Array for TNP NodeID:11
+  
+***  <<<106, 0, 0, 0, 11, 0, 4, 104, 105, 100, 101>>>
+  
+  <<< 106 >>> Value tag for Processing Intruction Node Pointable
+ 
+  <<<0, 0, 0, 11>>> This is the <Node Id> that uses 4 bytes and has value <<11>>
+ 
+  <<<0, 4, 104, 105, 100, 101>>>  This is the <UTF8String> which has a size <<4>> and value <<hide>>
+ 
+  <<<0, 0>>> This is also a string representing content. It is a <<null string>>. 
+
+
+================================================================
+
+
+** Text Node Pointable ({NodeID:12})
+
+  This child is contained in the parent Element Node Pointable ({{NodeID:3}}) childrenChunnk.
+  
+   Byte Array for TNP NodeID:12
+  
+***  <<<104, 0, 0, 0, 12, 0, 3, 10, 32, 32>>>
+  
+  <<< 104 >>>  Value tag for Text Node Pointable
+
+  <<<0, 0, 0, 12>>> This is the <Node Id> that uses 4 bytes and has value <<12>> 
+
+  <<<0, 3, 10, 32, 32>>> This is the <UTF8String> which has a size <<3>> and value represents a <<new line>> and 2 <<spaces>>.
+
+
+================================================================
+
+
+** Text Node Pointable ({NodeID:13})
+
+  This child is contained in the parent Element Node Pointable ({{NodeID:1}}).
+  
+  Byte Array for TNP NodeID:13
+  
+***  <<<104, 0, 0, 0, 13, 0, 1, 10>>>
+
+  <<< 104 >>>  Value tag for Text Node Pointable
+
+  <<<0, 0, 0, 13>>> This is the <Node Id> that uses 4 bytes and has value <<13>> 
+ 
+  <<<0, 1, 10>>> This is the <UTF8String> which has a size <<1>> and value represents a <<new line>>.
+
+
+================================================================
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/vxquery/blob/86f65b71/vxquery-cli/src/main/java/org/apache/vxquery/cli/VXQuery.java
----------------------------------------------------------------------
diff --git a/vxquery-cli/src/main/java/org/apache/vxquery/cli/VXQuery.java b/vxquery-cli/src/main/java/org/apache/vxquery/cli/VXQuery.java
index 080f8a1..061c5ac 100644
--- a/vxquery-cli/src/main/java/org/apache/vxquery/cli/VXQuery.java
+++ b/vxquery-cli/src/main/java/org/apache/vxquery/cli/VXQuery.java
@@ -39,6 +39,7 @@ import org.apache.vxquery.exceptions.SystemException;
 import org.apache.vxquery.result.ResultUtils;
 import org.apache.vxquery.xmlquery.ast.ModuleNode;
 import org.apache.vxquery.xmlquery.query.Module;
+import org.apache.vxquery.xmlquery.query.VXQueryCompilationListener;
 import org.apache.vxquery.xmlquery.query.XMLQueryCompiler;
 import org.apache.vxquery.xmlquery.query.XQueryCompilationListener;
 import org.json.JSONException;
@@ -183,81 +184,9 @@ public class VXQuery {
             if (opts.showQuery) {
                 System.err.println(qStr);
             }
-            XQueryCompilationListener listener = new XQueryCompilationListener() {
-
-                /**
-                 * On providing -showrp argument, output the query inputs, outputs and user constraints for each module as result of code generation.
-                 * 
-                 * @param module
-                 */
-                @Override
-                public void notifyCodegenResult(Module module) {
-                    if (opts.showRP) {
-                        JobSpecification jobSpec = module.getHyracksJobSpecification();
-                        try {
-                            System.err.println(jobSpec.toJSON().toString(2));
-                        } catch (JSONException e) {
-                            e.printStackTrace();
-                            System.err.println(jobSpec.toString());
-                        }
-                    }
-                }
-
-                /**
-                 * On providing -showtet argument, output the syntax translation tree for the module in the format: "-- logical operator(if exists) | execution mode |"
-                 * where execution mode can be one of: UNPARTITIONED,PARTITIONED,LOCAL
-                 * 
-                 * @param module
-                 */
-                @Override
-                public void notifyTranslationResult(Module module) {
-                    if (opts.showTET) {
-                        System.err.println(appendPrettyPlan(new StringBuilder(), module).toString());
-                    }
-                }
-
-                @Override
-                public void notifyTypecheckResult(Module module) {
-                }
 
-                /**
-                 * On providing -showoet argument, output the optimized expression tree for the module in the format:
-                 * "-- logical operator(if exists) | execution mode |" where execution mode can be one of: UNPARTITIONED,PARTITIONED,LOCAL
-                 * 
-                 * @param module
-                 */
-                @Override
-                public void notifyOptimizedResult(Module module) {
-                    if (opts.showOET) {
-                        System.err.println(appendPrettyPlan(new StringBuilder(), module).toString());
-                    }
-                }
-
-                /**
-                 * On providing -showast argument, output the abstract syntax tree obtained from parsing by serializing the DomDriver object to a pretty-printed XML
-                 * String.
-                 * 
-                 * @param moduleNode
-                 */
-                @Override
-                public void notifyParseResult(ModuleNode moduleNode) {
-                    if (opts.showAST) {
-                        System.err.println(new XStream(new DomDriver()).toXML(moduleNode));
-                    }
-                }
-
-                private StringBuilder appendPrettyPlan(StringBuilder sb, Module module) {
-                    try {
-                        ILogicalExpressionVisitor<String, Integer> ev = new VXQueryLogicalExpressionPrettyPrintVisitor(
-                                module.getModuleContext());
-                        LogicalOperatorPrettyPrintVisitor v = new LogicalOperatorPrettyPrintVisitor(ev);
-                        PlanPrettyPrinter.printPlan(module.getBody(), sb, v, 0);
-                    } catch (AlgebricksException e) {
-                        e.printStackTrace();
-                    }
-                    return sb;
-                }
-            };
+            VXQueryCompilationListener listener = new VXQueryCompilationListener(opts.showAST, opts.showTET,
+                    opts.showOET, opts.showRP);
 
             start = opts.timing ? new Date() : null;
             XMLQueryCompiler compiler = new XMLQueryCompiler(listener, getNodeList(), opts.frameSize,
@@ -389,7 +318,7 @@ public class VXQuery {
             ncConfig.dataIPAddress = "127.0.0.1";
             ncConfig.resultIPAddress = "127.0.0.1";
             ncConfig.nodeId = "nc" + (i + 1);
-            ncConfig.ioDevices = Files.createTempDirectory(ncConfig.nodeId).toString(); 
+            ncConfig.ioDevices = Files.createTempDirectory(ncConfig.nodeId).toString();
             ncs[i] = new NodeControllerService(ncConfig);
             ncs[i].start();
         }

http://git-wip-us.apache.org/repos/asf/vxquery/blob/86f65b71/vxquery-core/src/main/java/org/apache/vxquery/xmlquery/query/VXQueryCompilationListener.java
----------------------------------------------------------------------
diff --git a/vxquery-core/src/main/java/org/apache/vxquery/xmlquery/query/VXQueryCompilationListener.java b/vxquery-core/src/main/java/org/apache/vxquery/xmlquery/query/VXQueryCompilationListener.java
new file mode 100644
index 0000000..7969c9e
--- /dev/null
+++ b/vxquery-core/src/main/java/org/apache/vxquery/xmlquery/query/VXQueryCompilationListener.java
@@ -0,0 +1,107 @@
+package org.apache.vxquery.xmlquery.query;
+
+import org.apache.vxquery.compiler.algebricks.prettyprint.VXQueryLogicalExpressionPrettyPrintVisitor;
+import org.apache.vxquery.xmlquery.ast.ModuleNode;
+import org.apache.vxquery.xmlquery.query.Module;
+import org.apache.vxquery.xmlquery.query.XQueryCompilationListener;
+import org.json.JSONException;
+import org.kohsuke.args4j.Option;
+
+import com.thoughtworks.xstream.XStream;
+import com.thoughtworks.xstream.io.xml.DomDriver;
+
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.core.algebra.prettyprint.LogicalOperatorPrettyPrintVisitor;
+import edu.uci.ics.hyracks.algebricks.core.algebra.prettyprint.PlanPrettyPrinter;
+import edu.uci.ics.hyracks.algebricks.core.algebra.visitors.ILogicalExpressionVisitor;
+import edu.uci.ics.hyracks.api.job.JobSpecification;
+
+public class VXQueryCompilationListener implements XQueryCompilationListener {
+    
+    boolean showTET, showRP, showOET, showAST;
+
+    public VXQueryCompilationListener(boolean showAST, boolean showTET, boolean showOET, boolean showRP) {
+        this.showTET = showTET;
+        this.showRP = showRP;
+        this.showOET = showOET;
+        this.showAST = showAST;
+    }
+
+    /**
+     * Outputs the query inputs, outputs and user constraints for each module as result of code generation.
+     * 
+     * @param module
+     */
+    public void notifyCodegenResult(Module module) {
+        if (showRP) {
+            JobSpecification jobSpec = module.getHyracksJobSpecification();
+            try {
+                System.err.println("***Runtime Plan: ");
+                System.err.println(jobSpec.toJSON().toString(2));
+            } catch (JSONException e) {
+                e.printStackTrace();
+                System.err.println(jobSpec.toString());
+            }
+        }
+    }
+
+    /**
+     * Outputs the syntax translation tree for the module in the format: "-- logical operator(if exists) | execution mode |"
+     * where execution mode can be one of: UNPARTITIONED,PARTITIONED,LOCAL
+     * 
+     * @param module
+     */
+    @Override
+    public void notifyTranslationResult(Module module) {
+        if (showTET) {
+            System.err.println("***Translated Expression Tree: ");
+            System.err.println(appendPrettyPlan(new StringBuilder(), module).toString());
+        }
+    }
+
+    @Override
+    public void notifyTypecheckResult(Module module) {
+    }
+
+    /**
+     * Outputs the optimized expression tree for the module in the format:
+     * "-- logical operator(if exists) | execution mode |" where execution mode can be one of: UNPARTITIONED,PARTITIONED,LOCAL
+     * 
+     * @param module
+     */
+    @Override
+    public void notifyOptimizedResult(Module module) {
+        if (showOET) {
+            System.err.println("***Optimized Expression Tree: ");
+            System.err.println(appendPrettyPlan(new StringBuilder(), module).toString());
+        }
+    }
+
+    /**
+     * Outputs the abstract syntax tree obtained from parsing by serializing the DomDriver object to a pretty-printed XML
+     * String.
+     * 
+     * @param moduleNode
+     */
+    @Override
+    public void notifyParseResult(ModuleNode moduleNode) {
+        if (showAST) {
+            System.err.println("***Abstract Syntax Tree: ");
+            System.err.println(new XStream(new DomDriver()).toXML(moduleNode));
+        }
+    }
+
+    private StringBuilder appendPrettyPlan(StringBuilder sb, Module module) {
+        try {
+            ILogicalExpressionVisitor<String, Integer> ev = new VXQueryLogicalExpressionPrettyPrintVisitor(
+                    module.getModuleContext());
+            LogicalOperatorPrettyPrintVisitor v = new LogicalOperatorPrettyPrintVisitor(ev);
+            PlanPrettyPrinter.printPlan(module.getBody(), sb, v, 0);
+        } catch (AlgebricksException e) {
+            e.printStackTrace();
+        }
+        return sb;
+    }
+    
+
+}

http://git-wip-us.apache.org/repos/asf/vxquery/blob/86f65b71/vxquery-xtest/src/main/java/org/apache/vxquery/xtest/TestRunner.java
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/main/java/org/apache/vxquery/xtest/TestRunner.java b/vxquery-xtest/src/main/java/org/apache/vxquery/xtest/TestRunner.java
index a5f0ba1..c738205 100644
--- a/vxquery-xtest/src/main/java/org/apache/vxquery/xtest/TestRunner.java
+++ b/vxquery-xtest/src/main/java/org/apache/vxquery/xtest/TestRunner.java
@@ -14,8 +14,10 @@
  */
 package org.apache.vxquery.xtest;
 
+import java.io.BufferedReader;
 import java.io.File;
 import java.io.FileInputStream;
+import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.io.Reader;
 import java.nio.ByteBuffer;
@@ -23,8 +25,10 @@ import java.util.EnumSet;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
+import org.apache.commons.io.IOUtils;
 import org.apache.vxquery.compiler.CompilerControlBlock;
 import org.apache.vxquery.compiler.algebricks.VXQueryGlobalDataFactory;
+import org.apache.vxquery.compiler.algebricks.prettyprint.VXQueryLogicalExpressionPrettyPrintVisitor;
 import org.apache.vxquery.context.DynamicContext;
 import org.apache.vxquery.context.DynamicContextImpl;
 import org.apache.vxquery.context.RootStaticContextImpl;
@@ -32,8 +36,21 @@ import org.apache.vxquery.context.StaticContextImpl;
 import org.apache.vxquery.exceptions.ErrorCode;
 import org.apache.vxquery.exceptions.SystemException;
 import org.apache.vxquery.result.ResultUtils;
+import org.apache.vxquery.xmlquery.ast.ModuleNode;
+import org.apache.vxquery.xmlquery.query.Module;
+import org.apache.vxquery.xmlquery.query.VXQueryCompilationListener;
 import org.apache.vxquery.xmlquery.query.XMLQueryCompiler;
+import org.apache.vxquery.xmlquery.query.XQueryCompilationListener;
+import org.apache.vxquery.xtest.XTestOptions;
+import org.json.JSONException;
 
+import com.thoughtworks.xstream.XStream;
+import com.thoughtworks.xstream.io.xml.DomDriver;
+
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.core.algebra.prettyprint.LogicalOperatorPrettyPrintVisitor;
+import edu.uci.ics.hyracks.algebricks.core.algebra.prettyprint.PlanPrettyPrinter;
+import edu.uci.ics.hyracks.algebricks.core.algebra.visitors.ILogicalExpressionVisitor;
 import edu.uci.ics.hyracks.api.client.HyracksConnection;
 import edu.uci.ics.hyracks.api.client.IHyracksClientConnection;
 import edu.uci.ics.hyracks.api.comm.IFrameTupleAccessor;
@@ -101,10 +118,21 @@ public class TestRunner {
         if (opts.verbose) {
             System.err.println("Starting " + testCase.getXQueryDisplayName());
         }
+
         long start = System.currentTimeMillis();
+
         try {
             try {
-                XMLQueryCompiler compiler = new XMLQueryCompiler(null, new String[] { "nc1" }, FRAME_SIZE);
+                FileInputStream query = new FileInputStream(testCase.getXQueryFile());
+                if (opts.showQuery) {
+                    System.err.println("***Query for " + testCase.getXQueryDisplayName() + ": ");
+                    System.err.println(IOUtils.toString(query, "UTF-8"));
+                    //query.reset();
+                }
+
+                VXQueryCompilationListener listener = new VXQueryCompilationListener(opts.showAST, opts.showTET,
+                        opts.showOET, opts.showRP);
+                XMLQueryCompiler compiler = new XMLQueryCompiler(listener, new String[] { "nc1" }, FRAME_SIZE);
                 Reader in = new InputStreamReader(new FileInputStream(testCase.getXQueryFile()), "UTF-8");
                 CompilerControlBlock ccb = new CompilerControlBlock(new StaticContextImpl(
                         RootStaticContextImpl.INSTANCE), new ResultSetId(testCase.getXQueryDisplayName().hashCode()),
@@ -169,6 +197,14 @@ public class TestRunner {
             long end = System.currentTimeMillis();
             res.time = end - start;
         }
+        if (opts.showResult) {
+            System.err.println("***Result: ");
+            System.err.println(res.result);
+            if(res.result == null){
+                System.err.println("***Error: ");
+                System.err.println(res.error);
+            }
+        }
         return res;
     }
 

http://git-wip-us.apache.org/repos/asf/vxquery/blob/86f65b71/vxquery-xtest/src/main/java/org/apache/vxquery/xtest/XTestOptions.java
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/main/java/org/apache/vxquery/xtest/XTestOptions.java b/vxquery-xtest/src/main/java/org/apache/vxquery/xtest/XTestOptions.java
index 2b7b508..4fd0fa0 100644
--- a/vxquery-xtest/src/main/java/org/apache/vxquery/xtest/XTestOptions.java
+++ b/vxquery-xtest/src/main/java/org/apache/vxquery/xtest/XTestOptions.java
@@ -52,4 +52,25 @@ public class XTestOptions {
 
     @Option(name = "-htmlreport", required = false, usage = "HTML Report output file")
     String htmlReport;
+    
+    @Option(name = "-showquery", usage = "Show query string")
+    boolean showQuery;
+
+    @Option(name = "-showast", usage = "Show abstract syntax tree")
+    boolean showAST;
+
+    @Option(name = "-showtet", usage = "Show translated expression tree") 
+    boolean showTET;
+
+    @Option(name = "-showoet", usage = "Show optimized expression tree") 
+    boolean showOET;
+
+    @Option(name = "-showrp", usage = "Show Runtime plan") 
+    boolean showRP;
+
+    @Option(name = "-compileonly", usage = "Compile the query and stop")
+    boolean compileOnly;
+    
+    @Option(name = "-showresult", usage = "shows query result")
+    boolean showResult;
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/vxquery/blob/86f65b71/vxquery-xtest/src/test/resources/cat/GhcndRecordsPartition1Queries.xml
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/cat/GhcndRecordsPartition1Queries.xml b/vxquery-xtest/src/test/resources/cat/GhcndRecordsPartition1Queries.xml
index 65ca953..ea9054e 100644
--- a/vxquery-xtest/src/test/resources/cat/GhcndRecordsPartition1Queries.xml
+++ b/vxquery-xtest/src/test/resources/cat/GhcndRecordsPartition1Queries.xml
@@ -29,6 +29,12 @@
       <description>Count records returned for q03 from the weather benchmark with 1 partition.</description>
       <query name="q03_records" date="2014-04-01"/>
       <output-file compare="Text">q03_records.txt</output-file>
+      <output-file compare="Text">q03_records-1.txt</output-file>
+      <output-file compare="Text">q03_records-2.txt</output-file>
+      <output-file compare="Text">q03_records-3.txt</output-file>
+      <output-file compare="Text">q03_records-4.txt</output-file>
+      <output-file compare="Text">q03_records-5.txt</output-file>
+
    </test-case>
    <test-case name="ghcnd-records-partition-1-q05" FilePath="GhcndRecords/Partition-1/" Creator="Preston Carman">
       <description>Count records returned for q05 from the weather benchmark with 1 partition.</description>

http://git-wip-us.apache.org/repos/asf/vxquery/blob/86f65b71/vxquery-xtest/src/test/resources/cat/GhcndRecordsPartition2Queries.xml
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/cat/GhcndRecordsPartition2Queries.xml b/vxquery-xtest/src/test/resources/cat/GhcndRecordsPartition2Queries.xml
index 17d6819..6a22cd2 100644
--- a/vxquery-xtest/src/test/resources/cat/GhcndRecordsPartition2Queries.xml
+++ b/vxquery-xtest/src/test/resources/cat/GhcndRecordsPartition2Queries.xml
@@ -29,6 +29,12 @@
       <description>Count records returned for q03 from the weather benchmark with 2 partitions.</description>
       <query name="q03_records" date="2014-04-01"/>
       <output-file compare="Text">q03_records.txt</output-file>
+      <output-file compare="Text">q03_records-1.txt</output-file>
+      <output-file compare="Text">q03_records-2.txt</output-file>
+      <output-file compare="Text">q03_records-3.txt</output-file>
+      <output-file compare="Text">q03_records-4.txt</output-file>
+      <output-file compare="Text">q03_records-5.txt</output-file>
+
    </test-case>
    <test-case name="ghcnd-records-partition-2-q05" FilePath="GhcndRecords/Partition-2/" Creator="Preston Carman">
       <description>Count records returned for q05 from the weather benchmark with 2 partitions.</description>

http://git-wip-us.apache.org/repos/asf/vxquery/blob/86f65b71/vxquery-xtest/src/test/resources/cat/GhcndRecordsPartition4Queries.xml
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/cat/GhcndRecordsPartition4Queries.xml b/vxquery-xtest/src/test/resources/cat/GhcndRecordsPartition4Queries.xml
index 3789c51..70324fe 100644
--- a/vxquery-xtest/src/test/resources/cat/GhcndRecordsPartition4Queries.xml
+++ b/vxquery-xtest/src/test/resources/cat/GhcndRecordsPartition4Queries.xml
@@ -29,6 +29,12 @@
       <description>Count records returned for q03 from the weather benchmark with 4 partitions.</description>
       <query name="q03_records" date="2014-04-01"/>
       <output-file compare="Text">q03_records.txt</output-file>
+      <output-file compare="Text">q03_records-1.txt</output-file>
+      <output-file compare="Text">q03_records-2.txt</output-file>
+      <output-file compare="Text">q03_records-3.txt</output-file>
+      <output-file compare="Text">q03_records-4.txt</output-file>
+      <output-file compare="Text">q03_records-5.txt</output-file>
+
    </test-case>
    <test-case name="ghcnd-records-partition-4-q05" FilePath="GhcndRecords/Partition-4/" Creator="Preston Carman">
       <description>Count records returned for q05 from the weather benchmark with 4 partitions.</description>


[3/9] vxquery git commit: modified files

Posted by pr...@apache.org.
modified files


Project: http://git-wip-us.apache.org/repos/asf/vxquery/repo
Commit: http://git-wip-us.apache.org/repos/asf/vxquery/commit/086542e6
Tree: http://git-wip-us.apache.org/repos/asf/vxquery/tree/086542e6
Diff: http://git-wip-us.apache.org/repos/asf/vxquery/diff/086542e6

Branch: refs/heads/prestonc/xmark
Commit: 086542e6d97aa8c1c5f8814243efa753ac8def5d
Parents: 7bd35c9
Author: Shivani Mall <sm...@ucr.edu>
Authored: Wed Jun 3 14:32:17 2015 -0700
Committer: Shivani Mall <sm...@ucr.edu>
Committed: Wed Jun 3 14:32:17 2015 -0700

----------------------------------------------------------------------
 .../src/test/resources/cat/GhcndRecordsPartition1Queries.xml        | 1 -
 .../src/test/resources/cat/GhcndRecordsPartition2Queries.xml        | 1 -
 .../src/test/resources/cat/GhcndRecordsPartition4Queries.xml        | 1 -
 3 files changed, 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/vxquery/blob/086542e6/vxquery-xtest/src/test/resources/cat/GhcndRecordsPartition1Queries.xml
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/cat/GhcndRecordsPartition1Queries.xml b/vxquery-xtest/src/test/resources/cat/GhcndRecordsPartition1Queries.xml
index ea9054e..f55153c 100644
--- a/vxquery-xtest/src/test/resources/cat/GhcndRecordsPartition1Queries.xml
+++ b/vxquery-xtest/src/test/resources/cat/GhcndRecordsPartition1Queries.xml
@@ -34,7 +34,6 @@
       <output-file compare="Text">q03_records-3.txt</output-file>
       <output-file compare="Text">q03_records-4.txt</output-file>
       <output-file compare="Text">q03_records-5.txt</output-file>
-
    </test-case>
    <test-case name="ghcnd-records-partition-1-q05" FilePath="GhcndRecords/Partition-1/" Creator="Preston Carman">
       <description>Count records returned for q05 from the weather benchmark with 1 partition.</description>

http://git-wip-us.apache.org/repos/asf/vxquery/blob/086542e6/vxquery-xtest/src/test/resources/cat/GhcndRecordsPartition2Queries.xml
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/cat/GhcndRecordsPartition2Queries.xml b/vxquery-xtest/src/test/resources/cat/GhcndRecordsPartition2Queries.xml
index 6a22cd2..ce7b0b7 100644
--- a/vxquery-xtest/src/test/resources/cat/GhcndRecordsPartition2Queries.xml
+++ b/vxquery-xtest/src/test/resources/cat/GhcndRecordsPartition2Queries.xml
@@ -34,7 +34,6 @@
       <output-file compare="Text">q03_records-3.txt</output-file>
       <output-file compare="Text">q03_records-4.txt</output-file>
       <output-file compare="Text">q03_records-5.txt</output-file>
-
    </test-case>
    <test-case name="ghcnd-records-partition-2-q05" FilePath="GhcndRecords/Partition-2/" Creator="Preston Carman">
       <description>Count records returned for q05 from the weather benchmark with 2 partitions.</description>

http://git-wip-us.apache.org/repos/asf/vxquery/blob/086542e6/vxquery-xtest/src/test/resources/cat/GhcndRecordsPartition4Queries.xml
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/test/resources/cat/GhcndRecordsPartition4Queries.xml b/vxquery-xtest/src/test/resources/cat/GhcndRecordsPartition4Queries.xml
index 70324fe..3a0910a 100644
--- a/vxquery-xtest/src/test/resources/cat/GhcndRecordsPartition4Queries.xml
+++ b/vxquery-xtest/src/test/resources/cat/GhcndRecordsPartition4Queries.xml
@@ -34,7 +34,6 @@
       <output-file compare="Text">q03_records-3.txt</output-file>
       <output-file compare="Text">q03_records-4.txt</output-file>
       <output-file compare="Text">q03_records-5.txt</output-file>
-
    </test-case>
    <test-case name="ghcnd-records-partition-4-q05" FilePath="GhcndRecords/Partition-4/" Creator="Preston Carman">
       <description>Count records returned for q05 from the weather benchmark with 4 partitions.</description>


[6/9] vxquery git commit: changes incorporated in XDM Example for website

Posted by pr...@apache.org.
changes incorporated in XDM Example for website


Project: http://git-wip-us.apache.org/repos/asf/vxquery/repo
Commit: http://git-wip-us.apache.org/repos/asf/vxquery/commit/dbbedc9c
Tree: http://git-wip-us.apache.org/repos/asf/vxquery/tree/dbbedc9c
Diff: http://git-wip-us.apache.org/repos/asf/vxquery/diff/dbbedc9c

Branch: refs/heads/prestonc/xmark
Commit: dbbedc9c371f470b1ed2139e745872b352de6239
Parents: e637718
Author: Shivani Mall <sm...@ucr.edu>
Authored: Thu Jun 4 12:13:47 2015 -0700
Committer: Shivani Mall <sm...@ucr.edu>
Committed: Thu Jun 4 12:13:47 2015 -0700

----------------------------------------------------------------------
 src/site/apt/development_xml_document.apt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/vxquery/blob/dbbedc9c/src/site/apt/development_xml_document.apt
----------------------------------------------------------------------
diff --git a/src/site/apt/development_xml_document.apt b/src/site/apt/development_xml_document.apt
index c761f1a..3d4c284 100644
--- a/src/site/apt/development_xml_document.apt
+++ b/src/site/apt/development_xml_document.apt
@@ -113,7 +113,7 @@ XML Data Model Example
   These 4 bytes represent the <Size of Dictionary> in signed integer format. 
   After conversion to unsigned integer format the value is <<147>>.
   
-*** <<<0, 0, 0, 7>>> 
+*** <<<0, 0, 0, 7>>>
 
   These 4 bytes represent the <Number of items> in the dictionary: <<7>>
 


[9/9] vxquery git commit: Merge branch 'shivanim/gsoc_xmark' of github.com:shivani1494/vxquery into prestonc/xmark

Posted by pr...@apache.org.
Merge branch 'shivanim/gsoc_xmark' of github.com:shivani1494/vxquery into prestonc/xmark

Change includes documentation updates for XDM and improved parameters for running xtest.


Project: http://git-wip-us.apache.org/repos/asf/vxquery/repo
Commit: http://git-wip-us.apache.org/repos/asf/vxquery/commit/232e62f6
Tree: http://git-wip-us.apache.org/repos/asf/vxquery/tree/232e62f6
Diff: http://git-wip-us.apache.org/repos/asf/vxquery/diff/232e62f6

Branch: refs/heads/prestonc/xmark
Commit: 232e62f6c39975e16b1634334d97eda7f6cede4c
Parents: c144249 c784058
Author: Eldon Carman <ec...@ucr.edu>
Authored: Thu Jun 18 13:10:19 2015 -0700
Committer: Eldon Carman <ec...@ucr.edu>
Committed: Thu Jun 18 13:10:19 2015 -0700

----------------------------------------------------------------------
 src/site/apt/development_xml_document.apt       | 607 +++++++++++++++++++
 src/site/apt/development_xml_node_details.apt   |  36 +-
 src/site/site.xml                               |   5 +-
 .../java/org/apache/vxquery/cli/VXQuery.java    |  90 +--
 .../query/VXQueryCompilationListener.java       | 117 ++++
 .../org/apache/vxquery/xtest/TestRunner.java    |  22 +-
 .../org/apache/vxquery/xtest/XTestOptions.java  |  31 +-
 .../cat/GhcndRecordsPartition2Queries.xml       |   5 +
 .../cat/GhcndRecordsPartition4Queries.xml       |   5 +
 9 files changed, 807 insertions(+), 111 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/vxquery/blob/232e62f6/src/site/site.xml
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/vxquery/blob/232e62f6/vxquery-core/src/main/java/org/apache/vxquery/xmlquery/query/VXQueryCompilationListener.java
----------------------------------------------------------------------
diff --cc vxquery-core/src/main/java/org/apache/vxquery/xmlquery/query/VXQueryCompilationListener.java
index 0000000,7969c9e..344f161
mode 000000,100644..100644
--- a/vxquery-core/src/main/java/org/apache/vxquery/xmlquery/query/VXQueryCompilationListener.java
+++ b/vxquery-core/src/main/java/org/apache/vxquery/xmlquery/query/VXQueryCompilationListener.java
@@@ -1,0 -1,107 +1,117 @@@
++/*
++ * Licensed to the Apache Software Foundation (ASF) under one or more
++ * contributor license agreements. See the NOTICE file distributed with
++ * this work for additional information regarding copyright ownership.
++ * The ASF licenses this file to You under the Apache License, Version 2.0
++ * (the "License"); you may not use this file except in compliance with
++ * the License. You may obtain a copy of the License at
++ * http://www.apache.org/licenses/LICENSE-2.0
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ */
+ package org.apache.vxquery.xmlquery.query;
+ 
+ import org.apache.vxquery.compiler.algebricks.prettyprint.VXQueryLogicalExpressionPrettyPrintVisitor;
+ import org.apache.vxquery.xmlquery.ast.ModuleNode;
 -import org.apache.vxquery.xmlquery.query.Module;
 -import org.apache.vxquery.xmlquery.query.XQueryCompilationListener;
+ import org.json.JSONException;
 -import org.kohsuke.args4j.Option;
+ 
+ import com.thoughtworks.xstream.XStream;
+ import com.thoughtworks.xstream.io.xml.DomDriver;
+ 
+ import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+ import edu.uci.ics.hyracks.algebricks.core.algebra.prettyprint.LogicalOperatorPrettyPrintVisitor;
+ import edu.uci.ics.hyracks.algebricks.core.algebra.prettyprint.PlanPrettyPrinter;
+ import edu.uci.ics.hyracks.algebricks.core.algebra.visitors.ILogicalExpressionVisitor;
+ import edu.uci.ics.hyracks.api.job.JobSpecification;
+ 
+ public class VXQueryCompilationListener implements XQueryCompilationListener {
 -    
++
+     boolean showTET, showRP, showOET, showAST;
+ 
+     public VXQueryCompilationListener(boolean showAST, boolean showTET, boolean showOET, boolean showRP) {
+         this.showTET = showTET;
+         this.showRP = showRP;
+         this.showOET = showOET;
+         this.showAST = showAST;
+     }
+ 
+     /**
+      * Outputs the query inputs, outputs and user constraints for each module as result of code generation.
+      * 
+      * @param module
+      */
+     public void notifyCodegenResult(Module module) {
+         if (showRP) {
+             JobSpecification jobSpec = module.getHyracksJobSpecification();
+             try {
+                 System.err.println("***Runtime Plan: ");
+                 System.err.println(jobSpec.toJSON().toString(2));
+             } catch (JSONException e) {
+                 e.printStackTrace();
+                 System.err.println(jobSpec.toString());
+             }
+         }
+     }
+ 
+     /**
+      * Outputs the syntax translation tree for the module in the format: "-- logical operator(if exists) | execution mode |"
+      * where execution mode can be one of: UNPARTITIONED,PARTITIONED,LOCAL
+      * 
+      * @param module
+      */
+     @Override
+     public void notifyTranslationResult(Module module) {
+         if (showTET) {
+             System.err.println("***Translated Expression Tree: ");
+             System.err.println(appendPrettyPlan(new StringBuilder(), module).toString());
+         }
+     }
+ 
+     @Override
+     public void notifyTypecheckResult(Module module) {
+     }
+ 
+     /**
+      * Outputs the optimized expression tree for the module in the format:
+      * "-- logical operator(if exists) | execution mode |" where execution mode can be one of: UNPARTITIONED,PARTITIONED,LOCAL
+      * 
+      * @param module
+      */
+     @Override
+     public void notifyOptimizedResult(Module module) {
+         if (showOET) {
+             System.err.println("***Optimized Expression Tree: ");
+             System.err.println(appendPrettyPlan(new StringBuilder(), module).toString());
+         }
+     }
+ 
+     /**
+      * Outputs the abstract syntax tree obtained from parsing by serializing the DomDriver object to a pretty-printed XML
+      * String.
+      * 
+      * @param moduleNode
+      */
+     @Override
+     public void notifyParseResult(ModuleNode moduleNode) {
+         if (showAST) {
+             System.err.println("***Abstract Syntax Tree: ");
+             System.err.println(new XStream(new DomDriver()).toXML(moduleNode));
+         }
+     }
+ 
+     private StringBuilder appendPrettyPlan(StringBuilder sb, Module module) {
+         try {
+             ILogicalExpressionVisitor<String, Integer> ev = new VXQueryLogicalExpressionPrettyPrintVisitor(
+                     module.getModuleContext());
+             LogicalOperatorPrettyPrintVisitor v = new LogicalOperatorPrettyPrintVisitor(ev);
+             PlanPrettyPrinter.printPlan(module.getBody(), sb, v, 0);
+         } catch (AlgebricksException e) {
+             e.printStackTrace();
+         }
+         return sb;
+     }
 -    
+ 
+ }

http://git-wip-us.apache.org/repos/asf/vxquery/blob/232e62f6/vxquery-xtest/src/main/java/org/apache/vxquery/xtest/TestRunner.java
----------------------------------------------------------------------
diff --cc vxquery-xtest/src/main/java/org/apache/vxquery/xtest/TestRunner.java
index facc698,1e3e4ca..0dfefb5
--- a/vxquery-xtest/src/main/java/org/apache/vxquery/xtest/TestRunner.java
+++ b/vxquery-xtest/src/main/java/org/apache/vxquery/xtest/TestRunner.java
@@@ -99,10 -101,20 +101,19 @@@ public class TestRunner 
          if (opts.verbose) {
              System.err.println("Starting " + testCase.getXQueryDisplayName());
          }
+ 
          long start = System.currentTimeMillis();
 -
          try {
              try {
-                 XMLQueryCompiler compiler = new XMLQueryCompiler(null, new String[] { "nc1" }, opts.frameSize);
+                 FileInputStream query = new FileInputStream(testCase.getXQueryFile());
+                 if (opts.showQuery) {
+                     System.err.println("***Query for " + testCase.getXQueryDisplayName() + ": ");
+                     System.err.println(IOUtils.toString(query, "UTF-8"));
+                 }
+ 
+                 VXQueryCompilationListener listener = new VXQueryCompilationListener(opts.showAST, opts.showTET,
+                         opts.showOET, opts.showRP);
+                 XMLQueryCompiler compiler = new XMLQueryCompiler(listener, new String[] { "nc1" }, opts.frameSize);
                  Reader in = new InputStreamReader(new FileInputStream(testCase.getXQueryFile()), "UTF-8");
                  CompilerControlBlock ccb = new CompilerControlBlock(new StaticContextImpl(
                          RootStaticContextImpl.INSTANCE), new ResultSetId(testCase.getXQueryDisplayName().hashCode()),

http://git-wip-us.apache.org/repos/asf/vxquery/blob/232e62f6/vxquery-xtest/src/main/java/org/apache/vxquery/xtest/XTestOptions.java
----------------------------------------------------------------------
diff --cc vxquery-xtest/src/main/java/org/apache/vxquery/xtest/XTestOptions.java
index 10dfa1c,1ddeb76..53403f2
--- a/vxquery-xtest/src/main/java/org/apache/vxquery/xtest/XTestOptions.java
+++ b/vxquery-xtest/src/main/java/org/apache/vxquery/xtest/XTestOptions.java
@@@ -17,7 -17,7 +17,7 @@@ package org.apache.vxquery.xtest
  import org.kohsuke.args4j.Option;
  
  public class XTestOptions {
--    @Option(name = "-O", required = false, usage = "Optimization Level")
++    @Option(name = "-O", required = false, usage = "Optimization level")
      int optimizationLevel = Integer.MAX_VALUE;
  
      @Option(name = "-frameSize", required = false, usage = "Setting frame size")
@@@ -26,7 -26,7 +26,7 @@@
      @Option(name = "-port", required = false, usage = "Port for web server to listen on")
      int port;
  
--    @Option(name = "-catalog", required = true, usage = "Test Catalog XML")
++    @Option(name = "-catalog", required = true, usage = "Test catalog XML")
      String catalog;
  
      @Option(name = "-threads", required = false, usage = "Number of threads")
@@@ -47,12 -47,33 +47,33 @@@
      @Option(name = "-keepalive", required = false, usage = "Milliseconds to keep server alive after tests have completed")
      long keepalive;
  
--    @Option(name = "-textreport", required = false, usage = "Text Report output file")
++    @Option(name = "-textreport", required = false, usage = "Text report output file")
      String diffable;
  
--    @Option(name = "-xmlreport", required = false, usage = "XML Report output file")
++    @Option(name = "-xmlreport", required = false, usage = "XML report output file")
      String xmlReport;
  
--    @Option(name = "-htmlreport", required = false, usage = "HTML Report output file")
++    @Option(name = "-htmlreport", required = false, usage = "HTML report output file")
      String htmlReport;
+ 
+     @Option(name = "-showquery", usage = "Show query string")
+     boolean showQuery;
+ 
+     @Option(name = "-showast", usage = "Show abstract syntax tree")
+     boolean showAST;
+ 
+     @Option(name = "-showtet", usage = "Show translated expression tree")
+     boolean showTET;
+ 
+     @Option(name = "-showoet", usage = "Show optimized expression tree")
+     boolean showOET;
+ 
 -    @Option(name = "-showrp", usage = "Show Runtime plan")
++    @Option(name = "-showrp", usage = "Show runtime plan")
+     boolean showRP;
+ 
+     @Option(name = "-compileonly", usage = "Compile the query and stop")
+     boolean compileOnly;
+ 
+     @Option(name = "-showresult", usage = "Show query result")
+     boolean showResult;
  }


[4/9] vxquery git commit: merge

Posted by pr...@apache.org.
merge


Project: http://git-wip-us.apache.org/repos/asf/vxquery/repo
Commit: http://git-wip-us.apache.org/repos/asf/vxquery/commit/eacae134
Tree: http://git-wip-us.apache.org/repos/asf/vxquery/tree/eacae134
Diff: http://git-wip-us.apache.org/repos/asf/vxquery/diff/eacae134

Branch: refs/heads/prestonc/xmark
Commit: eacae134492b11a67a3de5aa0d4543cfd7d25831
Parents: 086542e d7fcc0e
Author: Shivani Mall <sm...@ucr.edu>
Authored: Wed Jun 3 14:51:15 2015 -0700
Committer: Shivani Mall <sm...@ucr.edu>
Committed: Wed Jun 3 14:51:15 2015 -0700

----------------------------------------------------------------------
 NOTICE                                          |    2 +-
 pom.xml                                         |    7 +-
 src/site/apt/developer_get_started.apt          |   41 +
 src/site/apt/development_eclipse_setup.apt      |    4 +
 src/site/apt/development_release.apt            |  217 +
 src/site/apt/release.apt                        |  187 -
 src/site/apt/user_get_started.apt               |   35 +
 src/site/apt/user_running_tests.apt             |   22 +-
 src/site/site.xml                               |   14 +-
 vxquery-benchmark/pom.xml                       |    7 +-
 .../other_systems/saxon/count_sensor.xq         |   17 +
 .../other_systems/saxon/count_station.xq        |   17 +
 .../noaa-ghcn-daily/other_systems/saxon/q00.xq  |   17 +
 .../noaa-ghcn-daily/other_systems/saxon/q01.xq  |   17 +
 .../noaa-ghcn-daily/other_systems/saxon/q02.xq  |   17 +
 .../noaa-ghcn-daily/other_systems/saxon/q03.xq  |   17 +
 .../other_systems/saxon/q04_count_sensor.xq     |   17 +
 .../other_systems/saxon/q04_count_station.xq    |   17 +
 .../other_systems/saxon/q05_count_sensor.xq     |   17 +
 .../other_systems/saxon/q05_count_station.xq    |   17 +
 .../other_systems/saxon/q06_count_sensor.xq     |   17 +
 .../other_systems/saxon/q06_count_station.xq    |   17 +
 .../noaa-ghcn-daily/other_systems/saxon/q07.xq  |   17 +
 .../other_systems/saxon/q07_count_tmax.xq       |   17 +
 .../other_systems/saxon/q07_count_tmin.xq       |   17 +
 .../scripts/benchmark_logging.properties        |   44 +-
 vxquery-cli/pom.xml                             |    9 +-
 vxquery-core/pom.xml                            |   47 +-
 .../functions/cast/CastToDecimalOperation.java  |   43 +-
 .../functions/cast/CastToDoubleOperation.java   |  171 +-
 .../functions/cast/CastToStringOperation.java   |    1 +
 .../functions/numeric/FnCeilingOperation.java   |    6 +-
 .../functions/numeric/FnFloorOperation.java     |    6 +-
 ...FnRoundHalfToEvenScalarEvaluatorFactory.java |   25 +-
 .../functions/numeric/FnRoundOperation.java     |    2 +-
 vxquery-server/pom.xml                          |    9 +-
 vxquery-xtest/pom.xml                           |    9 +-
 .../vxquery/xtest/AbstractTestCaseFactory.java  |   12 +-
 .../org/apache/vxquery/xtest/TestRunner.java    |   19 +-
 .../org/apache/vxquery/xtest/XTestOptions.java  |    3 +
 .../GhcndRecords/Partition-1/q03_records-1.txt  |    3 +
 .../GhcndRecords/Partition-1/q03_records-2.txt  |    3 +
 .../GhcndRecords/Partition-1/q03_records-3.txt  |    3 +
 .../GhcndRecords/Partition-1/q03_records-4.txt  |    3 +
 .../GhcndRecords/Partition-1/q03_records-5.txt  |    3 +
 .../ExpectedTestResults/Numerics/fn_floor.txt   |    8 +
 .../Numerics/fn_round-half-to-even.txt          |   16 +
 .../ExpectedTestResults/Numerics/fn_round.txt   |    8 +
 .../ExpectedTestResults/XMark/Modified/q01.txt  |    1 +
 .../ExpectedTestResults/XMark/Modified/q02.txt  |   25 +
 .../ExpectedTestResults/XMark/Modified/q03.txt  |    8 +
 .../ExpectedTestResults/XMark/Modified/q04.txt  |    1 +
 .../ExpectedTestResults/XMark/Modified/q05.txt  |    1 +
 .../ExpectedTestResults/XMark/Modified/q06.txt  |    1 +
 .../ExpectedTestResults/XMark/Modified/q07.txt  |    1 +
 .../ExpectedTestResults/XMark/Modified/q08.txt  |   53 +
 .../ExpectedTestResults/XMark/Modified/q09.txt  |   83 +
 .../ExpectedTestResults/XMark/Modified/q10.txt  |  440 ++
 .../ExpectedTestResults/XMark/Modified/q11.txt  |   53 +
 .../ExpectedTestResults/XMark/Modified/q12.txt  |   12 +
 .../ExpectedTestResults/XMark/Modified/q13.txt  |   55 +
 .../ExpectedTestResults/XMark/Modified/q14.txt  |    1 +
 .../ExpectedTestResults/XMark/Modified/q15.txt  |    3 +
 .../ExpectedTestResults/XMark/Modified/q16.txt  |    1 +
 .../ExpectedTestResults/XMark/Modified/q17.txt  |   27 +
 .../ExpectedTestResults/XMark/Modified/q18.txt  |    1 +
 .../ExpectedTestResults/XMark/Modified/q19.txt  |   44 +
 .../ExpectedTestResults/XMark/Modified/q20.txt  |    6 +
 .../ExpectedTestResults/XMark/Original/q01.txt  |    1 +
 .../ExpectedTestResults/XMark/Original/q02.txt  |   25 +
 .../ExpectedTestResults/XMark/Original/q03.txt  |    8 +
 .../ExpectedTestResults/XMark/Original/q04.txt  |    1 +
 .../ExpectedTestResults/XMark/Original/q05.txt  |    1 +
 .../ExpectedTestResults/XMark/Original/q06.txt  |    1 +
 .../ExpectedTestResults/XMark/Original/q07.txt  |    1 +
 .../ExpectedTestResults/XMark/Original/q08.txt  |   53 +
 .../ExpectedTestResults/XMark/Original/q09.txt  |   83 +
 .../ExpectedTestResults/XMark/Original/q10.txt  |  440 ++
 .../ExpectedTestResults/XMark/Original/q11.txt  |   53 +
 .../ExpectedTestResults/XMark/Original/q12.txt  |   12 +
 .../ExpectedTestResults/XMark/Original/q13.txt  |   55 +
 .../ExpectedTestResults/XMark/Original/q14.txt  |    1 +
 .../ExpectedTestResults/XMark/Original/q15.txt  |    3 +
 .../ExpectedTestResults/XMark/Original/q16.txt  |    1 +
 .../ExpectedTestResults/XMark/Original/q17.txt  |   27 +
 .../ExpectedTestResults/XMark/Original/q18.txt  |    1 +
 .../ExpectedTestResults/XMark/Original/q19.txt  |   44 +
 .../ExpectedTestResults/XMark/Original/q20.txt  |    6 +
 .../XMark/Original/simple_query1.txt            |    1 +
 .../XMark/Original/simple_query2.txt            |    4 +
 .../Queries/XQuery/Numerics/fn_floor.xq         |   22 +
 .../XQuery/Numerics/fn_round-half-to-even.xq    |   39 +
 .../Queries/XQuery/Numerics/fn_round.xq         |   22 +
 .../Queries/XQuery/XMark/Modified/q01.xq        |   23 +
 .../Queries/XQuery/XMark/Modified/q02.xq        |   22 +
 .../Queries/XQuery/XMark/Modified/q03.xq        |   26 +
 .../Queries/XQuery/XMark/Modified/q04.xq        |   26 +
 .../Queries/XQuery/XMark/Modified/q05.xq        |   25 +
 .../Queries/XQuery/XMark/Modified/q06.xq        |   22 +
 .../Queries/XQuery/XMark/Modified/q07.xq        |   22 +
 .../Queries/XQuery/XMark/Modified/q08.xq        |   28 +
 .../Queries/XQuery/XMark/Modified/q09.xq        |   33 +
 .../Queries/XQuery/XMark/Modified/q10.xq        |   46 +
 .../Queries/XQuery/XMark/Modified/q11.xq        |   27 +
 .../Queries/XQuery/XMark/Modified/q12.xq        |   28 +
 .../Queries/XQuery/XMark/Modified/q13.xq        |   22 +
 .../Queries/XQuery/XMark/Modified/q14.xq        |   23 +
 .../Queries/XQuery/XMark/Modified/q15.xq        |   29 +
 .../Queries/XQuery/XMark/Modified/q16.xq        |   30 +
 .../Queries/XQuery/XMark/Modified/q17.xq        |   23 +
 .../Queries/XQuery/XMark/Modified/q18.xq        |   28 +
 .../Queries/XQuery/XMark/Modified/q19.xq        |   24 +
 .../Queries/XQuery/XMark/Modified/q20.xq        |   58 +
 .../Queries/XQuery/XMark/Original/q01.xq        |   27 +
 .../Queries/XQuery/XMark/Original/q02.xq        |   22 +
 .../Queries/XQuery/XMark/Original/q03.xq        |   26 +
 .../Queries/XQuery/XMark/Original/q04.xq        |   27 +
 .../Queries/XQuery/XMark/Original/q05.xq        |   25 +
 .../Queries/XQuery/XMark/Original/q06.xq        |   21 +
 .../Queries/XQuery/XMark/Original/q07.xq        |   23 +
 .../Queries/XQuery/XMark/Original/q08.xq        |   26 +
 .../Queries/XQuery/XMark/Original/q09.xq        |   31 +
 .../Queries/XQuery/XMark/Original/q10.xq        |   46 +
 .../Queries/XQuery/XMark/Original/q11.xq        |   26 +
 .../Queries/XQuery/XMark/Original/q12.xq        |   27 +
 .../Queries/XQuery/XMark/Original/q13.xq        |   22 +
 .../Queries/XQuery/XMark/Original/q14.xq        |   23 +
 .../Queries/XQuery/XMark/Original/q15.xq        |   30 +
 .../Queries/XQuery/XMark/Original/q16.xq        |   30 +
 .../Queries/XQuery/XMark/Original/q17.xq        |   23 +
 .../Queries/XQuery/XMark/Original/q18.xq        |   28 +
 .../Queries/XQuery/XMark/Original/q19.xq        |   24 +
 .../Queries/XQuery/XMark/Original/q20.xq        |   45 +
 .../XQuery/XMark/Original/simple_query1.xq      |   22 +
 .../XQuery/XMark/Original/simple_query2.xq      |   22 +
 .../TestSources/XMark/SingleFile/auction.xml    | 5760 ++++++++++++++++++
 .../SplitFiles/categories/micro_categories.xml  |   56 +
 .../SplitFiles/catgraph/micro_catgraph.xml      |   23 +
 .../closed_auctions/micro_closed_auctions.xml   | 1192 ++++
 .../open_auctions/micro_open_auctions.xml       | 1944 ++++++
 .../XMark/SplitFiles/people/micro_people.xml    |  855 +++
 .../XMark/SplitFiles/regions/micro_regions.xml  | 2365 +++++++
 .../resources/VXQuerySingleAlternateCatalog.xml |    3 +-
 .../src/test/resources/VXQuerySingleCatalog.xml |    2 +-
 .../src/test/resources/VXQueryXMarkCatalog.xml  |   77 +
 .../src/test/resources/XMarkCatalog.xml         |   74 +
 .../FunctionsAndOperatorsOnNumericsQueries.xml  |   15 +
 .../test/resources/cat/XMarkOriginalQueries.xml |  133 +
 .../src/test/resources/cat/XMarkQueries.xml     |  123 +
 149 files changed, 16263 insertions(+), 486 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/vxquery/blob/eacae134/src/site/site.xml
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/vxquery/blob/eacae134/vxquery-xtest/src/main/java/org/apache/vxquery/xtest/TestRunner.java
----------------------------------------------------------------------
diff --cc vxquery-xtest/src/main/java/org/apache/vxquery/xtest/TestRunner.java
index 5f04a7a,facc698..d68c09c
--- a/vxquery-xtest/src/main/java/org/apache/vxquery/xtest/TestRunner.java
+++ b/vxquery-xtest/src/main/java/org/apache/vxquery/xtest/TestRunner.java
@@@ -25,10 -23,8 +23,9 @@@ import java.util.EnumSet
  import java.util.regex.Matcher;
  import java.util.regex.Pattern;
  
 +import org.apache.commons.io.IOUtils;
  import org.apache.vxquery.compiler.CompilerControlBlock;
  import org.apache.vxquery.compiler.algebricks.VXQueryGlobalDataFactory;
- import org.apache.vxquery.compiler.algebricks.prettyprint.VXQueryLogicalExpressionPrettyPrintVisitor;
  import org.apache.vxquery.context.DynamicContext;
  import org.apache.vxquery.context.DynamicContextImpl;
  import org.apache.vxquery.context.RootStaticContextImpl;
@@@ -36,21 -32,8 +33,9 @@@ import org.apache.vxquery.context.Stati
  import org.apache.vxquery.exceptions.ErrorCode;
  import org.apache.vxquery.exceptions.SystemException;
  import org.apache.vxquery.result.ResultUtils;
- import org.apache.vxquery.xmlquery.ast.ModuleNode;
- import org.apache.vxquery.xmlquery.query.Module;
 +import org.apache.vxquery.xmlquery.query.VXQueryCompilationListener;
  import org.apache.vxquery.xmlquery.query.XMLQueryCompiler;
- import org.apache.vxquery.xmlquery.query.XQueryCompilationListener;
- import org.apache.vxquery.xtest.XTestOptions;
- import org.json.JSONException;
  
- import com.thoughtworks.xstream.XStream;
- import com.thoughtworks.xstream.io.xml.DomDriver;
- 
- import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
- import edu.uci.ics.hyracks.algebricks.core.algebra.prettyprint.LogicalOperatorPrettyPrintVisitor;
- import edu.uci.ics.hyracks.algebricks.core.algebra.prettyprint.PlanPrettyPrinter;
- import edu.uci.ics.hyracks.algebricks.core.algebra.visitors.ILogicalExpressionVisitor;
  import edu.uci.ics.hyracks.api.client.HyracksConnection;
  import edu.uci.ics.hyracks.api.client.IHyracksClientConnection;
  import edu.uci.ics.hyracks.api.comm.IFrameTupleAccessor;
@@@ -118,21 -99,10 +101,21 @@@ public class TestRunner 
          if (opts.verbose) {
              System.err.println("Starting " + testCase.getXQueryDisplayName());
          }
 +
          long start = System.currentTimeMillis();
 +
          try {
              try {
 -                XMLQueryCompiler compiler = new XMLQueryCompiler(null, new String[] { "nc1" }, opts.frameSize);
 +                FileInputStream query = new FileInputStream(testCase.getXQueryFile());
 +                if (opts.showQuery) {
 +                    System.err.println("***Query for " + testCase.getXQueryDisplayName() + ": ");
 +                    System.err.println(IOUtils.toString(query, "UTF-8"));
 +                    //query.reset();
 +                }
 +
 +                VXQueryCompilationListener listener = new VXQueryCompilationListener(opts.showAST, opts.showTET,
 +                        opts.showOET, opts.showRP);
-                 XMLQueryCompiler compiler = new XMLQueryCompiler(listener, new String[] { "nc1" }, FRAME_SIZE);
++                XMLQueryCompiler compiler = new XMLQueryCompiler(listener, new String[] { "nc1" }, opts.frameSize);
                  Reader in = new InputStreamReader(new FileInputStream(testCase.getXQueryFile()), "UTF-8");
                  CompilerControlBlock ccb = new CompilerControlBlock(new StaticContextImpl(
                          RootStaticContextImpl.INSTANCE), new ResultSetId(testCase.getXQueryDisplayName().hashCode()),

http://git-wip-us.apache.org/repos/asf/vxquery/blob/eacae134/vxquery-xtest/src/main/java/org/apache/vxquery/xtest/XTestOptions.java
----------------------------------------------------------------------


[5/9] vxquery git commit: unused packages removed

Posted by pr...@apache.org.
unused packages removed


Project: http://git-wip-us.apache.org/repos/asf/vxquery/repo
Commit: http://git-wip-us.apache.org/repos/asf/vxquery/commit/e6377186
Tree: http://git-wip-us.apache.org/repos/asf/vxquery/tree/e6377186
Diff: http://git-wip-us.apache.org/repos/asf/vxquery/diff/e6377186

Branch: refs/heads/prestonc/xmark
Commit: e6377186079840c4a21d0f7b766589794f783254
Parents: eacae13
Author: Shivani Mall <sm...@ucr.edu>
Authored: Wed Jun 3 14:56:23 2015 -0700
Committer: Shivani Mall <sm...@ucr.edu>
Committed: Thu Jun 4 11:29:23 2015 -0700

----------------------------------------------------------------------
 .../src/main/java/org/apache/vxquery/cli/VXQuery.java    | 11 -----------
 1 file changed, 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/vxquery/blob/e6377186/vxquery-cli/src/main/java/org/apache/vxquery/cli/VXQuery.java
----------------------------------------------------------------------
diff --git a/vxquery-cli/src/main/java/org/apache/vxquery/cli/VXQuery.java b/vxquery-cli/src/main/java/org/apache/vxquery/cli/VXQuery.java
index 061c5ac..5b99978 100644
--- a/vxquery-cli/src/main/java/org/apache/vxquery/cli/VXQuery.java
+++ b/vxquery-cli/src/main/java/org/apache/vxquery/cli/VXQuery.java
@@ -30,30 +30,19 @@ import java.util.Map;
 import org.apache.commons.io.FileUtils;
 import org.apache.vxquery.compiler.CompilerControlBlock;
 import org.apache.vxquery.compiler.algebricks.VXQueryGlobalDataFactory;
-import org.apache.vxquery.compiler.algebricks.prettyprint.VXQueryLogicalExpressionPrettyPrintVisitor;
 import org.apache.vxquery.context.DynamicContext;
 import org.apache.vxquery.context.DynamicContextImpl;
 import org.apache.vxquery.context.RootStaticContextImpl;
 import org.apache.vxquery.context.StaticContextImpl;
 import org.apache.vxquery.exceptions.SystemException;
 import org.apache.vxquery.result.ResultUtils;
-import org.apache.vxquery.xmlquery.ast.ModuleNode;
 import org.apache.vxquery.xmlquery.query.Module;
 import org.apache.vxquery.xmlquery.query.VXQueryCompilationListener;
 import org.apache.vxquery.xmlquery.query.XMLQueryCompiler;
-import org.apache.vxquery.xmlquery.query.XQueryCompilationListener;
-import org.json.JSONException;
 import org.kohsuke.args4j.Argument;
 import org.kohsuke.args4j.CmdLineParser;
 import org.kohsuke.args4j.Option;
 
-import com.thoughtworks.xstream.XStream;
-import com.thoughtworks.xstream.io.xml.DomDriver;
-
-import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
-import edu.uci.ics.hyracks.algebricks.core.algebra.prettyprint.LogicalOperatorPrettyPrintVisitor;
-import edu.uci.ics.hyracks.algebricks.core.algebra.prettyprint.PlanPrettyPrinter;
-import edu.uci.ics.hyracks.algebricks.core.algebra.visitors.ILogicalExpressionVisitor;
 import edu.uci.ics.hyracks.api.client.HyracksConnection;
 import edu.uci.ics.hyracks.api.client.IHyracksClientConnection;
 import edu.uci.ics.hyracks.api.client.NodeControllerInfo;


[2/9] vxquery git commit: modified files

Posted by pr...@apache.org.
modified files


Project: http://git-wip-us.apache.org/repos/asf/vxquery/repo
Commit: http://git-wip-us.apache.org/repos/asf/vxquery/commit/7bd35c91
Tree: http://git-wip-us.apache.org/repos/asf/vxquery/tree/7bd35c91
Diff: http://git-wip-us.apache.org/repos/asf/vxquery/diff/7bd35c91

Branch: refs/heads/prestonc/xmark
Commit: 7bd35c91e8edab7a4d92e78e5200703d3443ad05
Parents: 86f65b7
Author: Shivani Mall <sm...@ucr.edu>
Authored: Wed Jun 3 14:26:46 2015 -0700
Committer: Shivani Mall <sm...@ucr.edu>
Committed: Wed Jun 3 14:26:46 2015 -0700

----------------------------------------------------------------------
 src/site/apt/development_xml_document.apt       | 330 ++++++++++++-------
 src/site/apt/development_xml_node_details.apt   |  36 +-
 src/site/site.xml                               |   5 +-
 .../org/apache/vxquery/xtest/TestRunner.java    |   4 +-
 4 files changed, 233 insertions(+), 142 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/vxquery/blob/7bd35c91/src/site/apt/development_xml_document.apt
----------------------------------------------------------------------
diff --git a/src/site/apt/development_xml_document.apt b/src/site/apt/development_xml_document.apt
index 035518e..c761f1a 100644
--- a/src/site/apt/development_xml_document.apt
+++ b/src/site/apt/development_xml_document.apt
@@ -13,21 +13,28 @@
 ~~ See the License for the specific language governing permissions and
 ~~ limitations under the License.
 
-VXQuery's XML Document Model 
+XML Data Model Example 
 
 
 *Byte Array Break Down
 
-  Every XML document in VXQuery is stored in memory as one continuous array of bytes.
-  Pointables are used to refer to these bytes in the memory.
-  This document attempts to cover all the different types of elements of an XML document 
-  and their representation in VXQuery. As a result, we use a lots of pointables (same and different) 
-  through out the document. To simplify explanations, each pointable is explicitly assigned a NodeID only on this web page. 
+  Every XML document in VXQuery is stored in memory as one continuous array of 
+  bytes. Pointables are used to refer to these bytes in the memory.
+  This document covers VXQuery's representation of all the different types of 
+  elements of an XML document. As a result, we use a lots of pointables 
+  (same and different) through out the document. To simplify explanations, 
+  each pointable is explicitly assigned a NodeID only on this web page. 
   Refer to the following link for details on the various pointables used: 
   {{{http://vxquery.apache.org/development_xml_node_details.html} XML Node Details }}.
 
 **XML Document
-
+  
+  We use the following XML document as an example to explain VXQuery's node 
+  types. The different node types are Node Tree Pointable (NTP), 
+  Document Node Pointable (DNP), Element Node Pointable (ENP), 
+  Attribute Node Pointable (ANP), Text Node Pointable (TNP),
+  Comment Node Pointable (CNP) and Processing Instruction Node Pointable (PINP). 
+   
 ---
 <?xml version="1.0"?>
 <catalog xmlns:ex="http://example.org/" >
@@ -39,23 +46,32 @@ VXQuery's XML Document Model
 </catalog>
 ---
 
-**{Bytes}
-
+** {Bytes}
+  
+  Following are the bytes for the XML document above. Elements in VXQuery are
+  accessed using Tagged Value Pointables. Similarly, the XML document is also 
+  accessed using a Tagged Value Pointable. The first byte is represents the 
+  value tag. It indicates the type of the bytes that follow. 
+    
 ***  <<<107, 3, 0, 0, 0, 0, 0, 0, 0, -109, 0, 0, 0, 7, 0, 0, 0, 6, 0, 0, 0, 19, 0, 0, 0, 44, 0, 0, 0, 54, 0, 0, 0, 62, 0, 0, 0, 72, 0, 0, 0, 83, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 5, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 7, 99, 97, 116, 97, 108, 111, 103, 0, 0, 0, 1, 0, 19, 104, 116, 116, 112, 58, 47, 47, 101, 120, 97, 109, 112, 108, 101, 46, 111, 114, 103, 47, 0, 0, 0, 2, 0, 4, 98, 111, 111, 107, 0, 0, 0, 3, 0, 2, 101, 120, 0, 0, 0, 4, 0, 4, 105, 115, 98, 110, 0, 0, 0, 5, 0, 5, 116, 105, 116, 108, 101, 0, 0, 0, 6, 101, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 102, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 10, 0, 0, 0, -42, 0, 0, 0, -34, 104, 0, 0, 0, 2, 0, 3, 10, 32, 32, 102, 6, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 30, 103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 4, 14, 0, 10, 48, 56, 49, 50, 52, 49, 54, 49, 51, 57, 0, 0, 0, 7, 0, 0, 0, 12, 0, 0, 0, 29, 0, 0, 0, 41, 0, 0, 0, 81, 0, 0, 0, 93, 
 0, 0, 0, 106, 0, 0, 0, 116, 104, 0, 0, 0, 5, 0, 5, 10, 32, 32, 32, 32, 105, 0, 0, 0, 6, 0, 10, 116, 111, 112, 32, 115, 101, 99, 114, 101, 116, 104, 0, 0, 0, 7, 0, 5, 10, 32, 32, 32, 32, 102, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 8, 0, 0, 0, 1, 0, 0, 0, 14, 104, 0, 0, 0, 9, 0, 7, 77, 97, 99, 98, 101, 116, 104, 104, 0, 0, 0, 10, 0, 5, 10, 32, 32, 32, 32, 106, 0, 0, 0, 11, 0, 4, 104, 105, 100, 101, 0, 0, 104, 0, 0, 0, 12, 0, 3, 10, 32, 32, 104, 0, 0, 0, 13, 0, 1, 10>>>
 
 
 =========================================================================
 
-
-** {Node Tree Pointable} (NTP)
-
-  Refer to this link to view the {{Bytes}} for the NTP.
-
-  XML Documents in VXQuery are wrapped in Node Tree Pointables. As a side note, every 
-  result produced as an output of a function is also wrapped in a NTP.
+** {Node Tree}
+  
+  <<<107>>> The first byte as described above is the value tag for Node Tree
+  Pointable.
   
-  <<< 107 >>>  Value tag for Node Tree Pointable
+  The rest of the bytes represent a Node Tree Pointable. Refer to this link
+  to view the {{Bytes}} for the Node Tree Pointable(NTP).
 
+  XML Documents in VXQuery are wrapped in Node Tree Pointables. As a side note,
+  every result produced as an output of a function is also wrapped in a NTP.
+  
+  Following are the bytes and contents of the Node Tree Pointable for this XML
+  document.
+  
   <<< 3 >>>  Header byte (One byte) that uses the lowest three bit to denote if
 
           ** bit <Node Id> exists: <Yes>
@@ -64,7 +80,8 @@ VXQuery's XML Document Model
           
           ** bit <Header Type> exists: <No>
           
-  <<< 0, 0, 0, 0 >>>  These 4 bytes represent the <Node Id> which has value <<0>>
+  <<< 0, 0, 0, 0 >>>  These 4 bytes represent the
+  <Node Id> which has value <<0>>
 
   Following are the byte contents of the {{Dictionary}}. The byte array break 
   down is explained in details further ahead.
@@ -73,15 +90,15 @@ VXQuery's XML Document Model
  
   Element Node in NTP(root node):
   
-  In this NTP, the Element Node or the root node is a Document Node Pointable (DNP) ({{NodeID:0}}). Note that this root node can represent any pointable type. 
-  For example: ElementNodePointable, Attribute Node Pointable or Text Node Pointable.
- 
-  <<<101>>> This is the <Value Tag> for Document Node Pointable.
- 
-  Following are the byte contents for the Document Node Pointable ({{NodeID:0}}). 
-  The byte array break down is explained further ahead.
+  In this NTP, the Element Node or the root node is a Document Node Pointable 
+  (DNP) ({{NodeID:0}}). <<101>> is the <Value Tag> for Document Node Pointable. 
+  Note that this root node can represent any pointable type. For example: 
+  ElementNodePointable, Attribute Node Pointable or Text Node Pointable.
+   
+  Following are the byte contents for the Document Node Pointable 
+  ({{NodeID:0}}). The byte array break down is explained further ahead.
  
-*** <<<101, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 102, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 10, 0, 0, 0, -42, 0, 0, 0, -34, 104, 0, 0, 0, 2, 0, 3, 10, 32, 32, 102, 6, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 30, 103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 4, 14, 0, 10, 48, 56, 49, 50, 52, 49, 54, 49, 51, 57, 0, 0, 0, 7, 0, 0, 0, 12, 0, 0, 0, 29, 0, 0, 0, 41, 0, 0, 0, 81, 0, 0, 0, 93, 0, 0, 0, 106, 0, 0, 0, 116, 104, 0, 0, 0, 5, 0, 5, 10, 32, 32, 32, 32, 105, 0, 0, 0, 6, 0, 10, 116, 111, 112, 32, 115, 101, 99, 114, 101, 116, 104, 0, 0, 0, 7, 0, 5, 10, 32, 32, 32, 32, 102, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 8, 0, 0, 0, 1, 0, 0, 0, 14, 104, 0, 0, 0, 9, 0, 7, 77, 97, 99, 98, 101, 116, 104, 104, 0, 0, 0, 10, 0, 5, 10, 32, 32, 32, 32, 106, 0, 0, 0, 11, 0, 4, 104, 105, 100, 101, 0, 0, 104, 0, 0, 0, 12, 0, 3, 10, 32, 32, 104, 0, 0, 0, 13, 0, 1, 10>>>
+*** <<<0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 102, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 10, 0, 0, 0, -42, 0, 0, 0, -34, 104, 0, 0, 0, 2, 0, 3, 10, 32, 32, 102, 6, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 30, 103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 4, 14, 0, 10, 48, 56, 49, 50, 52, 49, 54, 49, 51, 57, 0, 0, 0, 7, 0, 0, 0, 12, 0, 0, 0, 29, 0, 0, 0, 41, 0, 0, 0, 81, 0, 0, 0, 93, 0, 0, 0, 106, 0, 0, 0, 116, 104, 0, 0, 0, 5, 0, 5, 10, 32, 32, 32, 32, 105, 0, 0, 0, 6, 0, 10, 116, 111, 112, 32, 115, 101, 99, 114, 101, 116, 104, 0, 0, 0, 7, 0, 5, 10, 32, 32, 32, 32, 102, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 8, 0, 0, 0, 1, 0, 0, 0, 14, 104, 0, 0, 0, 9, 0, 7, 77, 97, 99, 98, 101, 116, 104, 104, 0, 0, 0, 10, 0, 5, 10, 32, 32, 32, 32, 106, 0, 0, 0, 11, 0, 4, 104, 105, 100, 101, 0, 0, 104, 0, 0, 0, 12, 0, 3, 10, 32, 32, 104, 0, 0, 0, 13, 0, 1, 10>>>
 
 =========================================================================
 
@@ -102,13 +119,15 @@ VXQuery's XML Document Model
 
 *** <<<0, 0, 0, 6, 0, 0, 0, 19, 0, 0, 0, 44, 0, 0, 0, 54, 0, 0, 0, 62, 0, 0, 0, 72, 0, 0, 0, 83>>> 
     
-  This is a list of <Offsets> for each item in the dictionary. There are 7 offsets. 
-  Each offset is 4 bytes long. Following are the 7 offsets: <<6, 19, 44, 54, 62, 72, 83>>
+  This is a list of <Offsets> for each item in the dictionary. 
+  There are 7 offsets. Each offset is 4 bytes long. Following are 
+  the 7 offsets: <<6, 19, 44, 54, 62, 72, 83>>
 
 *** <<<0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 5, 0, 0, 0, 6>>>
   
   This is a sorted list of keys in alphabetical order. Each key is 4 byte long. 
-  Each key is mapped to a string in the dictionary. The keys are the numbers <<1>> through <<6>>.
+  Each key is mapped to a string in the dictionary. The keys 
+  are the numbers <<1>> through <<6>>.
    
   Following are the data values in the dictionary.Each data value is a 
   StringPointable. Each StringPointable maps to XML document strings.  
@@ -125,40 +144,48 @@ VXQuery's XML Document Model
  
 ***  <<<0, 19, 104, 116, 116, 112, 58, 47, 47, 101, 120, 97, 109, 112, 108, 101, 46, 111, 114, 103, 47, 0, 0, 0, 2>>> 
  
-  The <Size> of the string is <<19>>. The <String Value> is <<http://example.org/>>. The StringPointable is followed by the key which is <<2>>.
+  The <Size> of the string is <<19>>. 
+  The <String Value> is <<http://example.org/>>. 
+  The StringPointable is followed by the key which is <<2>>.
  
 ***  <<<0, 4, 98, 111, 111, 107, 0, 0, 0, 3>>>
  
-  The <Size> of the string is <<4>>. The <String Value> is <<book>>. The StringPointable is followed by the key which is <<3>>. 
+  The <Size> of the string is <<4>>. The <String Value> is <<book>>. 
+  The StringPointable is followed by the key which is <<3>>. 
  
 *** <<<0, 2, 101, 120, 0, 0, 0, 4>>>
  
-  The <Size> of the string is <<2>>. The <String Value> is <<ex>>. The StringPointable is followed by the key which is <<4>>.
+  The <Size> of the string is <<2>>. The <String Value> is <<ex>>. 
+  The StringPointable is followed by the key which is <<4>>.
  
 *** <<<0, 4, 105, 115, 98, 110, 0, 0, 0, 5>>>
  
-  The <Size> of the string is <<4>>. The <String Value> is <<isbn>>. The StringPointable is followed by the key which is <<5>>.
+  The <Size> of the string is <<4>>. The <String Value> is <<isbn>>. 
+  The StringPointable is followed by the key which is <<5>>.
  
 *** <<<0, 5, 116, 105, 116, 108, 101, 0, 0, 0, 6>>>
 
-  The <Size> of the string is <<4>>. The <String Value> is <<title>>. The StringPointable is followed by the key which is <<6>>.
+  The <Size> of the string is <<4>>. The <String Value> is <<title>>. 
+  The StringPointable is followed by the key which is <<6>>.
 
 
 ================================================================ 
 
 
-** Document Node Pointable ({NodeID:0})
+** Document Node ({NodeID:0})
   
-  This child is contained in the parent {{Node Tree Pointable}}.
-  
-  Byte Array for DNP NodeID:0
+  This child is contained in the parent {{Node Tree}}.
+   
+  Byte Array for Document Node (NodeID:0)
   
 ***  <<<101, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 102, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 10, 0, 0, 0, -42, 0, 0, 0, -34, 104, 0, 0, 0, 2, 0, 3, 10, 32, 32, 102, 6, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 30, 103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 4, 14, 0, 10, 48, 56, 49, 50, 52, 49, 54, 49, 51, 57, 0, 0, 0, 7, 0, 0, 0, 12, 0, 0, 0, 29, 0, 0, 0, 41, 0, 0, 0, 81, 0, 0, 0, 93, 0, 0, 0, 106, 0, 0, 0, 116, 104, 0, 0, 0, 5, 0, 5, 10, 32, 32, 32, 32, 105, 0, 0, 0, 6, 0, 10, 116, 111, 112, 32, 115, 101, 99, 114, 101, 116, 104, 0, 0, 0, 7, 0, 5, 10, 32, 32, 32, 32, 102, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 8, 0, 0, 0, 1, 0, 0, 0, 14, 104, 0, 0, 0, 9, 0, 7, 77, 97, 99, 98, 101, 116, 104, 104, 0, 0, 0, 10, 0, 5, 10, 32, 32, 32, 32, 106, 0, 0, 0, 11, 0, 4, 104, 105, 100, 101, 0, 0, 104, 0, 0, 0, 12, 0, 3, 10, 32, 32, 104, 0, 0, 0, 13, 0, 1, 10>>>
   
-    
-  <<< 101 >>>  Value tag for Document Node Pointable
+  <<<101>>> is the value tag for the Document Node Pointable.
+ 
+  Following are the bytes and contents of the Document Node Pointable.
   
-  <<< 0, 0, 0, 0 >>>  These 4 bytes represent the <Node Id> which has value <<0>>
+  <<< 0, 0, 0, 0 >>>  These 4 bytes represent the <Node Id> 
+  which has value <<0>>
  
   Every Document Node Pointable contains a Sequence Pointable. This is analogous 
   to a collection of items(data). In VXQuery, the items(data) 
@@ -167,12 +194,15 @@ VXQuery's XML Document Model
  
  Sequence Content:
  
-  <<<0, 0, 0, 1>>>  These 4 bytes represents the <Number of Items> in the sequence which is <<1>> 
+  <<<0, 0, 0, 1>>>  These 4 bytes represents the <Number of Items> 
+  in the sequence which is <<1>> 
  
-  <<<0, 0, 1, 0>>>  These 4 bytes represents the <Size of the item> which is <<257>>
+  <<<0, 0, 1, 0>>>  These 4 bytes represents 
+  the <Size of the item> which is <<257>>
  
   <Data in the Sequence>: Here the (item)data in the sequence is an 
-  Element Node Pointable ({{NodeID:1}}). Note that the data can represent any type of pointable or element.
+  Element Node Pointable ({{NodeID:1}}). Note that the data can represent any 
+  type of pointable or element.
   
 *** <<<102, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 10, 0, 0, 0, -42, 0, 0, 0, -34, 104, 0, 0, 0, 2, 0, 3, 10, 32, 32, 102, 6, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 30, 103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 4, 14, 0, 10, 48, 56, 49, 50, 52, 49, 54, 49, 51, 57, 0, 0, 0, 7, 0, 0, 0, 12, 0, 0, 0, 29, 0, 0, 0, 41, 0, 0, 0, 81, 0, 0, 0, 93, 0, 0, 0, 106, 0, 0, 0, 116, 104, 0, 0, 0, 5, 0, 5, 10, 32, 32, 32, 32, 105, 0, 0, 0, 6, 0, 10, 116, 111, 112, 32, 115, 101, 99, 114, 101, 116, 104, 0, 0, 0, 7, 0, 5, 10, 32, 32, 32, 32, 102, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 8, 0, 0, 0, 1, 0, 0, 0, 14, 104, 0, 0, 0, 9, 0, 7, 77, 97, 99, 98, 101, 116, 104, 104, 0, 0, 0, 10, 0, 5, 10, 32, 32, 32, 32, 106, 0, 0, 0, 11, 0, 4, 104, 105, 100, 101, 0, 0, 104, 0, 0, 0, 12, 0, 3, 10, 32, 32, 104, 0, 0, 0, 13, 0, 1, 10>>>
  
@@ -180,16 +210,18 @@ VXQuery's XML Document Model
 ================================================================ 
 
 
-**  Element Node Pointable ({NodeID:1})
+**  Element Node ({NodeID:1})
 
-  This child is contained in the parent Document Node Pointable ({{NodeID:0}}).
+  This child is contained in the parent Document Node ({{NodeID:0}}).
   
-  Byte Array for ENP NodeID:1
+  Byte Array for Element Node NodeID:1
   
 ***  <<<102, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 10, 0, 0, 0, -42, 0, 0, 0, -34, 104, 0, 0, 0, 2, 0, 3, 10, 32, 32, 102, 6, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 30, 103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 4, 14, 0, 10, 48, 56, 49, 50, 52, 49, 54, 49, 51, 57, 0, 0, 0, 7, 0, 0, 0, 12, 0, 0, 0, 29, 0, 0, 0, 41, 0, 0, 0, 81, 0, 0, 0, 93, 0, 0, 0, 106, 0, 0, 0, 116, 104, 0, 0, 0, 5, 0, 5, 10, 32, 32, 32, 32, 105, 0, 0, 0, 6, 0, 10, 116, 111, 112, 32, 115, 101, 99, 114, 101, 116, 104, 0, 0, 0, 7, 0, 5, 10, 32, 32, 32, 32, 102, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 8, 0, 0, 0, 1, 0, 0, 0, 14, 104, 0, 0, 0, 9, 0, 7, 77, 97, 99, 98, 101, 116, 104, 104, 0, 0, 0, 10, 0, 5, 10, 32, 32, 32, 32, 106, 0, 0, 0, 11, 0, 4, 104, 105, 100, 101, 0, 0, 104, 0, 0, 0, 12, 0, 3, 10, 32, 32, 104, 0, 0, 0, 13, 0, 1, 10>>>
  
-  <<< 102 >>>  Value tag for Element Node Pointable
-  
+  <<<102>>> is the value tag for Element Node Pointable.
+ 
+  Following are the bytes and contents of the Element Node Pointable.
+ 
   <<< 4 >>>  Header byte (One byte) that uses the lowest three bits to denote if
 
           ** bit <Namespace Chunk> exists: <No>
@@ -198,16 +230,20 @@ VXQuery's XML Document Model
           
           ** bit <Children Chunk> exists: <Yes>
           
-   <<<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1>>> This is a <Name Pointer> which is an array of integers(4 bytes) of size <<3>> 
+   <<<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1>>> This is a <Name Pointer> which is an
+   array of integers(4 bytes) of size <<3>> 
  
   <<<0, 0, 0, 1>>> This is the <Local Node Id> which uses 4 bytes.
  
-  Children Chunk is a Sequence Pointable. This is analogous to a collection of items(data). In VXQuery, the items(data) 
-  in the Sequence Pointable are preceded by the number of items in the sequence and item size. 
+  Children Chunk is a Sequence Pointable. This is analogous to a collection 
+  of items(data). In VXQuery, the items(data) 
+  in the Sequence Pointable are preceded by the number of items 
+  in the sequence and item size. 
 
   Sequence Content childrenChunk:
 
-  <<<0, 0, 0, 3>>>  <Number of Items> in the SequencePointable <children chunk> is <<3>>
+  <<<0, 0, 0, 3>>>  <Number of Items> in the 
+  SequencePointable <children chunk> is <<3>>
  
   <<<0, 0, 0, 10>>>  <Offset> of the first item is <<10>>
  
@@ -215,9 +251,10 @@ VXQuery's XML Document Model
    
   <<<0, 0, 0, -34>>>  <Offset> of the third item is <<222>>
   
-  <Data in the Sequence>: Here the items(data) in the sequence are Text Node Pointables ({{NodeID:2}}), 
-  ({{NodeID:13}}) and Element Node Pointable ({{NodeID:3}}). 
-  Note that the data can represent any type of pointable or element.
+  <Data in the Sequence>: Here the items(data) in the sequence are Text 
+  Node Pointables ({{NodeID:2}}), ({{NodeID:13}}) and Element Node Pointable
+  ({{NodeID:3}}). Note that the data can represent any type of pointable 
+  or element.
   
 ***  <<<104, 0, 0, 0, 2, 0, 3, 10, 32, 32, 102, 6, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 30, 103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 4, 14, 0, 10, 48, 56, 49, 50, 52, 49, 54, 49, 51, 57, 0, 0, 0, 7, 0, 0, 0, 12, 0, 0, 0, 29, 0, 0, 0, 41, 0, 0, 0, 81, 0, 0, 0, 93, 0, 0, 0, 106, 0, 0, 0, 116, 104, 0, 0, 0, 5, 0, 5, 10, 32, 32, 32, 32, 105, 0, 0, 0, 6, 0, 10, 116, 111, 112, 32, 115, 101, 99, 114, 101, 116, 104, 0, 0, 0, 7, 0, 5, 10, 32, 32, 32, 32, 102, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 8, 0, 0, 0, 1, 0, 0, 0, 14, 104, 0, 0, 0, 9, 0, 7, 77, 97, 99, 98, 101, 116, 104, 104, 0, 0, 0, 10, 0, 5, 10, 32, 32, 32, 32, 106, 0, 0, 0, 11, 0, 4, 104, 105, 100, 101, 0, 0, 104, 0, 0, 0, 12, 0, 3, 10, 32, 32, 104, 0, 0, 0, 13, 0, 1, 10>>>
 
@@ -225,34 +262,38 @@ VXQuery's XML Document Model
 ================================================================
 
 
-** Text Node Pointable ({NodeID:2}) 
+** Text Node ({NodeID:2}) 
   
-   This child is contained in the parent Element Node Pointable ({{NodeID:1}}).
+   This child is contained in the parent Element Node ({{NodeID:1}}).
   
-  Byte Array for TNP NodeID:2
+  Byte Array for Text Node NodeID:2
   
 ***  <<<104, 0, 0, 0, 2, 0, 3, 10, 32, 32>>>
+
+  <<<104>>> is the value tag for the Text Node Pointable.
  
-  <<< 104 >>>  Value tag for Text Node Pointable
+  Following are the bytes and contents of the Text Node Pointable.  
 
   <<<0, 0, 0, 2>>> This is the <Node Id> that uses 4 bytes and has value <<2>> 
  
-  <<<0, 3, 10, 32, 32>>> This is the <UTF8String> which has a size <<3>> and value <<10, 32, 32>>
-
+  <<<0, 3, 10, 32, 32>>> This is the <UTF8String> which has a size <<3>> 
+  and value represents a <<new line>> and 2 <<spaces>>
 
 ================================================================
 
 
-** Element Node Pointable ({NodeID:3})
+** Element Node ({NodeID:3})
   
-  This child is contained in the parent Element Node Pointable ({{NodeID:1}}).
+  This child is contained in the parent Element Node ({{NodeID:1}}).
    
-  Byte Array for TNP NodeID:3
+  Byte Array for Element Node NodeID:3
    
 ***  <<<102, 6, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 30, 103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 4, 14, 0, 10, 48, 56, 49, 50, 52, 49, 54, 49, 51, 57, 0, 0, 0, 7, 0, 0, 0, 12, 0, 0, 0, 29, 0, 0, 0, 41, 0, 0, 0, 81, 0, 0, 0, 93, 0, 0, 0, 106, 0, 0, 0, 116, 104, 0, 0, 0, 5, 0, 5, 10, 32, 32, 32, 32, 105, 0, 0, 0, 6, 0, 10, 116, 111, 112, 32, 115, 101, 99, 114, 101, 116, 104, 0, 0, 0, 7, 0, 5, 10, 32, 32, 32, 32, 102, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 8, 0, 0, 0, 1, 0, 0, 0, 14, 104, 0, 0, 0, 9, 0, 7, 77, 97, 99, 98, 101, 116, 104, 104, 0, 0, 0, 10, 0, 5, 10, 32, 32, 32, 32, 106, 0, 0, 0, 11, 0, 4, 104, 105, 100, 101, 0, 0, 104, 0, 0, 0, 12, 0, 3, 10, 32, 32>>>
   
-  <<< 102 >>>  Value tag for Element Node Pointable
-  
+  <<<102>>> is the value tag for the Element Node Pointable.
+ 
+  Following are the bytes and contents of the Element Node Pointable.
+ 
   <<< 6 >>>  Header byte (One byte) that uses the three lowest bit to denote if
 
           ** bit <Namespace Chunk> exists: <No>
@@ -261,7 +302,8 @@ VXQuery's XML Document Model
           
           ** bit <Children Chunk> exists: <Yes>
  
-  <<<0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 3>>> This is a <Name Pointer> which is an array of integers(4 bytes) of size <<3>> 
+  <<<0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 3>>> This is a <Name Pointer> which is an 
+  array of integers(4 bytes) of size <<3>> 
  
   <<<0, 0, 0, 3>>> This is the <Local Node Id> which uses 4 bytes.
  
@@ -269,22 +311,26 @@ VXQuery's XML Document Model
   
   Sequence Content attributeChunk:
   
-  <<<0, 0, 0, 1>>>  <Number of Items> in the SequencePointable <attribute chunk> is <<1>>
+  <<<0, 0, 0, 1>>>  <Number of Items> in the 
+  SequencePointable <attribute chunk> is <<1>>
  
   <<<0, 0, 0, 30>>>  <Size> of the first item is <<30>>
   
    <Data in the Sequence>: Here the item(data) in the sequence is an 
-   Attribute Node Pointable ({{NodeID:4}}). Note that the data can represent any type of pointable or element.
+   Attribute Node Pointable ({{NodeID:4}}). Note that the data 
+   can represent any type of pointable or element.
   
 ***  <<< 103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 4, 14, 0, 10, 48, 56, 49, 50, 52,  49, 54, 49, 51, 57>>>
 
   Children Chunk is a Sequence Pointable. This is analogous to a collection of 
   items(data). In VXQuery, the items(data) 
-  in the Sequence Pointable are preceded by the number of items in the sequence and item size. 
+  in the Sequence Pointable are preceded by the number of 
+  items in the sequence and item size. 
   
   Sequence Content childrenChunk:
 
-  <<<0, 0, 0, 7>>>  <Number of Items> in the SequencePointable <children chunk> is <<3>>
+  <<<0, 0, 0, 7>>>  <Number of Items> in the
+  SequencePointable <children chunk> is <<3>>
  
   <<<0, 0, 0, 12>>>  <Offset> of the first item is <<12>>
  
@@ -300,10 +346,10 @@ VXQuery's XML Document Model
 
   <<<0, 0, 0, 116>>>  <Offset> of the seventh item is <<116>>
   
-  <Data in the Sequence>: Here the items(data) in the sequence are Text Node Pointables
+  <Data in the Sequence>: Here the items(data) in the sequence are Text Node
   ({{NodeID:5}}), ({{NodeID:7}}), ({{NodeID:10}}), ({{NodeID:12}}), 
-  ElementNodePointable ({{NodeID:8}}), CommentNodePointable ({{NodeID:6}}) and
-  PINodePointable ({{NodeID:11}}). 
+  Element Node ({{NodeID:8}}), Comment Node ({{NodeID:6}}) and
+  Processing Instruction Node ({{NodeID:11}}). 
    
 ***  <<<104, 0, 0, 0, 5, 0, 5, 10, 32, 32, 32, 32, 105, 0, 0, 0, 6, 0, 10, 116, 111, 112, 32, 115, 101, 99, 114, 101, 116, 104, 0, 0, 0, 7, 0, 5, 10, 32, 32, 32, 32, 102, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 8, 0, 0, 0, 1, 0, 0, 0, 14, 104, 0, 0, 0, 9, 0, 7, 77, 97, 99, 98, 101, 116, 104, 104, 0, 0, 0, 10, 0, 5, 10, 32, 32, 32, 32, 106, 0, 0, 0, 11, 0, 4, 104, 105, 100, 101, 0, 0, 104, 0, 0, 0, 12, 0, 3, 10, 32, 32, 104, 0, 0, 0, 13, 0, 1, 10>>>
 
@@ -311,18 +357,21 @@ VXQuery's XML Document Model
 ================================================================
 
 
-** Attribute Node Pointable ({NodeID:3})
+** Attribute Node ({NodeID:3})
 
-  This child is contained in the parent Element Node Pointable ({{NodeID:3}}).
+  This child is contained in the parent Element Node ({{NodeID:3}}).
   
-  Byte Array for ANP NodeID:3
+  Byte Array for Attribute Node NodeID:3
   
 ***  <<<103, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 4, 14, 0, 10, 48, 56, 49, 50, 52, 49, 54, 49, 51, 57>>>
   
-  <<< 103 >>>  Value tag for Attribute Node Pointable
+  <<<103>>> is the value tag for the Attribute Node Pointable.
+ 
+  Following are the bytes and contents of the Attribute Node Pointable.
  
   <<<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5,>>> This is a <Name Pointer> 
-  which is an array of integers(4 bytes) of size <<3>>. It consists of <PrefixCode>, <NamespaceCode>, <LocalCode>.
+  which is an array of integers(4 bytes) of size <<3>>. It consists of 
+  <PrefixCode>, <NamespaceCode>, <LocalCode>.
 
   <<<0, 0, 0, 4>>> This is the <NodeId> which has a value of <<4>>.
  
@@ -335,18 +384,21 @@ VXQuery's XML Document Model
 
 ** Text Node Pointable ({NodeID:5})
 
-  This child is contained in the parent Element Node Pointable ({{NodeID:3}}) childrenChunnk.
+  This child is contained in the parent Element Node ({{NodeID:3}})
+  childrenChunk.
   
-  Byte Array for TNP NodeID:5
+  Byte Array for Text Node NodeID:5
   
 ***  <<<104, 0, 0, 0, 5, 0, 5, 10, 32, 32, 32, 32>>>
  
-  <<< 104 >>>  Value tag for Text Node Pointable
+  <<<104>>> is the value tag for the Text Node Pointable.
+ 
+  Following are the bytes and contents of the Text Node Pointable.
 
   <<<0, 0, 0, 5>>> This is the <Node Id> that uses 4 bytes and has value <<2>> 
  
-  <<< 0, 5, 10, 32, 32, 32, 32>>> This is the <UTF8String> which has a size <<5>> 
-  and value represents a <<new line>> and 4 <<spaces>>
+  <<< 0, 5, 10, 32, 32, 32, 32>>> This is the <UTF8String> which has 
+  a size <<5>> and value represents a <<new line>> and 4 <<spaces>>
 
 
 ================================================================
@@ -354,17 +406,21 @@ VXQuery's XML Document Model
 
 ** Comment Node Pointable ({NodeID:6})
 
-  This child is contained in the parent Element Node Pointable ({{NodeID:3}}) childrenChunnk.
+  This child is contained in the parent Element Node ({{NodeID:3}}) 
+  childrenChunk.
   
-  Byte Array for TNP NodeID:6
+  Byte Array for Comment Node NodeID:6
  
 *** <<<105, 0, 0, 0, 6, 0, 10, 116, 111, 112, 32, 115, 101, 99, 114, 101, 116>>>
   
-  <<< 105 >>>  Value tag for Comment Node Pointable
+  <<<105>>> is the value tag for the Comment Node Pointable.
+ 
+  Following are the bytes and contents of the Comment Node Pointable.
  
   <<<0, 0, 0, 6>>> This is the <Node Id> that uses 4 bytes and has value <<6>> 
  
-  <<< 0, 10, 116, 111, 112, 32, 115, 101, 99, 114, 101, 116>>> This is the <UTF8String> which has a size <<10>> and value <<top secret>>
+  <<< 0, 10, 116, 111, 112, 32, 115, 101, 99, 114, 101, 116>>> 
+  This is the <UTF8String> which has a size <<10>> and value <<top secret>>
  
  
 ================================================================
@@ -372,31 +428,38 @@ VXQuery's XML Document Model
  
 ** Text Node Pointable ({NodeID:7})
  
-  This child is contained in the parent Element Node Pointable ({{NodeID:3}}) childrenChunnk.
+  This child is contained in the parent Element Node ({{NodeID:3}}) 
+  childrenChunk.
   
-  Byte Array for TNP NodeID:7
+  Byte Array for Text Node NodeID:7
   
 ***  <<< 104, 0, 0, 0, 7, 0, 5, 10, 32, 32, 32, 32>>>  
  
-  <<< 104 >>>  Value tag for Text Node Pointable
+  <<<104>>> is the value tag for the Text Node Pointable.
+ 
+  Following are the bytes and contents of the Text Node Pointable.
 
   <<<0, 0, 0, 7>>> This is the <Node Id> that uses 4 bytes and has value <<7>> 
  
-  <<< 0, 5, 10, 32, 32, 32, 32>>> This is the <UTF8String> which has a size <<5>> and value represents a <<new line>> and 4 <<spaces>>
+  <<< 0, 5, 10, 32, 32, 32, 32>>> This is the <UTF8String> 
+  which has a size <<5>> and value represents a <<new line>> and 4 <<spaces>>
 
 
 ================================================================
 
 
-** Element Node Pointable ({NodeID:8})
+** Element Node ({NodeID:8})
 
-  This child is contained in the parent Element Node Pointable ({{NodeID:3}}) childrenChunnk.
+  This child is contained in the parent Element Node ({{NodeID:3}}) 
+  childrenChunk.
   
-  Byte Array for TNP NodeID:8
+  Byte Array for Element Node NodeID:8
   
 ***  <<<102, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 8, 0, 0, 0, 1, 0, 0, 0, 14, 104, 0, 0, 0, 9, 0, 7, 77, 97, 99, 98, 101, 116, 104>>>
  
-  <<< 102 >>>  Value tag for Element Node Pointable
+  <<<102>>> is the value tag for the Element Node Pointable.
+ 
+  Following are the bytes and contents of the Element Node Pointable.
   
   <<< 4 >>>  Header byte (One byte) that uses the lowest three bits to denote if
 
@@ -406,7 +469,8 @@ VXQuery's XML Document Model
           
           ** bit <Children Chunk> exists: <Yes>
  
-  <<<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6>>> This is a <Name Pointer> which is an array of integers(4 bytes) of size <<3>> 
+  <<<0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6>>> This is a <Name Pointer> 
+  which is an array of integers(4 bytes) of size <<3>> 
  
   <<<0, 0, 0, 8>>> This is the <Node Id> that uses 4 bytes and has value <<8>> 
   
@@ -414,11 +478,13 @@ VXQuery's XML Document Model
   
   Sequence Content childrenChunk
 
-  <<<0, 0, 0, 1>>> <Number of Items> in the SequencePointable <children chunk> is <<1>>
+  <<<0, 0, 0, 1>>> <Number of Items> in the 
+  SequencePointable <children chunk> is <<1>>
   
   <<<0, 0, 0, 14>>> <Offset> of the first item is <<14>>
   
-  <Data in the Sequence>: Here the (item)data in the sequence is an Text Node Pointable ({{NodeID:9}}).
+  <Data in the Sequence>: Here the (item)data in the sequence is a 
+  Text Node Pointable ({{NodeID:9}}).
   
 ***   <<< 104, 0, 0, 0, 9, 0, 7, 77, 97, 99, 98, 101, 116, 104>>>
  
@@ -428,17 +494,20 @@ VXQuery's XML Document Model
  
 ** Text Node Pointable ({NodeID:9})
 
-  This child is contained in the parent Element Node Pointable ({{NodeID:8}}).
+  This child is contained in the parent Element Node ({{NodeID:8}}).
   
-  Byte Array for TNP NodeID:9
+  Byte Array for Text NodeID:9
   
 ***  <<<104, 0, 0, 0, 9, 0, 7, 77, 97, 99, 98, 101, 116, 104>>>
  
-  <<< 104 >>>  Value tag for Text Node Pointable
+  <<<104>>> is the value tag for the Text Node Pointable.
+ 
+  Following are the bytes and contents of the Text Node Pointable.
 
   <<<0, 0, 0, 9>>> This is the <Node Id> that uses 4 bytes and has value <<9>> 
  
-  <<<0, 7, 77, 97, 99, 98, 101, 116, 104>>> This is the <UTF8String> which has a size <<7>> and value <<Macbeth>>
+  <<<0, 7, 77, 97, 99, 98, 101, 116, 104>>> This is the <UTF8String> 
+  which has a size <<7>> and value <<Macbeth>>
 
 
 ================================================================
@@ -446,13 +515,17 @@ VXQuery's XML Document Model
 
 ** Text Node Pointable ({NodeID:10})
    
-  This child is contained in the parent Element Node Pointable ({{NodeID:3}}) childrenChunnk.
+  This child is contained in the parent Element Node ({{NodeID:3}}) 
+  childrenChunk.
    
-  Byte Array for TNP NodeID:10
+  Byte Array for Text Node NodeID:10
   
 ***  <<<104, 0, 0, 0, 10, 0, 5, 10, 32, 32, 32, 32>>>
     
-  <<< 104 >>>  Value tag for Text Node Pointable
+  <<<104>>>
+  and the rest of the bytes represent a Text Node Pointable.
+ 
+  Following are the bytes and contents of the Text Node Pointable.
 
   <<<0, 0, 0, 10>>> This is the <Node Id> that uses 4 bytes and has value <<2>> 
  
@@ -463,21 +536,28 @@ VXQuery's XML Document Model
 ================================================================
 
 
-** PI Node Pointable ({NodeID:11})
+** Processing Instruction Node ({NodeID:11})
 
-  This child is contained in the parent Element Node Pointable ({{NodeID:3}}) childrenChunnk.
+  This child is contained in the parent Element Node ({{NodeID:3}}) 
+  childrenChunk.
   
-  Byte Array for TNP NodeID:11
+  Byte Array for Processing Instruction Node NodeID:11
   
 ***  <<<106, 0, 0, 0, 11, 0, 4, 104, 105, 100, 101>>>
   
-  <<< 106 >>> Value tag for Processing Intruction Node Pointable
+  Note that this is a Tagged Value Pointable in which the value tag is <<106>>
+  and the rest of the bytes represent a Processing Instruction Node Pointable.
  
+  Following are the bytes and contents of the Processing 
+  Instruction Node Pointable.
+
   <<<0, 0, 0, 11>>> This is the <Node Id> that uses 4 bytes and has value <<11>>
  
-  <<<0, 4, 104, 105, 100, 101>>>  This is the <UTF8String> which has a size <<4>> and value <<hide>>
+  <<<0, 4, 104, 105, 100, 101>>>  This is the <UTF8String> 
+  which has a size <<4>> and value <<hide>>
  
-  <<<0, 0>>> This is also a string representing content. It is a <<null string>>. 
+  <<<0, 0>>> This is also a string representing content. 
+  It is a <<null string>>. 
 
 
 ================================================================
@@ -485,17 +565,22 @@ VXQuery's XML Document Model
 
 ** Text Node Pointable ({NodeID:12})
 
-  This child is contained in the parent Element Node Pointable ({{NodeID:3}}) childrenChunnk.
+  This child is contained in the parent Element Node ({{NodeID:3}}) 
+  childrenChunk.
   
-   Byte Array for TNP NodeID:12
+   Byte Array for Text Node NodeID:12
   
 ***  <<<104, 0, 0, 0, 12, 0, 3, 10, 32, 32>>>
   
-  <<< 104 >>>  Value tag for Text Node Pointable
+  Note that this is a Tagged Value Pointable in which the value tag is <<104>>
+  and the rest of the bytes represent a Text Node Pointable.
+ 
+  Following are the bytes and contents of the Text Node Pointable.
 
   <<<0, 0, 0, 12>>> This is the <Node Id> that uses 4 bytes and has value <<12>> 
 
-  <<<0, 3, 10, 32, 32>>> This is the <UTF8String> which has a size <<3>> and value represents a <<new line>> and 2 <<spaces>>.
+  <<<0, 3, 10, 32, 32>>> This is the <UTF8String> which has a size <<3>> 
+  and value represents a <<new line>> and 2 <<spaces>>.
 
 
 ================================================================
@@ -503,17 +588,20 @@ VXQuery's XML Document Model
 
 ** Text Node Pointable ({NodeID:13})
 
-  This child is contained in the parent Element Node Pointable ({{NodeID:1}}).
+  This child is contained in the parent Element Node ({{NodeID:1}}).
   
-  Byte Array for TNP NodeID:13
+  Byte Array for Text Node NodeID:13
   
 ***  <<<104, 0, 0, 0, 13, 0, 1, 10>>>
 
-  <<< 104 >>>  Value tag for Text Node Pointable
+  <<<104>>> is the value tag for the Text Node Pointable.
+ 
+  Following are the bytes and contents of the Text Node Pointable.
 
   <<<0, 0, 0, 13>>> This is the <Node Id> that uses 4 bytes and has value <<13>> 
  
-  <<<0, 1, 10>>> This is the <UTF8String> which has a size <<1>> and value represents a <<new line>>.
+  <<<0, 1, 10>>> This is the <UTF8String> which has a size <<1>> 
+  and value represents a <<new line>>.
 
 
 ================================================================
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/vxquery/blob/7bd35c91/src/site/apt/development_xml_node_details.apt
----------------------------------------------------------------------
diff --git a/src/site/apt/development_xml_node_details.apt b/src/site/apt/development_xml_node_details.apt
index 647b8d1..286bd8c 100644
--- a/src/site/apt/development_xml_node_details.apt
+++ b/src/site/apt/development_xml_node_details.apt
@@ -13,7 +13,7 @@
 ~~ See the License for the specific language governing permissions and
 ~~ limitations under the License.
 
-Data XML and Node Types
+XML Data and Node Types
 
   XML is used as the data source for XQuery and must be parsed into Hyracks data. Each
   node type defined in XPath and XQuery can be mapped into pointable defined in Apache 
@@ -21,23 +21,23 @@ Data XML and Node Types
 
 * XPath Node Types
 
-*--------------------------------+----------------------+---------------+
-| <<Data Type>>                  | <<Pointable Name>>   | <<Data Size>> |
-*--------------------------------+----------------------+---------------:
-| Attribute Nodes                | {{{https://git-wip-us.apache.org/repos/asf?p=vxquery.git;a=blob;f=vxquery-core/src/main/java/org/apache/vxquery/datamodel/accessors/nodes/AttributeNodePointable.java}AttributeNodePointable}}      |    1 + length |
-*--------------------------------+----------------------+---------------:
-| Document Nodes                 | {{{https://git-wip-us.apache.org/repos/asf?p=vxquery.git;a=blob;f=vxquery-core/src/main/java/org/apache/vxquery/datamodel/accessors/nodes/DocumentNodePointable.java}DocumentNodePointable}}      |    1 + length |
-*--------------------------------+----------------------+---------------:
-| Element Nodes                  | {{{https://git-wip-us.apache.org/repos/asf?p=vxquery.git;a=blob;f=vxquery-core/src/main/java/org/apache/vxquery/datamodel/accessors/nodes/ElementNodePointable.java}ElementNodePointable}}      |    1 + length |
-*--------------------------------+----------------------+---------------:
-| Node Tree Nodes                | {{{https://git-wip-us.apache.org/repos/asf?p=vxquery.git;a=blob;f=vxquery-core/src/main/java/org/apache/vxquery/datamodel/accessors/nodes/NodeTreePointable.java}NodeTreePointable}}      |    1 + length |
-*--------------------------------+----------------------+---------------:
-| Processing Instruction Nodes   | {{{https://git-wip-us.apache.org/repos/asf?p=vxquery.git;a=blob;f=vxquery-core/src/main/java/org/apache/vxquery/datamodel/accessors/nodes/PINodePointable.java}PINodePointable}}      |    1 + length |
-*--------------------------------+----------------------+---------------:
-| Comment Nodes                  | {{{https://git-wip-us.apache.org/repos/asf?p=vxquery.git;a=blob;f=vxquery-core/src/main/java/org/apache/vxquery/datamodel/accessors/nodes/TextOrCommentNodePointable.java}TextOrCommentNodePointable}}      |    1 + length |
-*--------------------------------+----------------------+---------------:
-| Text Nodes                     | {{{https://git-wip-us.apache.org/repos/asf?p=vxquery.git;a=blob;f=vxquery-core/src/main/java/org/apache/vxquery/datamodel/accessors/nodes/TextOrCommentNodePointable.java}TextOrCommentNodePointable}}      |    1 + length |
-*--------------------------------+----------------------+---------------:
+*-----------------------------------+----------------------+---------------+
+| <<Data Type>>                     | <<Pointable Name>>   | <<Data Size>> |
+*-----------------------------------+----------------------+---------------:
+| Attribute Nodes(ANP)              | {{{https://git-wip-us.apache.org/repos/asf?p=vxquery.git;a=blob;f=vxquery-core/src/main/java/org/apache/vxquery/datamodel/accessors/nodes/AttributeNodePointable.java}AttributeNodePointable}}      |    1 + length |
+*-----------------------------------+----------------------+---------------:
+| Document Nodes(DNP)               | {{{https://git-wip-us.apache.org/repos/asf?p=vxquery.git;a=blob;f=vxquery-core/src/main/java/org/apache/vxquery/datamodel/accessors/nodes/DocumentNodePointable.java}DocumentNodePointable}}      |    1 + length |
+*-----------------------------------+----------------------+---------------:
+| Element Nodes(ENP)                | {{{https://git-wip-us.apache.org/repos/asf?p=vxquery.git;a=blob;f=vxquery-core/src/main/java/org/apache/vxquery/datamodel/accessors/nodes/ElementNodePointable.java}ElementNodePointable}}      |    1 + length |
+*-----------------------------------+----------------------+---------------:
+| Node Tree(NTP)                    | {{{https://git-wip-us.apache.org/repos/asf?p=vxquery.git;a=blob;f=vxquery-core/src/main/java/org/apache/vxquery/datamodel/accessors/nodes/NodeTreePointable.java}NodeTreePointable}}      |    1 + length |
+*-----------------------------------+----------------------+---------------:
+| Processing Instruction Node(PINP) | {{{https://git-wip-us.apache.org/repos/asf?p=vxquery.git;a=blob;f=vxquery-core/src/main/java/org/apache/vxquery/datamodel/accessors/nodes/PINodePointable.java}PINodePointable}}      |    1 + length |
+*-----------------------------------+----------------------+---------------:
+| Comment Node(CNP)                 | {{{https://git-wip-us.apache.org/repos/asf?p=vxquery.git;a=blob;f=vxquery-core/src/main/java/org/apache/vxquery/datamodel/accessors/nodes/TextOrCommentNodePointable.java}TextOrCommentNodePointable}}      |    1 + length |
+*-----------------------------------+----------------------+---------------:
+| Text Node (TNP)                   | {{{https://git-wip-us.apache.org/repos/asf?p=vxquery.git;a=blob;f=vxquery-core/src/main/java/org/apache/vxquery/datamodel/accessors/nodes/TextOrCommentNodePointable.java}TextOrCommentNodePointable}}      |    1 + length |
+*-----------------------------------+----------------------+---------------:
 
 
 * XML Mapping

http://git-wip-us.apache.org/repos/asf/vxquery/blob/7bd35c91/src/site/site.xml
----------------------------------------------------------------------
diff --git a/src/site/site.xml b/src/site/site.xml
index 9f41540..7cee490 100644
--- a/src/site/site.xml
+++ b/src/site/site.xml
@@ -72,9 +72,12 @@ limitations under the License.
                 name="Data Handling"
                 href="development_data_handling.html" />
             <item
-                name="Data XML and Node Types"
+                name="XML Data and Node Types"
                 href="development_xml_node_details.html" />
             <item
+                name="XML Data Model Example"
+                href="development_xml_document.html" />
+            <item
                 name="Eclipse Setup"
                 href="development_eclipse_setup.html" />
             <item

http://git-wip-us.apache.org/repos/asf/vxquery/blob/7bd35c91/vxquery-xtest/src/main/java/org/apache/vxquery/xtest/TestRunner.java
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/main/java/org/apache/vxquery/xtest/TestRunner.java b/vxquery-xtest/src/main/java/org/apache/vxquery/xtest/TestRunner.java
index c738205..5f04a7a 100644
--- a/vxquery-xtest/src/main/java/org/apache/vxquery/xtest/TestRunner.java
+++ b/vxquery-xtest/src/main/java/org/apache/vxquery/xtest/TestRunner.java
@@ -200,9 +200,9 @@ public class TestRunner {
         if (opts.showResult) {
             System.err.println("***Result: ");
             System.err.println(res.result);
-            if(res.result == null){
+            if (res.result == null) {
                 System.err.println("***Error: ");
-                System.err.println(res.error);
+                System.err.println(res.error.getStackTrace());
             }
         }
         return res;


[8/9] vxquery git commit: files updated to include the proposed changes in the comments

Posted by pr...@apache.org.
files updated to include the proposed changes in the comments


Project: http://git-wip-us.apache.org/repos/asf/vxquery/repo
Commit: http://git-wip-us.apache.org/repos/asf/vxquery/commit/c7840585
Tree: http://git-wip-us.apache.org/repos/asf/vxquery/tree/c7840585
Diff: http://git-wip-us.apache.org/repos/asf/vxquery/diff/c7840585

Branch: refs/heads/prestonc/xmark
Commit: c784058582d900eda3513399627fa3ccbe8f68f1
Parents: cda864c
Author: Shivani Mall <sm...@ucr.edu>
Authored: Wed Jun 17 18:22:40 2015 -0700
Committer: Shivani Mall <sm...@ucr.edu>
Committed: Wed Jun 17 18:22:40 2015 -0700

----------------------------------------------------------------------
 src/site/apt/development_xml_node_details.apt           |  2 +-
 .../main/java/org/apache/vxquery/xtest/TestRunner.java  |  2 --
 .../java/org/apache/vxquery/xtest/XTestOptions.java     | 12 ++++++------
 3 files changed, 7 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/vxquery/blob/c7840585/src/site/apt/development_xml_node_details.apt
----------------------------------------------------------------------
diff --git a/src/site/apt/development_xml_node_details.apt b/src/site/apt/development_xml_node_details.apt
index 286bd8c..7483b0e 100644
--- a/src/site/apt/development_xml_node_details.apt
+++ b/src/site/apt/development_xml_node_details.apt
@@ -36,7 +36,7 @@ XML Data and Node Types
 *-----------------------------------+----------------------+---------------:
 | Comment Node(CNP)                 | {{{https://git-wip-us.apache.org/repos/asf?p=vxquery.git;a=blob;f=vxquery-core/src/main/java/org/apache/vxquery/datamodel/accessors/nodes/TextOrCommentNodePointable.java}TextOrCommentNodePointable}}      |    1 + length |
 *-----------------------------------+----------------------+---------------:
-| Text Node (TNP)                   | {{{https://git-wip-us.apache.org/repos/asf?p=vxquery.git;a=blob;f=vxquery-core/src/main/java/org/apache/vxquery/datamodel/accessors/nodes/TextOrCommentNodePointable.java}TextOrCommentNodePointable}}      |    1 + length |
+| Text Node(TNP)                    | {{{https://git-wip-us.apache.org/repos/asf?p=vxquery.git;a=blob;f=vxquery-core/src/main/java/org/apache/vxquery/datamodel/accessors/nodes/TextOrCommentNodePointable.java}TextOrCommentNodePointable}}      |    1 + length |
 *-----------------------------------+----------------------+---------------:
 
 

http://git-wip-us.apache.org/repos/asf/vxquery/blob/c7840585/vxquery-xtest/src/main/java/org/apache/vxquery/xtest/TestRunner.java
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/main/java/org/apache/vxquery/xtest/TestRunner.java b/vxquery-xtest/src/main/java/org/apache/vxquery/xtest/TestRunner.java
index 5e9ca3f..1e3e4ca 100644
--- a/vxquery-xtest/src/main/java/org/apache/vxquery/xtest/TestRunner.java
+++ b/vxquery-xtest/src/main/java/org/apache/vxquery/xtest/TestRunner.java
@@ -110,7 +110,6 @@ public class TestRunner {
                 if (opts.showQuery) {
                     System.err.println("***Query for " + testCase.getXQueryDisplayName() + ": ");
                     System.err.println(IOUtils.toString(query, "UTF-8"));
-                    //query.reset();
                 }
 
                 VXQueryCompilationListener listener = new VXQueryCompilationListener(opts.showAST, opts.showTET,
@@ -187,7 +186,6 @@ public class TestRunner {
             } else {
                 System.err.println("***Result: ");
                 System.err.println(res.result);
-
             }
         }
         return res;

http://git-wip-us.apache.org/repos/asf/vxquery/blob/c7840585/vxquery-xtest/src/main/java/org/apache/vxquery/xtest/XTestOptions.java
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/main/java/org/apache/vxquery/xtest/XTestOptions.java b/vxquery-xtest/src/main/java/org/apache/vxquery/xtest/XTestOptions.java
index e3da66f..1ddeb76 100644
--- a/vxquery-xtest/src/main/java/org/apache/vxquery/xtest/XTestOptions.java
+++ b/vxquery-xtest/src/main/java/org/apache/vxquery/xtest/XTestOptions.java
@@ -55,25 +55,25 @@ public class XTestOptions {
 
     @Option(name = "-htmlreport", required = false, usage = "HTML Report output file")
     String htmlReport;
-    
+
     @Option(name = "-showquery", usage = "Show query string")
     boolean showQuery;
 
     @Option(name = "-showast", usage = "Show abstract syntax tree")
     boolean showAST;
 
-    @Option(name = "-showtet", usage = "Show translated expression tree") 
+    @Option(name = "-showtet", usage = "Show translated expression tree")
     boolean showTET;
 
-    @Option(name = "-showoet", usage = "Show optimized expression tree") 
+    @Option(name = "-showoet", usage = "Show optimized expression tree")
     boolean showOET;
 
-    @Option(name = "-showrp", usage = "Show Runtime plan") 
+    @Option(name = "-showrp", usage = "Show Runtime plan")
     boolean showRP;
 
     @Option(name = "-compileonly", usage = "Compile the query and stop")
     boolean compileOnly;
-    
-    @Option(name = "-showresult", usage = "shows query result")
+
+    @Option(name = "-showresult", usage = "Show query result")
     boolean showResult;
 }
\ No newline at end of file


[7/9] vxquery git commit: printing error if result isn't generated

Posted by pr...@apache.org.
printing error if result isn't generated


Project: http://git-wip-us.apache.org/repos/asf/vxquery/repo
Commit: http://git-wip-us.apache.org/repos/asf/vxquery/commit/cda864cc
Tree: http://git-wip-us.apache.org/repos/asf/vxquery/tree/cda864cc
Diff: http://git-wip-us.apache.org/repos/asf/vxquery/diff/cda864cc

Branch: refs/heads/prestonc/xmark
Commit: cda864cc7fce5da6fcb026c7c0c3a0e0f6d77e00
Parents: dbbedc9
Author: Shivani Mall <sm...@ucr.edu>
Authored: Thu Jun 4 13:03:26 2015 -0700
Committer: Shivani Mall <sm...@ucr.edu>
Committed: Thu Jun 4 13:03:26 2015 -0700

----------------------------------------------------------------------
 .../src/main/java/org/apache/vxquery/xtest/TestRunner.java     | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/vxquery/blob/cda864cc/vxquery-xtest/src/main/java/org/apache/vxquery/xtest/TestRunner.java
----------------------------------------------------------------------
diff --git a/vxquery-xtest/src/main/java/org/apache/vxquery/xtest/TestRunner.java b/vxquery-xtest/src/main/java/org/apache/vxquery/xtest/TestRunner.java
index d68c09c..5e9ca3f 100644
--- a/vxquery-xtest/src/main/java/org/apache/vxquery/xtest/TestRunner.java
+++ b/vxquery-xtest/src/main/java/org/apache/vxquery/xtest/TestRunner.java
@@ -181,11 +181,13 @@ public class TestRunner {
             res.time = end - start;
         }
         if (opts.showResult) {
-            System.err.println("***Result: ");
-            System.err.println(res.result);
             if (res.result == null) {
                 System.err.println("***Error: ");
                 System.err.println(res.error.getStackTrace());
+            } else {
+                System.err.println("***Result: ");
+                System.err.println(res.result);
+
             }
         }
         return res;