Bug 339771: Split WTP-specific schema type provider into separate plugin (plus test plugin)
diff --git a/tests/org.eclipse.wst.xml.xpath2.wtptypes.tests/.classpath b/tests/org.eclipse.wst.xml.xpath2.wtptypes.tests/.classpath
new file mode 100644
index 0000000..4ecc50e
--- /dev/null
+++ b/tests/org.eclipse.wst.xml.xpath2.wtptypes.tests/.classpath
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
+		<accessrules>
+			<accessrule kind="accessible" pattern="org/eclipse/wst/xml/xpath2/processor/**"/>
+		</accessrules>
+	</classpathentry>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="lib" path="lib/xmlunit-1.2.jar"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/tests/org.eclipse.wst.xml.xpath2.wtptypes.tests/.cvsignore b/tests/org.eclipse.wst.xml.xpath2.wtptypes.tests/.cvsignore
new file mode 100644
index 0000000..cb1a77b
--- /dev/null
+++ b/tests/org.eclipse.wst.xml.xpath2.wtptypes.tests/.cvsignore
@@ -0,0 +1 @@
+.byecycle
diff --git a/tests/org.eclipse.wst.xml.xpath2.wtptypes.tests/.project b/tests/org.eclipse.wst.xml.xpath2.wtptypes.tests/.project
new file mode 100644
index 0000000..aea4b6a
--- /dev/null
+++ b/tests/org.eclipse.wst.xml.xpath2.wtptypes.tests/.project
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.eclipse.wst.xml.xpath2.wtptypes.tests</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
+	</natures>
+</projectDescription>
diff --git a/tests/org.eclipse.wst.xml.xpath2.wtptypes.tests/.settings/.api_filters b/tests/org.eclipse.wst.xml.xpath2.wtptypes.tests/.settings/.api_filters
new file mode 100644
index 0000000..64569fc
--- /dev/null
+++ b/tests/org.eclipse.wst.xml.xpath2.wtptypes.tests/.settings/.api_filters
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<component id="org.eclipse.wst.xml.xpath2.processor.tests" version="2">
+    <resource path="src/org/eclipse/wst/xml/xpath2/processor/testsuite/userdefined/XercesFloatUserDefined.java" type="org.eclipse.wst.xml.xpath2.processor.testsuite.userdefined.XercesFloatUserDefined">
+        <filter id="576720909">
+            <message_arguments>
+                <message_argument value="XSFloat"/>
+                <message_argument value="XercesFloatUserDefined"/>
+            </message_arguments>
+        </filter>
+    </resource>
+    <resource path="src/org/eclipse/wst/xml/xpath2/processor/testsuite/userdefined/XercesIntegerUserDefined.java" type="org.eclipse.wst.xml.xpath2.processor.testsuite.userdefined.XercesIntegerUserDefined">
+        <filter id="576720909">
+            <message_arguments>
+                <message_argument value="XSInteger"/>
+                <message_argument value="XercesIntegerUserDefined"/>
+            </message_arguments>
+        </filter>
+    </resource>
+    <resource path="src/org/eclipse/wst/xml/xpath2/processor/testsuite/userdefined/XercesQNameUserDefined.java" type="org.eclipse.wst.xml.xpath2.processor.testsuite.userdefined.XercesQNameUserDefined">
+        <filter id="576720909">
+            <message_arguments>
+                <message_argument value="QName"/>
+                <message_argument value="XercesQNameUserDefined"/>
+            </message_arguments>
+        </filter>
+    </resource>
+</component>
diff --git a/tests/org.eclipse.wst.xml.xpath2.wtptypes.tests/.settings/org.eclipse.jdt.core.prefs b/tests/org.eclipse.wst.xml.xpath2.wtptypes.tests/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..a120dee
--- /dev/null
+++ b/tests/org.eclipse.wst.xml.xpath2.wtptypes.tests/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,8 @@
+#Sun Jun 27 01:34:11 CEST 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
+org.eclipse.jdt.core.compiler.source=1.3
diff --git a/tests/org.eclipse.wst.xml.xpath2.wtptypes.tests/META-INF/MANIFEST.MF b/tests/org.eclipse.wst.xml.xpath2.wtptypes.tests/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..160349c
--- /dev/null
+++ b/tests/org.eclipse.wst.xml.xpath2.wtptypes.tests/META-INF/MANIFEST.MF
@@ -0,0 +1,19 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name
+Bundle-SymbolicName: org.eclipse.wst.xml.xpath2.wtptypes.tests;singleton:=true
+Bundle-Version: 2.0.0.qualifier
+Bundle-Vendor: %Bundle-Vendor
+Bundle-RequiredExecutionEnvironment: J2SE-1.4
+Require-Bundle: org.apache.xerces;bundle-version="[2.9.0,3.0.0)",
+ org.eclipse.wst.xml.xpath2.processor;bundle-version="[2.0,3.0.0)",
+ org.eclipse.wst.xml.xpath2.wtptypes;bundle-version="[2.0,3.0.0)",
+ org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
+ org.junit;bundle-version="3.8.2",
+ org.eclipse.wst.xml.core;bundle-version="[1.1.0,2.0.0)",
+ org.eclipse.wst.sse.core;bundle-version="[1.1.0,2.0.0)",
+ org.eclipse.core.resources;bundle-version="[3.4.0,4.0.0)"
+Export-Package: org.eclipse.wst.xml.xpath2.wtptypes.test
+Bundle-ActivationPolicy: lazy
+Bundle-ClassPath: .,
+ lib/xmlunit-1.2.jar
diff --git a/tests/org.eclipse.wst.xml.xpath2.wtptypes.tests/OSGI-INF/l10n/bundle.properties b/tests/org.eclipse.wst.xml.xpath2.wtptypes.tests/OSGI-INF/l10n/bundle.properties
new file mode 100644
index 0000000..e51d747
--- /dev/null
+++ b/tests/org.eclipse.wst.xml.xpath2.wtptypes.tests/OSGI-INF/l10n/bundle.properties
@@ -0,0 +1,3 @@
+#Properties file for org.eclipse.wst.xml.xpath2.wtptypes.tests
+Bundle-Vendor = Eclipse.org
+Bundle-Name = XPath 2 Processor Tests for WTP XML DOMs
\ No newline at end of file
diff --git a/tests/org.eclipse.wst.xml.xpath2.wtptypes.tests/ReadMe.txt b/tests/org.eclipse.wst.xml.xpath2.wtptypes.tests/ReadMe.txt
new file mode 100644
index 0000000..f31dcbd
--- /dev/null
+++ b/tests/org.eclipse.wst.xml.xpath2.wtptypes.tests/ReadMe.txt
@@ -0,0 +1,3 @@
+This plugin contains the tests resources and generated Junit tests for 
+testing the PsychoPath XPath 2.0 processor for compliance to the XPath
+2.0 test suite provided by the W3C. 
diff --git a/tests/org.eclipse.wst.xml.xpath2.wtptypes.tests/about.html b/tests/org.eclipse.wst.xml.xpath2.wtptypes.tests/about.html
new file mode 100644
index 0000000..ed30003
--- /dev/null
+++ b/tests/org.eclipse.wst.xml.xpath2.wtptypes.tests/about.html
@@ -0,0 +1,34 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<HTML>
+
+<head>
+<title>About</title>
+<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
+</head>
+
+<BODY lang="EN-US">
+
+<H3>About This Content</H3>
+
+<P>August, 2008</P>
+
+<H3>License</H3>
+
+<P>The Eclipse Foundation makes available all content in this plug-in 
+("Content"). Unless otherwise indicated below, the Content is provided to you 
+under the terms and conditions of the Eclipse Public License Version 1.0 
+("EPL"). A copy of the EPL is available at
+<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>. 
+For purposes of the EPL, "Program" will mean the Content.</P>
+
+<P>If you did not receive this Content directly from the Eclipse Foundation, the 
+Content is being redistributed by another party ("Redistributor") and different 
+terms and conditions may apply to your use of any object code in the Content. 
+Check the Redistributor’s license that was provided with the Content. If no such 
+license exists, contact the Redistributor. Unless otherwise indicated below, the 
+terms and conditions of the EPL still apply to any source code in the Content 
+and such source code may be obtained at
+<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
+
+</BODY>
+</HTML>
diff --git a/tests/org.eclipse.wst.xml.xpath2.wtptypes.tests/build.properties b/tests/org.eclipse.wst.xml.xpath2.wtptypes.tests/build.properties
new file mode 100644
index 0000000..e6de9a0
--- /dev/null
+++ b/tests/org.eclipse.wst.xml.xpath2.wtptypes.tests/build.properties
@@ -0,0 +1,8 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+               .,\
+               bin/,\
+               about.html,\
+               OSGI-INF/
+src.includes = about.html
diff --git a/tests/org.eclipse.wst.xml.xpath2.wtptypes.tests/lib/xmlunit-1.2.jar b/tests/org.eclipse.wst.xml.xpath2.wtptypes.tests/lib/xmlunit-1.2.jar
new file mode 100644
index 0000000..e61df62
--- /dev/null
+++ b/tests/org.eclipse.wst.xml.xpath2.wtptypes.tests/lib/xmlunit-1.2.jar
Binary files differ
diff --git a/tests/org.eclipse.wst.xml.xpath2.wtptypes.tests/pom.xml b/tests/org.eclipse.wst.xml.xpath2.wtptypes.tests/pom.xml
new file mode 100644
index 0000000..11f7887
--- /dev/null
+++ b/tests/org.eclipse.wst.xml.xpath2.wtptypes.tests/pom.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+
+	<parent>
+		<groupId>org.eclipse.wst.xml.xpath2</groupId>
+		<artifactId>org.eclipse.wst.xml.xpath2-parent</artifactId>
+		<version>2.0.0-SNAPSHOT</version>
+		<relativePath>../../development/athena/org.eclipse.wst.xml.xpath2.releng</relativePath>
+	</parent>
+
+	<artifactId>org.eclipse.wst.xml.xpath2.wtptypes.tests</artifactId>
+	<version>2.0.0-SNAPSHOT</version>
+	<packaging>eclipse-test-plugin</packaging>
+	<name>PsychoPath XPath 2.0 Processor: Tests for WTP type support</name>
+
+	<build>
+        	<plugins>
+		        <plugin>
+			    <groupId>org.sonatype.tycho</groupId>
+		            <artifactId>maven-osgi-test-plugin</artifactId>
+			    <version>${tycho-version}</version>
+				<configuration>
+		    		<testClass>org.eclipse.wst.xml.xpath2.wtptypes.test.AllXPath2TestsForWTP</testClass>
+				</configuration>
+	      		</plugin>
+		</plugins>
+	</build>	
+</project>
\ No newline at end of file
diff --git a/tests/org.eclipse.wst.xml.xpath2.wtptypes.tests/src/org/eclipse/wst/xml/xpath2/wtptypes/test/AbstractPsychoPathWTPTest.java b/tests/org.eclipse.wst.xml.xpath2.wtptypes.tests/src/org/eclipse/wst/xml/xpath2/wtptypes/test/AbstractPsychoPathWTPTest.java
new file mode 100644
index 0000000..d4280b9
--- /dev/null
+++ b/tests/org.eclipse.wst.xml.xpath2.wtptypes.tests/src/org/eclipse/wst/xml/xpath2/wtptypes/test/AbstractPsychoPathWTPTest.java
@@ -0,0 +1,632 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2010 Standards for Technology in Automotive Retail and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     David Carver (STAR) - initial API and implementation
+ *     Jin Mingjan - bug 262765 -  extractXPathExpression and getExpectedResults
+ *     Jesper S Moller - bug 283214 - fix IF THEN ELSE parsing and update grammars
+ *     Jesper S Moller - bug 283214 - fix XML result serialization
+ *     Jesper S Moller - bug 283404 - fixed locale  
+ *     Jesper S Moller - bug 281159 - fix document URIs and also filter XML namespace
+ *     Jesper S Moller - bug 275610 - Avoid big time and memory overhead for externals
+ *     Jesper Steen Moeller - bug 282096 - make test harness handle all string encoding
+ *     Jesper Steen Moller  - bug 280555 - Add pluggable collation support
+ *     Mukul Gandhi         - bug 338494 - prohibiting xpath expressions starting with / or // to be parsed.
+ *******************************************************************************/
+package org.eclipse.wst.xml.xpath2.wtptypes.test;
+
+import java.io.BufferedReader;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.UnsupportedEncodingException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.nio.charset.Charset;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import javax.xml.XMLConstants;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+
+import junit.framework.TestCase;
+
+import org.apache.xerces.jaxp.validation.XSGrammarPoolContainer;
+import org.apache.xerces.xni.grammars.Grammar;
+import org.apache.xerces.xni.grammars.XMLGrammarDescription;
+import org.apache.xerces.xni.grammars.XMLGrammarPool;
+import org.apache.xerces.xni.grammars.XSGrammar;
+import org.apache.xerces.xs.ElementPSVI;
+import org.apache.xerces.xs.XSConstants;
+import org.apache.xerces.xs.XSModel;
+import org.apache.xerces.xs.XSNamedMap;
+import org.apache.xerces.xs.XSObject;
+import org.apache.xerces.xs.XSSimpleTypeDefinition;
+import org.custommonkey.xmlunit.XMLTestCase;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.wst.sse.core.StructuredModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
+import org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel;
+import org.eclipse.wst.xml.xpath2.processor.DOMLoader;
+import org.eclipse.wst.xml.xpath2.processor.DOMLoaderException;
+import org.eclipse.wst.xml.xpath2.processor.DefaultDynamicContext;
+import org.eclipse.wst.xml.xpath2.processor.DefaultEvaluator;
+import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.Evaluator;
+import org.eclipse.wst.xml.xpath2.processor.JFlexCupParser;
+import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.StaticChecker;
+import org.eclipse.wst.xml.xpath2.processor.StaticError;
+import org.eclipse.wst.xml.xpath2.processor.StaticNameResolver;
+import org.eclipse.wst.xml.xpath2.processor.XPathParser;
+import org.eclipse.wst.xml.xpath2.processor.XPathParserException;
+import org.eclipse.wst.xml.xpath2.processor.XercesLoader;
+import org.eclipse.wst.xml.xpath2.processor.ast.XPath;
+import org.eclipse.wst.xml.xpath2.processor.function.FnFunctionLibrary;
+import org.eclipse.wst.xml.xpath2.processor.function.XSCtrLibrary;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.DocType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.QName;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.XSBoolean;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.userdefined.UserDefinedCtrLibrary;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.xerces.XercesTypeModel;
+import org.osgi.framework.Bundle;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.ls.DOMImplementationLS;
+import org.w3c.dom.ls.LSOutput;
+import org.w3c.dom.ls.LSSerializer;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.ext.EntityResolver2;
+
+public class AbstractPsychoPathWTPTest extends XMLTestCase {
+
+	protected Document domDoc = null;
+	protected Document domDoc2 = null;
+	protected Bundle bundle = null;
+
+	IDOMModel model = null;
+
+	private DynamicContext dynamicContext = null;
+	
+	private static final String INPUT_CONTEXT = "input-context";
+	private static final String INPUT_CONTEXT1 = "input-context1";
+	private static final String INPUT_CONTEXT2 = "input-context2";
+	// private static final String S_COMMENT1 = "(:";
+	private static final String S_COMMENT2 = ":)";
+	private static final String DECLARE_NAMESPACE = "declare namespace";
+	private static final String IMPORT_SCHEMA_NAMESPACE = "import schema namespace";
+	private static final String REGEX_DN = " namespace\\s+(\\w[-_\\w]*)\\s*=\\s*['\"]([^;]*)['\"];";
+
+	private static HashMap inputMap = new HashMap(3);
+
+	protected void setUp() throws Exception {
+		super.setUp();
+		bundle = Platform
+				.getBundle("org.w3c.xqts.testsuite");
+
+		
+		if (bundle == null) {
+			System.setProperty("javax.xml.parsers.DocumentBuilderFactory", "org.apache.xerces.jaxp.DocumentBuilderFactoryImpl");
+		}
+		System.setProperty("javax.xml.validation.SchemaFactory:http://www.w3.org/2001/XMLSchema","org.apache.xerces.jaxp.validation.XMLSchemaFactory");
+	}
+
+	protected void loadDOMDocument(URL fileURL) throws IOException,
+			DOMLoaderException {
+		InputStream is = testResolve(fileURL);
+		DOMLoader domloader = new XercesLoader();
+		domloader.set_validating(false);
+		domDoc = domloader.load(is);
+		domDoc.setDocumentURI(fileURL.toString());
+	}
+
+	private InputStream testResolve(URL url) throws IOException {
+		if (url.getProtocol().equals("http")) {
+			return AbstractPsychoPathWTPTest.class.getResourceAsStream("/org/eclipse/wst/xml/xpath2/processor/test/" + url.getFile());
+		} else {
+			return url.openStream();
+		}
+	}
+	
+	protected InputSource getTestSource(String systemId) {
+		if (systemId.startsWith("http://")) {
+			try {
+				URL u = new URL(systemId);
+				InputSource inputSource = new InputSource(testResolve(u));
+				inputSource.setSystemId(systemId);
+				return inputSource;
+			} catch (MalformedURLException e) {
+				throw new RuntimeException(e);
+			} catch (IOException e) {
+				throw new RuntimeException(e);
+			}
+		}
+		return new InputSource(systemId);
+	}
+	
+	protected EntityResolver makeTestResolver() {
+		return new EntityResolver2() {
+			
+			public InputSource resolveEntity(String publicId, String systemId) {
+				if (systemId.startsWith("http://")) {
+					URL u;
+					try {
+						u = new URL(systemId);
+						return new InputSource(testResolve(u));
+					} catch (MalformedURLException e) {
+						throw new RuntimeException(e);
+					} catch (IOException e) {
+						throw new RuntimeException(e);
+					}
+				}
+				return new InputSource(systemId);
+			}
+
+			public InputSource getExternalSubset(String publicId, String systemId)
+					throws SAXException, IOException {
+				return resolveEntity(publicId, systemId);
+			}
+
+			public InputSource resolveEntity(String name,
+                    String publicId,
+                    String baseURI,
+                    String systemId) throws SAXException, IOException {
+				return resolveEntity(publicId, systemId);
+			}
+			
+		};
+	}
+	
+	protected void loadDOMDocument(URL fileURL, Schema schema) throws IOException, DOMLoaderException {
+		InputStream is = testResolve(fileURL);
+		DOMLoader domloader = new XercesLoader(schema);
+		domloader.set_validating(false);
+		domDoc = domloader.load(is);
+		domDoc.setDocumentURI(fileURL.toString());
+		
+	}
+	
+	protected void load2DOMDocument(URL fileURL, URL fileURL2) throws IOException,
+			DOMLoaderException {
+		InputStream is = testResolve(fileURL);
+		InputStream is2 = testResolve(fileURL2);
+		
+		DOMLoader domloader = new XercesLoader();
+		domloader.set_validating(false);
+		domDoc = domloader.load(is);
+		domDoc.setDocumentURI(fileURL.toString());
+		domDoc2 = domloader.load(is2);
+		domDoc2.setDocumentURI(fileURL2.toString());
+		is.close();
+		is2.close();
+	}	
+
+	protected void tearDown() throws Exception {
+		super.tearDown();
+		domDoc = null;
+		domDoc2 = null;
+		dynamicContext = null;
+		if (model != null) {
+			model.releaseFromRead();
+		}
+	}
+
+	protected XSModel getGrammar() {
+		ElementPSVI rootPSVI = (ElementPSVI) domDoc.getDocumentElement();
+		XSModel schema = rootPSVI.getSchemaInformation();
+		return schema;
+	}
+
+	protected void loadDOMDocument(URL fileURL, URL schemaURL)
+			throws IOException, DOMLoaderException, SAXException {
+		InputStream is = testResolve(fileURL);
+		InputStream schemaIs = testResolve(schemaURL);
+		Schema jaxpSchema = getSchema(schemaIs);
+		DOMLoader domloader = new XercesLoader(jaxpSchema);
+		domloader.set_validating(false);
+		domDoc = domloader.load(is);
+	}
+	
+	
+
+	private Schema getSchema(InputStream schemaIs) throws SAXException {
+		SchemaFactory sf = SchemaFactory
+				.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+		Schema schema = sf.newSchema(new StreamSource(schemaIs));
+		return schema;
+	}
+
+	protected XSModel getGrammar(URL schemaURL) throws IOException,
+			SAXException {
+		InputStream schemaIs = testResolve(schemaURL);
+		SchemaFactory sf = SchemaFactory
+				.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+		Schema schema = sf.newSchema(new StreamSource(schemaIs));
+		XSGrammarPoolContainer poolContainer = (XSGrammarPoolContainer) schema;
+		XMLGrammarPool pool = poolContainer.getGrammarPool();
+		Grammar[] grammars = pool
+				.retrieveInitialGrammarSet(XMLGrammarDescription.XML_SCHEMA);
+
+		XSGrammar[] xsGrammars = new XSGrammar[grammars.length];
+		System.arraycopy(grammars, 0, xsGrammars, 0, grammars.length);
+
+		return xsGrammars[0].toXSModel(xsGrammars);
+	}
+
+	protected DefaultDynamicContext setupDynamicContext(XSModel schema) {
+		XercesTypeModel typeModel = schema != null ? new XercesTypeModel(schema) : null;
+		DefaultDynamicContext dc = new DefaultDynamicContext(typeModel);
+//		DefaultDynamicContext dc = new DefaultDynamicContext(schema, domDoc);
+		dynamicContext = dc;
+		
+		dc.add_namespace("xs", "http://www.w3.org/2001/XMLSchema");
+		dc.add_namespace("xsd", "http://www.w3.org/2001/XMLSchema");
+		dc.add_namespace("fn", "http://www.w3.org/2005/xpath-functions");
+		dc.add_namespace("xml", "http://www.w3.org/XML/1998/namespace");
+
+		dc.add_function_library(new FnFunctionLibrary());
+		dc.add_function_library(new XSCtrLibrary());
+		setupVariables(dc);
+		return dc;
+	}
+
+	protected DefaultDynamicContext setupDynamicContext2(TypeModel model) {
+		DefaultDynamicContext dc = new DefaultDynamicContext(model);
+		dynamicContext = dc;
+		
+		dc.add_namespace("xs", "http://www.w3.org/2001/XMLSchema");
+		dc.add_namespace("xsd", "http://www.w3.org/2001/XMLSchema");
+		dc.add_namespace("fn", "http://www.w3.org/2005/xpath-functions");
+		dc.add_namespace("xml", "http://www.w3.org/XML/1998/namespace");
+
+		dc.add_function_library(new FnFunctionLibrary());
+		dc.add_function_library(new XSCtrLibrary());
+		setupVariables(dc);
+		return dc;
+	}
+
+	protected void addXPathDefaultNamespace(String uri) {
+	   dynamicContext.add_namespace(null, uri);	
+	}
+
+	protected XPath compileXPath(DynamicContext dc, String xpath) throws XPathParserException, StaticError {
+		XPathParser xpp = new JFlexCupParser();
+		XPath path = xpp.parse(xpath);
+
+		StaticChecker name_check = new StaticNameResolver(dc);
+		name_check.check(path);
+		return path;
+	}
+	
+	protected XPath compileXPath(DynamicContext dc, String xpath, boolean isRootlessAccess) throws XPathParserException, StaticError {
+       XPathParser xpp = new JFlexCupParser();
+       XPath path = null; 
+       if (isRootlessAccess) {
+          path = xpp.parse(xpath, isRootlessAccess);
+       }
+       else {
+    	   path = xpp.parse(xpath); 
+       }
+       
+       StaticChecker name_check = new StaticNameResolver(dc);
+       name_check.check(path);
+       return path;
+    }
+
+	protected String getExpectedResult(String xqFile) {
+		return getExpectedResult(xqFile, true);
+	}
+
+	protected String getExpectedResultNoEscape(String xqFile) {
+		return getExpectedResult(xqFile, false);
+	}
+
+	protected String getExpectedResult(String xqFile, boolean unescape) {
+		String resultFile = xqFile;
+		//
+		if (resultFile.length() < 10) { // <9 enough? like XPST0001
+			return resultFile;
+		}
+		String content = "";
+		//
+		InputStream isrf;
+		try {
+			isrf = bundle.getEntry(resultFile).openStream();
+			BufferedReader rfreader = new BufferedReader(new InputStreamReader(
+					isrf, "UTF-8"));
+			// XXX:assume char buffer 2048 is long enough;1024 maybe enough
+			// Exception: Axes085, NodeTest003/04/05,...
+			int bufferLength = 2048;
+			if ((resultFile.indexOf("Axes085") != -1)
+					|| (resultFile.indexOf("NodeTest003") != -1)
+					|| (resultFile.indexOf("NodeTest004") != -1)
+					|| (resultFile.indexOf("NodeTest005") != -1)) {
+				bufferLength = 40000;
+			} else if (resultFile.indexOf("ForExpr013") != -1) {
+				bufferLength = 433500;
+			} else if (resultFile.indexOf("ForExpr016") != -1
+					|| (resultFile.indexOf("ReturnExpr011") != -1)
+					|| (resultFile.indexOf("sgml-queries-results-q1") != -1)
+					|| (resultFile.indexOf("sgml-queries-results-q2") != -1)) {
+				bufferLength = 10240;
+			}
+			char[] cbuf = new char[bufferLength];
+			int nByte = rfreader.read(cbuf);
+			assertTrue(resultFile, nByte < bufferLength);// assert nice buffer
+			// length
+
+			content = new String(cbuf).trim();
+			rfreader.close();
+			isrf.close();
+
+		} catch (IOException e) {
+			throw new RuntimeException("Can't load expected result from : " + xqFile, e);
+		}
+		if (unescape && content.contains("&")) return resolveCharacterReferences(content);
+		return content;
+	}
+
+	public String unwrapResult(String expectedResult, String elemName) {
+		return trimSurrounding(expectedResult, "<"+ elemName + ">", "</" + elemName + ">");
+	}
+	
+	protected String getExpectedResult(String resultFile, String elemName) {
+		return unwrapResult(getExpectedResult(resultFile), elemName);
+	}
+
+	public String extractXPathExpressionNoEscape(String xqFile, String inputFile) {
+		return extractXPathExpression(xqFile, inputFile, false);
+	}
+
+	public String extractXPathExpression(String xqFile, String inputFile) {
+		return extractXPathExpression(xqFile, inputFile, true);
+	}
+
+	public String extractXPathExpression(String xqFile, String inputFile, boolean unescape) {
+		// get the xpath2 expr from xq file, first
+		char[] cbuf = new char[2048];//
+		String content = null;
+		String xpath2Expr = null;
+
+		try {
+			URL entryUrl = bundle.getEntry(xqFile);
+			InputStream isxq = testResolve(entryUrl);
+			if (dynamicContext.base_uri().string_value() == null)
+				dynamicContext.set_base_uri(entryUrl.toString());
+			BufferedReader xqreader = new BufferedReader(new InputStreamReader(
+					isxq, Charset.forName("UTF-8")));
+			int nByte = xqreader.read(cbuf);
+			assertTrue(xqFile, nByte < 2048);
+			content = new String(cbuf).trim();
+			//
+			if (content.indexOf(INPUT_CONTEXT) != -1
+					&& content.indexOf(INPUT_CONTEXT1) == -1
+					&& content.indexOf(INPUT_CONTEXT2) == -1) {
+				inputMap.put(INPUT_CONTEXT, inputFile);
+			} else if (content.indexOf(INPUT_CONTEXT1) == -1) {
+				inputMap.put(INPUT_CONTEXT1, inputFile);
+			} else if (content.indexOf(INPUT_CONTEXT2) != -1) {
+				inputMap.put(INPUT_CONTEXT2, inputFile);
+			}
+			//	        
+			if (content.indexOf(DECLARE_NAMESPACE) != -1 || content.indexOf(IMPORT_SCHEMA_NAMESPACE) != -1) {
+				setupNamespace(content);
+			}
+			//
+			assertTrue(content.lastIndexOf(S_COMMENT2) != -1);// assert to get
+			xpath2Expr = content.substring(content.lastIndexOf(S_COMMENT2) + 2)
+					.trim();			
+			xqreader.close();
+			isxq.close();
+		} catch (IOException e) {
+			throw new RuntimeException("Can't extract XPath expression from XQuery file : " + xqFile, e);
+		}
+		if (unescape && xpath2Expr.contains("&")) {
+			return resolveCharacterReferences(xpath2Expr);
+		} else {
+			return xpath2Expr;
+		}
+	}
+
+	protected String extractXPathExpression(String xqFile, String inputFile,
+			String tagName) {
+		return unwrapQuery(extractXPathExpression(xqFile, inputFile), tagName);
+	}
+
+	protected String unwrapQuery(String xpath2Expr, String tag) {
+		String str = "<" + tag + ">";
+		String endStr = "</" + tag + ">";
+		String withoutTag = trimSurrounding(xpath2Expr, str, endStr);
+		if (withoutTag != xpath2Expr) {
+			// also trim off the braces { }
+			xpath2Expr = trimSurrounding(withoutTag, "{", "}");
+		}
+		return xpath2Expr;
+	}
+
+	protected String trimSurrounding(String xpath2Expr, String str, String endStr) {
+		int indexOfStart = xpath2Expr.indexOf(str);
+		int indexOfEnd = xpath2Expr.indexOf(endStr);
+		if (indexOfStart >= 0 && indexOfEnd >= 0) {
+			xpath2Expr = xpath2Expr.substring(indexOfStart + str.length(), indexOfEnd).trim(); 
+		}
+		return xpath2Expr;
+	}
+
+	protected void setupNamespace(String content) {
+		if (dynamicContext == null) return; // Can't set it up if nonexistent
+		Pattern p = Pattern.compile(REGEX_DN);
+		Matcher m = p.matcher(content);
+		while (m.find()) {
+			assertTrue(m.groupCount() == 2);//
+			dynamicContext.add_namespace(m.group(1), m.group(2));
+		}
+
+	}
+
+	protected DynamicContext setupVariables(DynamicContext dc) {
+		dc.add_variable(new QName("x"));
+		dc.add_variable(new QName("var"));
+		
+		if (domDoc != null) {
+			AnyType docType = new DocType(domDoc, dc.getTypeModel(domDoc));
+			dc.set_variable(new QName("input-context1"), docType);
+			dc.set_variable(new QName("input-context"), docType);
+			if (domDoc2 == null) {
+				dc.set_variable(new QName("input-context2"), docType);
+			} else {
+				dc.set_variable(new QName("input-context2"), (AnyType) new DocType(domDoc2, dc.getTypeModel(domDoc2)));
+			}
+		}
+		return dc;
+	}
+
+	protected String buildResultString(ResultSequence rs) {
+		String actual = new String();
+		Iterator iterator = rs.iterator();
+		while (iterator.hasNext()) {
+			AnyType anyType = (AnyType)iterator.next();
+			
+			actual = actual + anyType.string_value() + " ";
+		}
+
+		return actual.trim();
+	}
+	
+	protected String buildXMLResultString(ResultSequence rs) throws Exception {
+        DOMImplementationLS domLS = (DOMImplementationLS) domDoc.getImplementation().getFeature("LS", "3.0");
+        LSOutput outputText = domLS.createLSOutput();
+        LSSerializer serializer = domLS.createLSSerializer();
+        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
+        outputText.setByteStream(outputStream);
+        
+		String actual = new String();
+		Iterator iterator = rs.iterator();
+		boolean queueSpace = false;
+		while (iterator.hasNext()) {
+			AnyType aat = (AnyType)iterator.next();
+			if (aat instanceof NodeType) {
+				NodeType nodeType = (NodeType) aat;
+				Node node = nodeType.node_value();
+				serializer.write(node, outputText);
+				queueSpace = false;
+			} else {
+				if (queueSpace) outputText.getByteStream().write(32);
+				outputText.getByteStream().write(aat.string_value().getBytes("UTF-8"));
+				queueSpace = true;
+			}
+		}
+
+		actual = outputStream.toString("UTF-8");
+		actual = actual.replace("<?xml version=\"1.0\" encoding=\"UTF-8\"?>", "");
+		actual = actual.replace("<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>", "");
+		outputStream.close();
+		return actual.trim();
+	}
+	
+	protected String formatResultString(String resultFile) throws Exception {
+		DOMLoader domloader = new XercesLoader(null);
+		domloader.set_validating(false);
+		InputStream is = bundle.getEntry(resultFile).openStream();		
+		Document resultDoc = domloader.load(is);
+
+        DOMImplementationLS domLS = (DOMImplementationLS) resultDoc.getImplementation().getFeature("LS", "3.0");
+        LSSerializer serializer = domLS.createLSSerializer();
+        
+        String actual = serializer.writeToString(resultDoc.getDocumentElement());
+
+		actual = actual.replace("<?xml version=\"1.0\" encoding=\"UTF-16\"?>", "");
+		return actual.trim();
+	}
+
+	public Document load(java.net.URL url) throws Exception {
+		IModelManager modelManager = StructuredModelManager.getModelManager();
+		InputStream inStream = url.openStream();
+		if (inStream == null)
+			throw new FileNotFoundException("Can't file resource stream "
+					+ url.getFile());
+		model = (IDOMModel) modelManager.getModelForRead(url.toString(),
+				inStream, null);
+
+		return model.getDocument();
+	}
+
+	protected String removeIrrelevantNamespaces(String expectedResult) {
+		expectedResult = expectedResult.replaceAll(" xmlns:xml=\"http://www.w3.org/XML/1998/namespace\"", "");
+		expectedResult = expectedResult.replaceAll(" xmlns:foo=\"http://www.example.com/foo\"", "");
+	    expectedResult = expectedResult.replaceAll(" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"", "");
+		return expectedResult;
+	}
+
+	protected String resolveCharacterReferences(String xpath) {
+		String docText = "<doc>" + xpath + "</doc>";
+		InputStream is;
+		try {
+			is = new ByteArrayInputStream(docText.getBytes("UTF-8"));
+			DOMLoader domloader = new XercesLoader();
+			domloader.set_validating(false);
+			Document temp = domloader.load(is);
+			return temp.getDocumentElement().getFirstChild().getTextContent();
+		} catch (UnsupportedEncodingException e) {
+			throw new RuntimeException(e);
+		} catch (DOMLoaderException e) {
+			throw new RuntimeException(e);
+		}
+	}
+
+	protected void assertXPathTrue(String xpath, DynamicContext dc, Document domDoc) {
+		XSBoolean result = evaluateBoolXPath(xpath, dc, domDoc);
+		assertEquals(true, result.value());
+	}
+
+	protected XSBoolean evaluateBoolXPath(String xpath, DynamicContext dc, Document doc) {
+		return  (XSBoolean) evaluateSimpleXPath(xpath, dc, doc, XSBoolean.class);
+	}
+		
+	protected AnyType evaluateSimpleXPath(String xpath, DynamicContext dc, Document doc, Class resultClass) {
+		XPath path;
+		try {
+			path = compileXPath(dc, xpath);
+		}
+		catch (XPathParserException e) {
+			throw new RuntimeException("XPath parse: " + e.getMessage(), e);
+		}
+		catch (StaticError e) {
+			throw new RuntimeException("Static error: " + e.getMessage(), e);
+		}
+	
+		Evaluator eval = new DefaultEvaluator(dc, doc);
+		ResultSequence rs;
+		try {
+			rs = eval.evaluate(path);
+		}
+		catch (DynamicError e) {
+			throw new RuntimeException("Evaluation error: " + e.getMessage(), e);
+		}
+		assertEquals("Expected single result from \'" + xpath + "\'", 1, rs.size());
+		
+		AnyType result = rs.first();
+		assertTrue("Exected XPath result instanceof class " + resultClass.getSimpleName() + " from \'" + xpath + "\', got " + result.getClass(), resultClass.isInstance(result));
+		
+		return result;
+	}
+
+
+}
diff --git a/tests/org.eclipse.wst.xml.xpath2.wtptypes.tests/src/org/eclipse/wst/xml/xpath2/wtptypes/test/AllXPath2TestsForWTP.java b/tests/org.eclipse.wst.xml.xpath2.wtptypes.tests/src/org/eclipse/wst/xml/xpath2/wtptypes/test/AllXPath2TestsForWTP.java
new file mode 100644
index 0000000..d2117c3
--- /dev/null
+++ b/tests/org.eclipse.wst.xml.xpath2.wtptypes.tests/src/org/eclipse/wst/xml/xpath2/wtptypes/test/AllXPath2TestsForWTP.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Standards for Technology in Automotive Retail and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     David Carver - initial API and implementation
+ *     Mukul Ghandi - bug 273719
+ *     Jesper Moller - bug 281028 - Added test suites for min/max/sum/avg
+ *******************************************************************************/
+package org.eclipse.wst.xml.xpath2.wtptypes.test;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+public class AllXPath2TestsForWTP {
+
+	public static Test suite() {
+		TestSuite suite = new TestSuite(
+				"Test for org.eclipse.wst.xml.xpath2.wtptypes.test");
+		//$JUnit-BEGIN$
+		suite.addTestSuite(TestWTPDOMXPath2.class);
+		//$JUnit-END$
+		return suite;
+	}
+
+}
diff --git a/tests/org.eclipse.wst.xml.xpath2.wtptypes.tests/src/org/eclipse/wst/xml/xpath2/wtptypes/test/TestWTPDOMXPath2.java b/tests/org.eclipse.wst.xml.xpath2.wtptypes.tests/src/org/eclipse/wst/xml/xpath2/wtptypes/test/TestWTPDOMXPath2.java
new file mode 100644
index 0000000..69dc459
--- /dev/null
+++ b/tests/org.eclipse.wst.xml.xpath2.wtptypes.tests/src/org/eclipse/wst/xml/xpath2/wtptypes/test/TestWTPDOMXPath2.java
@@ -0,0 +1,2789 @@
+/*******************************************************************************
+ * Copyright (c) 2009, 2010 Standards for Technology in Automotive Retail and others
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     David Carver (STAR) - initial API and implementation 
+ *     Mukul Gandhi - bug 280798 - PsychoPath support for JDK 1.4
+ *******************************************************************************/
+
+package org.eclipse.wst.xml.xpath2.wtptypes.test;
+
+import java.net.URL;
+import java.util.Iterator;
+
+import org.apache.xerces.xs.XSModel;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
+import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.eclipse.wst.xml.xpath2.processor.DefaultEvaluator;
+import org.eclipse.wst.xml.xpath2.processor.DynamicContext;
+import org.eclipse.wst.xml.xpath2.processor.DynamicError;
+import org.eclipse.wst.xml.xpath2.processor.Evaluator;
+import org.eclipse.wst.xml.xpath2.processor.ResultSequence;
+import org.eclipse.wst.xml.xpath2.processor.StaticError;
+import org.eclipse.wst.xml.xpath2.processor.XPathParserException;
+import org.eclipse.wst.xml.xpath2.processor.ast.XPath;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType;
+import org.eclipse.wst.xml.xpath2.processor.internal.types.NodeType;
+import org.eclipse.wst.xml.xpath2.wtptypes.XsdDOMTypeProvider;
+
+public class TestWTPDOMXPath2 extends AbstractPsychoPathWTPTest {
+
+	public void testSimpleWTPDOM() throws Exception {
+		// Test for the fix, for xpathDefaultNamespace
+		bundle = Platform
+				.getBundle("org.eclipse.wst.xml.xpath2.processor.tests");
+
+		URL fileURL = bundle.getEntry("/bugTestFiles/bug273719.xml");
+		super.domDoc = load(fileURL);
+
+		// set up XPath default namespace in Dynamic Context
+		DynamicContext dc = setupDynamicContext(null);
+
+		String xpath = "string-length(x) > 2";
+		XPath path = compileXPath(dc, xpath);
+
+		Evaluator eval = new DefaultEvaluator(dc, domDoc);
+		ResultSequence rs = eval.evaluate(path);
+
+		AnyType result = rs.first();
+
+		String actual = result.string_value();
+
+		assertEquals("true", actual);
+	}
+
+	{
+//		DefaultTypeProviderRegistry.getInstance().register(DOMModelImpl.class, new XsdDOMTypeProvider());
+	}
+
+	public void testWTPDOMWithTypes() throws Exception {
+		// Test for the fix, for xpathDefaultNamespace
+		bundle = Platform
+				.getBundle("org.eclipse.wst.xml.xpath2.processor.tests");
+
+		URL fileURL = bundle.getEntry("/bugTestFiles/attrNodeTest.xml");
+		super.domDoc = load(fileURL);
+
+		// set up XPath default namespace in Dynamic Context
+		DynamicContext dc = setupDynamicContext2(new XsdDOMTypeProvider.XsdTypeModel((IDOMDocument)domDoc));
+		
+		assertXPathTrue("/Example/x[1] instance of element(*, x_Type)", dc, domDoc);
+		assertXPathTrue("not (/Example/x[1] instance of element(*, y_Type))", dc, domDoc);
+		assertXPathTrue("/Example/x instance of x_Type+", dc, domDoc);
+		assertXPathTrue("/Example/x instance of element(x, x_Type)+", dc, domDoc);
+		assertXPathTrue("not (/Example/x instance of element(z, x_Type)+)", dc, domDoc);
+		assertXPathTrue("/Example/x[2]/@mesg instance of mesg_Type", dc, domDoc);
+		assertXPathTrue("/Example/x[2]/@mesg instance of attribute(mesg, mesg_Type)", dc, domDoc);
+		assertXPathTrue("not (/Example/x[2]/@mesg instance of attribute(mesg, xs:integer))", dc, domDoc);
+		assertXPathTrue("not (/Example/x[2]/@mesg instance of attribute(cesc, mesg_Type))", dc, domDoc);
+		assertXPathTrue("/Example/y/@intAttr instance of attribute(intAttr, xs:integer)", dc, domDoc);
+	}
+
+	public void test_ForExpr005() throws Exception {
+		String inputFile = "/TestSources/fsx.xml";
+		String xqFile = "/Queries/XQuery/Expressions/FLWORExpr/ForExpr/ForExpr005.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/FLWORExpr/ForExpr/ForExpr005.xml";
+		String expectedResult = getExpectedResult(resultFile);
+
+		URL fileURL = bundle.getEntry(inputFile);
+		super.domDoc = load(fileURL);
+		DynamicContext dc = setupDynamicContext(null);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildXMLResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertXMLEqual("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// Type declaration containing multiple 'as' keywords.
+	public void test_ForExprType013() throws Exception {
+		String inputFile = "/TestSources/orderData.xml";
+		String xqFile = "/Queries/XQuery/Expressions/FLWORExpr/ForExprType/ForExprType013.xq";
+		String expectedResult = "XPST0003";
+		URL fileURL = bundle.getEntry(inputFile);
+		super.domDoc = load(fileURL);
+
+		DynamicContext dc = setupDynamicContext(null);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertEquals("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// No children for child::*.
+	public void test_Axes001_1() throws Exception {
+		String inputFile = "/TestSources/TreeTrunc.xml";
+		String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes001.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes001-1.txt";
+		String expectedResult = getExpectedResult(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		super.domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertEquals("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// Simple filter using data query from xml source and the "gt" operator.
+	public void test_filterexpressionhc1() throws Exception {
+		String inputFile = "/TestSources/works.xml";
+		String xqFile = "/Queries/XQuery/Expressions/SeqExpr/FilterExpr/filterexpressionhc1.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/SeqExpr/FilterExpr/filterexpressionhc1.txt";
+		String expectedResult = "<result>" + getExpectedResult(resultFile)
+				+ "</result>";
+		URL fileURL = bundle.getEntry(inputFile);
+		super.domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = "<result>" + buildXMLResultString(rs) + "</result>";
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertXMLEqual("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// No children, child::name gets none.
+	public void test_Axes002_1() throws Exception {
+		String inputFile = "/TestSources/TreeTrunc.xml";
+		String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes002.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes002-1.txt";
+		String expectedResult = getExpectedResult(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertEquals("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// Evaluates abbreviated syntax, "hours". Selects the "hours" element
+	// children of the context node.
+	public void test_abbreviatedSyntax_1() throws Exception {
+		String inputFile = "/TestSources/works-mod.xml";
+		String xqFile = "/Queries/XQuery/Expressions/PathExpr/AbbrAxes/abbreviatedSyntax-1.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/PathExpr/AbbrAxes/abbreviatedSyntax-1.txt";
+		String expectedResult = getExpectedResult(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildXMLResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertEquals("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// Evaluates abbreviated syntax, "text()". Selects all text node children of
+	// the context node.
+	public void test_abbreviatedSyntax_2() throws Exception {
+		String inputFile = "/TestSources/works-mod.xml";
+		String xqFile = "/Queries/XQuery/Expressions/PathExpr/AbbrAxes/abbreviatedSyntax-2.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/PathExpr/AbbrAxes/abbreviatedSyntax-2.txt";
+		String expectedResult = getExpectedResult(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertEquals("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// Evaluates abbreviated syntax, "@name". Selects the name attribute of the
+	// context node.
+	public void test_abbreviatedSyntax_3() throws Exception {
+		String inputFile = "/TestSources/works-mod.xml";
+		String xqFile = "/Queries/XQuery/Expressions/PathExpr/AbbrAxes/abbreviatedSyntax-3.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/PathExpr/AbbrAxes/abbreviatedSyntax-3.txt";
+		String expectedResult = formatResultString(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildXMLResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertXMLEqual("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// Evaluates abbreviated syntax, "employee[1]". Selects the first employee
+	// child of the context node.
+	public void test_abbreviatedSyntax_5() throws Exception {
+		String inputFile = "/TestSources/works-mod.xml";
+		String xqFile = "/Queries/XQuery/Expressions/PathExpr/AbbrAxes/abbreviatedSyntax-5.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/PathExpr/AbbrAxes/abbreviatedSyntax-5.txt";
+		String expectedResult = formatResultString(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildXMLResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertXMLEqual("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// Evaluation of a Node expression With the operands/operator set with the
+	// following format: empty Sequence is Single Node Element.
+	public void test_nodeexpression3() throws Exception {
+		String inputFile = "/TestSources/works.xml";
+		String xqFile = "/Queries/XQuery/Expressions/Operators/NodeOp/NodeSame/nodeexpression3.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/Operators/NodeOp/NodeSame/nodeexpression3.txt";
+		String expectedResult = getExpectedResult(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertEquals("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// Evaluation of a Node expression With the operands/operator set with the
+	// following format: empty Sequence is Sequence of single Element Node.
+	public void test_nodeexpression4() throws Exception {
+		String inputFile = "/TestSources/staff.xml";
+		String xqFile = "/Queries/XQuery/Expressions/Operators/NodeOp/NodeSame/nodeexpression4.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/Operators/NodeOp/NodeSame/nodeexpression4.txt";
+		String expectedResult = getExpectedResult(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertEquals("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// Evaluation of a Node expression With the operands/operator set with the
+	// following format: Single Node Element is empty Sequence.
+	public void test_nodeexpression9() throws Exception {
+		String inputFile = "/TestSources/works.xml";
+		String xqFile = "/Queries/XQuery/Expressions/Operators/NodeOp/NodeSame/nodeexpression9.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/Operators/NodeOp/NodeSame/nodeexpression9.txt";
+		String expectedResult = getExpectedResult(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertEquals("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// Evaluation of a Node expression With the operands/operator set with the
+	// following format: Single Node Element is Single Node Element.
+	public void test_nodeexpression11() throws Exception {
+		String inputFile = "/TestSources/works.xml";
+		String xqFile = "/Queries/XQuery/Expressions/Operators/NodeOp/NodeSame/nodeexpression11.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/Operators/NodeOp/NodeSame/nodeexpression11.txt";
+		String expectedResult = getExpectedResult(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertEquals("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// Evaluation of a simple predicate with a "true" value (uses "fn:true").
+	public void test_predicates_1() throws Exception {
+		String inputFile = "/TestSources/atomicns.xml";
+		String xqFile = "/Queries/XQuery/Expressions/PathExpr/Predicates/predicates-1.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Predicates/predicates-1.txt";
+		String expectedResult = getExpectedResult(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildXMLResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertEquals("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// Evaluation of a simple predicate with a "false" value (uses "fn:false").
+	// Use "fn:count" to avoid empty file.
+	public void test_predicates_2() throws Exception {
+		String inputFile = "/TestSources/atomicns.xml";
+		String xqFile = "/Queries/XQuery/Expressions/PathExpr/Predicates/predicates-2.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Predicates/predicates-2.txt";
+		String expectedResult = getExpectedResult(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertEquals("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// Evaluation of a simple predicate with a "true" value (uses "fn:true" and
+	// fn:not()).
+	public void test_predicates_3() throws Exception {
+		String inputFile = "/TestSources/atomicns.xml";
+		String xqFile = "/Queries/XQuery/Expressions/PathExpr/Predicates/predicates-3.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Predicates/predicates-3.txt";
+		String expectedResult = getExpectedResult(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildXMLResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertEquals("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// Evaluation of a simple predicate set to a boolean expression ("and"
+	// operator), returns true.
+	public void test_predicates_4() throws Exception {
+		String inputFile = "/TestSources/atomicns.xml";
+		String xqFile = "/Queries/XQuery/Expressions/PathExpr/Predicates/predicates-4.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Predicates/predicates-4.txt";
+		String expectedResult = getExpectedResult(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildXMLResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertEquals("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// Evaluation of a simple predicate set to a boolean expression ("or"
+	// operator), return true.
+	public void test_predicates_5() throws Exception {
+		String inputFile = "/TestSources/atomicns.xml";
+		String xqFile = "/Queries/XQuery/Expressions/PathExpr/Predicates/predicates-5.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Predicates/predicates-5.txt";
+		String expectedResult = getExpectedResult(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildXMLResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertEquals("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// Evaluation of a simple predicate set to a boolean expression ("and"
+	// operator), returns false. Use "fn:count" to avoid empty file.
+	public void test_predicates_6() throws Exception {
+		String inputFile = "/TestSources/atomicns.xml";
+		String xqFile = "/Queries/XQuery/Expressions/PathExpr/Predicates/predicates-6.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Predicates/predicates-6.txt";
+		String expectedResult = getExpectedResult(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertEquals("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// No children of any kind, elem//child::* gets none.
+	public void test_Axes074_1() throws Exception {
+		String inputFile = "/TestSources/TreeTrunc.xml";
+		String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes074.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes074-1.txt";
+		String expectedResult = getExpectedResult(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertEquals("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// elem//child::* gets nothing when no element children.
+	public void test_Axes074_2() throws Exception {
+		String inputFile = "/TestSources/Tree1Text.xml";
+		String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes074.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes074-2.txt";
+		String expectedResult = getExpectedResult(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertEquals("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// elem//child::* gets 1 child element.
+	public void test_Axes074_3() throws Exception {
+		String inputFile = "/TestSources/Tree1Child.xml";
+		String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes074.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes074-3.txt";
+		String expectedResult = getExpectedResult(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertEquals("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// elem//child::* gets several nodes.
+	public void test_Axes074_4() throws Exception {
+		String inputFile = "/TestSources/TreeRepeat.xml";
+		String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes074.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes074-4.txt";
+		String expectedResult = getExpectedResult(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertEquals("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// elem//child::name gets nothing when no sub-tree.
+	public void test_Axes075_1() throws Exception {
+		String inputFile = "/TestSources/TreeTrunc.xml";
+		String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes075.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes075-1.txt";
+		String expectedResult = getExpectedResult(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertEquals("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// elem//child::name gets none when no elements have that name.
+	public void test_Axes075_2() throws Exception {
+		String inputFile = "/TestSources/Tree1Child.xml";
+		String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes075.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes075-2.txt";
+		String expectedResult = getExpectedResult(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertEquals("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// elem//child::name gets the 1 descendant of that name.
+	public void test_Axes075_3() throws Exception {
+		String inputFile = "/TestSources/TreeCompass.xml";
+		String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes075.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes075-3.txt";
+		String expectedResult = getExpectedResult(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertEquals("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// elem//child::name gets several elements.
+	public void test_Axes075_4() throws Exception {
+		String inputFile = "/TestSources/TreeStack.xml";
+		String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes075.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes075-4.txt";
+		String expectedResult = getExpectedResult(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertEquals("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// No children, elem//child::node() gets none.
+	public void test_Axes076_1() throws Exception {
+		String inputFile = "/TestSources/TreeTrunc.xml";
+		String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes076.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes076-1.txt";
+		String expectedResult = getExpectedResult(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertEquals("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// elem//child::node() gets 1 child element.
+	public void test_Axes076_2() throws Exception {
+		String inputFile = "/TestSources/Tree1Child.xml";
+		String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes076.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes076-2.txt";
+		String expectedResult = getExpectedResult(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertEquals("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// elem//child::node() gets 1 child text node.
+	public void test_Axes076_3() throws Exception {
+		String inputFile = "/TestSources/Tree1Text.xml";
+		String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes076.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes076-3.txt";
+		String expectedResult = getExpectedResult(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertEquals("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// Several children for elem//child::node().
+	public void test_Axes076_4() throws Exception {
+		String inputFile = "/TestSources/TreeRepeat.xml";
+		String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes076.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes076-4.txt";
+		String expectedResult = getExpectedResult(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertEquals("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// No children for elem//*.
+	public void test_Axes077_1() throws Exception {
+		String inputFile = "/TestSources/TreeTrunc.xml";
+		String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes077.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes077-1.txt";
+		String expectedResult = getExpectedResult(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertEquals("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// 1 child for elem//*.
+	public void test_Axes077_2() throws Exception {
+		String inputFile = "/TestSources/Tree1Child.xml";
+		String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes077.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes077-2.txt";
+		String expectedResult = getExpectedResult(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertEquals("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// Many children for elem//*.
+	public void test_Axes077_3() throws Exception {
+		String inputFile = "/TestSources/TreeRepeat.xml";
+		String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes077.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes077-3.txt";
+		String expectedResult = getExpectedResult(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertEquals("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// elem//name gets none when there are no children.
+	public void test_Axes078_1() throws Exception {
+		String inputFile = "/TestSources/TreeTrunc.xml";
+		String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes078.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes078-1.txt";
+		String expectedResult = getExpectedResult(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertEquals("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// elem//name gets none when no elements have that name.
+	public void test_Axes078_2() throws Exception {
+		String inputFile = "/TestSources/Tree1Child.xml";
+		String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes078.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes078-2.txt";
+		String expectedResult = getExpectedResult(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertEquals("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// elem//name gets the 1 descendant of that name.
+	public void test_Axes078_3() throws Exception {
+		String inputFile = "/TestSources/TreeCompass.xml";
+		String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes078.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes078-3.txt";
+		String expectedResult = getExpectedResult(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertEquals("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// elem//name gets several elements.
+	public void test_Axes078_4() throws Exception {
+		String inputFile = "/TestSources/TreeStack.xml";
+		String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes078.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes078-4.txt";
+		String expectedResult = getExpectedResult(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertEquals("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// No children, elem//node() gets none.
+	public void test_Axes079_1() throws Exception {
+		String inputFile = "/TestSources/TreeTrunc.xml";
+		String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes079.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes079-1.txt";
+		String expectedResult = getExpectedResult(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertEquals("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// elem//node() gets 1 child element.
+	public void test_Axes079_2() throws Exception {
+		String inputFile = "/TestSources/Tree1Child.xml";
+		String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes079.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes079-2.txt";
+		String expectedResult = getExpectedResult(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertEquals("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// elem//node() gets 1 child text node.
+	public void test_Axes079_3() throws Exception {
+		String inputFile = "/TestSources/Tree1Text.xml";
+		String xqFile = "/Queries/XQuery/Expressions/PathExpr/Steps/Axes/Axes079.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/PathExpr/Steps/Axes/Axes079-3.txt";
+		String expectedResult = getExpectedResult(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertEquals("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// Evaluation of a Node expression With the operands/operator set with the
+	// following format: empty Sequence "<<" empty Sequence.
+	public void test_nodeexpression17() throws Exception {
+		String inputFile = "/TestSources/emptydoc.xml";
+		String xqFile = "/Queries/XQuery/Expressions/Operators/NodeOp/NodeBefore/nodeexpression17.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/Operators/NodeOp/NodeBefore/nodeexpression17.txt";
+		String expectedResult = getExpectedResult(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertEquals("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// Evaluation of a Node expression With the operands/operator set with the
+	// following format: empty Sequence "<<" Single Node Element.
+	public void test_nodeexpression19() throws Exception {
+		String inputFile = "/TestSources/works.xml";
+		String xqFile = "/Queries/XQuery/Expressions/Operators/NodeOp/NodeBefore/nodeexpression19.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/Operators/NodeOp/NodeBefore/nodeexpression19.txt";
+		String expectedResult = getExpectedResult(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertEquals("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// Evaluation of a Node expression With the operands/operator set with the
+	// following format: empty Sequence "<<" Sequence of single Element Node.
+	public void test_nodeexpression20() throws Exception {
+		String inputFile = "/TestSources/staff.xml";
+		String xqFile = "/Queries/XQuery/Expressions/Operators/NodeOp/NodeBefore/nodeexpression20.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/Operators/NodeOp/NodeBefore/nodeexpression20.txt";
+		String expectedResult = getExpectedResult(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertEquals("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// Evaluation of a Node expression With the operands/operator set with the
+	// following format: Single Node Element "<<" empty Sequence.
+	public void test_nodeexpression25() throws Exception {
+		String inputFile = "/TestSources/works.xml";
+		String xqFile = "/Queries/XQuery/Expressions/Operators/NodeOp/NodeBefore/nodeexpression25.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/Operators/NodeOp/NodeBefore/nodeexpression25.txt";
+		String expectedResult = getExpectedResult(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertEquals("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// Evaluation of a Node expression With the operands/operator set with the
+	// following format: Single Node Element "<<" Single Node Element.
+	public void test_nodeexpression27() throws Exception {
+		String inputFile = "/TestSources/works.xml";
+		String xqFile = "/Queries/XQuery/Expressions/Operators/NodeOp/NodeBefore/nodeexpression27.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/Operators/NodeOp/NodeBefore/nodeexpression27.txt";
+		String expectedResult = getExpectedResult(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertEquals("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// Evaluates unabbreviated syntax - child::empnum - select empnum children
+	// of the context node.
+	public void test_unabbreviatedSyntax_1() throws Exception {
+		String inputFile = "/TestSources/works-mod.xml";
+		String xqFile = "/Queries/XQuery/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-1.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-1.txt";
+		String expectedResult = getExpectedResult(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildXMLResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertEquals("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// Evaluates unabbreviated syntax - child::* - select all element children
+	// of the context node.
+	public void test_unabbreviatedSyntax_2() throws Exception {
+		String inputFile = "/TestSources/works-mod.xml";
+		String xqFile = "/Queries/XQuery/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-2.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-2.txt";
+		String expectedResult = getExpectedResult(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildXMLResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertEquals("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// Evaluates unabbreviated syntax - child::text() - select all text node
+	// children of the context node.
+	public void test_unabbreviatedSyntax_3() throws Exception {
+		String inputFile = "/TestSources/works-mod.xml";
+		String xqFile = "/Queries/XQuery/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-3.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-3.txt";
+		String expectedResult = getExpectedResult(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertEquals("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+	
+	// Evaluates unabbreviated syntax - parent::node() - Selects the parent of
+	// the context node.
+	public void test_unabbreviatedSyntax_8() throws Exception {
+		String inputFile = "/TestSources/works-mod.xml";
+		String xqFile = "/Queries/XQuery/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-8.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-8.txt";
+		String expectedResult = formatResultString(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildXMLResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertXMLEqual("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// Evaluates unabbreviated syntax - descendant::empnum - Selects the
+	// "empnum" descendants of the context node.
+	public void test_unabbreviatedSyntax_9() throws Exception {
+		String inputFile = "/TestSources/works-mod.xml";
+		String xqFile = "/Queries/XQuery/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-9.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-9.txt";
+		String expectedResult = getExpectedResult(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildXMLResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertEquals("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// Evaluates unabbreviated syntax - descendant-or-self::employee - Selects
+	// all the "employee" descendant of the context node (selects employee, if
+	// the context node is "employee").
+	public void test_unabbreviatedSyntax_12() throws Exception {
+		String inputFile = "/TestSources/works-mod.xml";
+		String xqFile = "/Queries/XQuery/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-12.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-12.txt";
+		String expectedResult = formatResultString(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildXMLResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertXMLEqual("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// Evaluates unabbreviated syntax - self::employee - Selects the context
+	// node, if it is an "employee" element, otherwise returns empty sequence.
+	// This test retuns an "employee" element.
+	public void test_unabbreviatedSyntax_13() throws Exception {
+		String inputFile = "/TestSources/works-mod.xml";
+		String xqFile = "/Queries/XQuery/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-13.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-13.txt";
+		String expectedResult = formatResultString(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildXMLResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertXMLEqual("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// Evaluates unabbreviated syntax - self::hours - Selects the context node,
+	// if it is an "hours" element, otherwise returns empty sequence. This test
+	// retuns the empty sequence.
+	public void test_unabbreviatedSyntax_14() throws Exception {
+		String inputFile = "/TestSources/works-mod.xml";
+		String xqFile = "/Queries/XQuery/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-14.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-14.txt";
+		String expectedResult = getExpectedResult(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertEquals("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// Evaluates unabbreviated syntax child::employee/descendant:empnum- Selects
+	// the empnum element descendants of the employee element children of the
+	// context node.
+	public void test_unabbreviatedSyntax_15() throws Exception {
+		String inputFile = "/TestSources/works-mod.xml";
+		String xqFile = "/Queries/XQuery/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-15.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-15.txt";
+		String expectedResult = getExpectedResult(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildXMLResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertEquals("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// Evaluates unabbreviated syntax child::*/child:pnum)- Selects the pnum
+	// grandchildren of the context node.
+	public void test_unabbreviatedSyntax_16() throws Exception {
+		String inputFile = "/TestSources/works-mod.xml";
+		String xqFile = "/Queries/XQuery/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-16.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-16.txt";
+		String expectedResult = getExpectedResult(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildXMLResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertEquals("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// Evaluates unabbreviated syntax. Evaluate /descendant::pnum - Selects all
+	// the pnum elements in the same document as the context node.
+	public void test_unabbreviatedSyntax_18() throws Exception {
+		String inputFile = "/TestSources/works-mod.xml";
+		String xqFile = "/Queries/XQuery/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-18.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-18.txt";
+		String expectedResult = getExpectedResult(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildXMLResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertEquals("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// Evaluates unabbreviated syntax. Evaluate
+	// /descendant::employee/child::pnum selects all the pnum elements that have
+	// an "employee" parent and that are in the same document as the context
+	// node.
+	public void test_unabbreviatedSyntax_19() throws Exception {
+		String inputFile = "/TestSources/works-mod.xml";
+		String xqFile = "/Queries/XQuery/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-19.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-19.txt";
+		String expectedResult = getExpectedResult(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildXMLResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertEquals("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// Evaluates unabbreviated syntax. Evaluate
+	// "child::employee[fn:position() = 1]". Selects the first employee child of
+	// the context node.
+	public void test_unabbreviatedSyntax_20() throws Exception {
+		String inputFile = "/TestSources/works-mod.xml";
+		String xqFile = "/Queries/XQuery/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-20.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-20.txt";
+		String expectedResult = formatResultString(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildXMLResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertXMLEqual("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// Evaluates unabbreviated syntax. Evaluate
+	// "child::employee[fn:position() = fn:last()]". Selects the last "employee"
+	// child of the context node.
+	public void test_unabbreviatedSyntax_21() throws Exception {
+		String inputFile = "/TestSources/works-mod.xml";
+		String xqFile = "/Queries/XQuery/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-21.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-21.txt";
+		String expectedResult = formatResultString(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildXMLResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertXMLEqual("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// Evaluates unabbreviated syntax. Evaluate
+	// "child::employee[fn:position() = fn:last()-1]. Selects the previous to the last one "employee"
+	// child of the context node.
+	public void test_unabbreviatedSyntax_22() throws Exception {
+		String inputFile = "/TestSources/works-mod.xml";
+		String xqFile = "/Queries/XQuery/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-22.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-22.txt";
+		String expectedResult = formatResultString(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildXMLResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertXMLEqual("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// Evaluates unabbreviated syntax. Evaluate
+	// "child::hours[fn:position() > 1]". Selects all the para children of the
+	// context node other than the first "hours" child of the context node.
+	public void test_unabbreviatedSyntax_23() throws Exception {
+		String inputFile = "/TestSources/works-mod.xml";
+		String xqFile = "/Queries/XQuery/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-23.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-23.txt";
+		String expectedResult = getExpectedResult(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildXMLResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertEquals("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// Evaluates unabbreviated syntax. Evaluate
+	// "/descendant::employee[fn:position() = 12]". Selects the twelfth employee
+	// element in the document containing the context node.
+	public void test_unabbreviatedSyntax_26() throws Exception {
+		String inputFile = "/TestSources/works-mod.xml";
+		String xqFile = "/Queries/XQuery/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-26.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-26.txt";
+		String expectedResult = formatResultString(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildXMLResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertXMLEqual("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// Evaluates unabbreviated syntax. Evaluate
+	// "/child::works/child::employee[fn:position() = 5]/child::hours[fn:position() = 2]".
+	// Selects the second "hours" of the fifth "employee" of the "works" whose
+	// parent is the document node that contains the context node.
+	public void test_unabbreviatedSyntax_27() throws Exception {
+		String inputFile = "/TestSources/works-mod.xml";
+		String xqFile = "/Queries/XQuery/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-27.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-27.txt";
+		String expectedResult = getExpectedResult(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildXMLResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertXMLEqual("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// Evaluates unabbreviated syntax. Evaluate
+	// "child::employee[attribute::name eq "Jane Doe 11"]". Selects all
+	// "employee" children of the context node that have a "name" attribute with
+	// value "Jane Doe 11".
+	public void test_unabbreviatedSyntax_28() throws Exception {
+		String inputFile = "/TestSources/works-mod.xml";
+		String xqFile = "/Queries/XQuery/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-28.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-28.txt";
+		String expectedResult = formatResultString(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildXMLResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertXMLEqual("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// Evaluates unabbreviated syntax. Evaluate
+	// "child::employee[attribute::gender eq 'female'][fn:position() = 5]".
+	// Selects the fifth employee child of the context node that has a gender
+	// attribute with value "female".
+	public void test_unabbreviatedSyntax_29() throws Exception {
+		String inputFile = "/TestSources/works-mod.xml";
+		String xqFile = "/Queries/XQuery/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-29.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-29.txt";
+		String expectedResult = formatResultString(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildXMLResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertXMLEqual("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// Evaluates unabbreviated syntax. Evaluate
+	// "child::employee[child::empnum = 'E3']". Selects the employee children of
+	// the context node that have one or more empnum children whose typed value
+	// is equal to the string "E3".
+	public void test_unabbreviatedSyntax_30() throws Exception {
+		String inputFile = "/TestSources/works-mod.xml";
+		String xqFile = "/Queries/XQuery/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-30.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-30.txt";
+		String expectedResult = "<result>" + getExpectedResult(resultFile)
+				+ "</result>";
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = "<result>" + buildXMLResultString(rs) + "</result>";
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertXMLEqual("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// Evaluates unabbreviated syntax. Evaluate
+	// "child::employee[child::status]". Selects the employee children of the
+	// context node that have one or more status children.
+	public void test_unabbreviatedSyntax_31() throws Exception {
+		String inputFile = "/TestSources/works-mod.xml";
+		String xqFile = "/Queries/XQuery/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-31.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-31.txt";
+		String expectedResult = formatResultString(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildXMLResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertXMLEqual("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// Evaluates unabbreviated syntax. Evaluate
+	// "child::*[self::pnum or self::empnum]". Selects the pnum and empnum
+	// children of the context node.
+	public void test_unabbreviatedSyntax_32() throws Exception {
+		String inputFile = "/TestSources/works-mod.xml";
+		String xqFile = "/Queries/XQuery/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-32.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-32.txt";
+		String expectedResult = getExpectedResult(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildXMLResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertEquals("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	// Evaluates unabbreviated syntax. Evaluate
+	// "child::*[self::empnum or self::pnum][fn:position() = fn:last()]".
+	// Selects the last empnum or pnum child of the context node.
+	public void test_unabbreviatedSyntax_33() throws Exception {
+		String inputFile = "/TestSources/works-mod.xml";
+		String xqFile = "/Queries/XQuery/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-33.xq";
+		String resultFile = "/ExpectedTestResults/Expressions/PathExpr/UnabbrAxes/unabbreviatedSyntax-33.txt";
+		String expectedResult = getExpectedResult(resultFile);
+		URL fileURL = bundle.getEntry(inputFile);
+		domDoc = load(fileURL);
+
+		// Get XML Schema Information for the Document
+		XSModel schema = null;
+
+		DynamicContext dc = setupDynamicContext(schema);
+
+		String xpath = extractXPathExpression(xqFile, inputFile);
+		String actual = null;
+		try {
+			XPath path = compileXPath(dc, xpath);
+
+			Evaluator eval = new DefaultEvaluator(dc, domDoc);
+			ResultSequence rs = eval.evaluate(path);
+
+			actual = buildXMLResultString(rs);
+
+		} catch (XPathParserException ex) {
+			actual = ex.code();
+		} catch (StaticError ex) {
+			actual = ex.code();
+		} catch (DynamicError ex) {
+			actual = ex.code();
+		}
+
+		assertXMLEqual("XPath Result Error " + xqFile + ":", expectedResult,
+				actual);
+
+	}
+
+	  //FLWOR expression returns a constructed sequence.
+	   public void test_ReturnExpr011() throws Exception {
+	      String inputFile = "/TestSources/fsx.xml";
+	      String xqFile = "/Queries/XQuery/Expressions/FLWORExpr/ReturnExpr/ReturnExpr011.xq";
+	      String resultFile = "/ExpectedTestResults/Expressions/FLWORExpr/ReturnExpr/ReturnExpr011.xml";
+	      String expectedResult = getExpectedResult(resultFile);
+	      URL fileURL = bundle.getEntry(inputFile);
+	      domDoc = load(fileURL);
+	      
+	      // Get XML Schema Information for the Document
+	      XSModel schema = null;
+
+	      DynamicContext dc = setupDynamicContext(schema);
+
+	      String xpath = extractXPathExpression(xqFile, inputFile);
+	      String actual = null;
+	      try {
+		   	  XPath path = compileXPath(dc, xpath);
+		
+		      Evaluator eval = new DefaultEvaluator(dc, domDoc);
+		      ResultSequence rs = eval.evaluate(path);
+	         
+	          actual = buildXMLResultString(rs);
+		
+	      } catch (XPathParserException ex) {
+	    	 actual = ex.code();
+	      } catch (StaticError ex) {
+	         actual = ex.code();
+	      } catch (DynamicError ex) {
+	         actual = ex.code();
+	      }
+
+	      assertEquals("XPath Result Error " + xqFile + ":", expectedResult, actual);
+	        
+
+	   }
+	
+	protected String buildXMLResultString(ResultSequence rs) throws Exception {
+		Iterator iterator = rs.iterator();
+		StringBuffer buffer = new StringBuffer();
+		while (iterator.hasNext()) {
+			AnyType aat = (AnyType)iterator.next();
+			if (aat instanceof NodeType) {
+				NodeType nodeType = (NodeType) aat;
+				IDOMNode node = (IDOMNode) nodeType.node_value();
+				buffer = buffer.append(node.getSource());
+			} else {
+				buffer = buffer.append(aat.string_value());
+			}
+		}
+
+		return buffer.toString();
+	}
+
+}
diff --git a/tests/org.eclipse.wst.xml.xpath2.wtptypes.tests/src/org/eclipse/wst/xml/xpath2/wtptypes/test/xml/note.xml b/tests/org.eclipse.wst.xml.xpath2.wtptypes.tests/src/org/eclipse/wst/xml/xpath2/wtptypes/test/xml/note.xml
new file mode 100644
index 0000000..d4966d1
--- /dev/null
+++ b/tests/org.eclipse.wst.xml.xpath2.wtptypes.tests/src/org/eclipse/wst/xml/xpath2/wtptypes/test/xml/note.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<note>
+	<to>Self</to>
+	<from>XPath2 Developers</from>
+	<heading>Reminder</heading>
+	<body>Don't reference external entities in tests</body>
+</note>
\ No newline at end of file