You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2018/05/04 09:03:06 UTC

[05/24] jena git commit: JENA-1537: Remove dependency on Xerces. Import needed code

http://git-wip-us.apache.org/repos/asf/jena/blob/c9a7e646/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/ItemPSVI.java
----------------------------------------------------------------------
diff --git a/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/ItemPSVI.java b/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/ItemPSVI.java
new file mode 100644
index 0000000..d1c72c0
--- /dev/null
+++ b/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/ItemPSVI.java
@@ -0,0 +1,209 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.ext.xerces.xs;
+
+/**
+ *  Represents an abstract PSVI item for an element or an attribute 
+ * information item.
+ */
+public interface ItemPSVI {
+    /**
+     * Validity value indicating that validation has either not been performed 
+     * or that a strict assessment of validity could not be performed. 
+     */
+    public static final short VALIDITY_NOTKNOWN         = 0;
+    /**
+     * Validity value indicating that validation has been strictly assessed 
+     * and the item in question is invalid according to the rules of schema 
+     * validation. 
+     */
+    public static final short VALIDITY_INVALID          = 1;
+    /**
+     * Validation status indicating that schema validation has been performed 
+     * and the item in question is valid according to the rules of schema 
+     * validation. 
+     */
+    public static final short VALIDITY_VALID            = 2;
+    /**
+     * Validation status indicating that schema validation has been performed 
+     * and the item in question has specifically been skipped. 
+     */
+    public static final short VALIDATION_NONE           = 0;
+    /**
+     * Validation status indicating that schema validation has been performed 
+     * on the item in question under the rules of lax validation. 
+     */
+    public static final short VALIDATION_PARTIAL        = 1;
+    /**
+     * Validation status indicating that full schema validation has been 
+     * performed on the item. 
+     */
+    public static final short VALIDATION_FULL           = 2;
+    /**
+     * The nearest ancestor element information item with a 
+     * <code>[schema information]</code> property (or this element item 
+     * itself if it has such a property). For more information refer to 
+     * element validation context and attribute validation context . 
+     */
+    public String getValidationContext();
+
+    /**
+     * <code>[validity]</code>: determines the validity of the schema item 
+     * with respect to the validation being attempted. The value will be one 
+     * of the constants: <code>VALIDITY_NOTKNOWN</code>, 
+     * <code>VALIDITY_INVALID</code> or <code>VALIDITY_VALID</code>. 
+     */
+    public short getValidity();
+
+    /**
+     * <code>[validation attempted]</code>: determines the extent to which 
+     * the schema item has been validated. The value will be one of the 
+     * constants: <code>VALIDATION_NONE</code>, 
+     * <code>VALIDATION_PARTIAL</code> or <code>VALIDATION_FULL</code>. 
+     */
+    public short getValidationAttempted();
+
+    /**
+     * <code>[schema error code]</code>: a list of error codes generated from 
+     * the validation attempt or an empty <code>StringList</code> if no 
+     * errors occurred during the validation attempt. 
+     */
+    public StringList getErrorCodes();
+    
+    /**
+     * A list of error messages generated from the validation attempt or
+     * an empty <code>StringList</code> if no errors occurred during the 
+     * validation attempt. The indices of error messages in this list are 
+     * aligned with those in the <code>[schema error code]</code> list.
+     */
+    public StringList getErrorMessages();
+
+    /**
+     * <code>[schema normalized value]</code>: the normalized value of this 
+     * item after validation. 
+     * 
+     * @deprecated Use getSchemaValue().getNormalizedValue() instead
+     */
+    public String getSchemaNormalizedValue();
+
+    /**
+     * <code>[schema normalized value]</code>: Binding specific actual value 
+     * or <code>null</code> if the value is in error. 
+     * @exception XSException
+     *   NOT_SUPPORTED_ERR: Raised if the implementation does not support this 
+     *   method.
+     * 
+     * @deprecated Use getSchemaValue().getActualValue() instead
+     */
+    public Object getActualNormalizedValue()
+                                   throws XSException;
+
+    /**
+     * The actual value built-in datatype, e.g. 
+     * <code>STRING_DT, SHORT_DT</code>. If the type definition of this 
+     * value is a list type definition, this method returns 
+     * <code>LIST_DT</code>. If the type definition of this value is a list 
+     * type definition whose item type is a union type definition, this 
+     * method returns <code>LISTOFUNION_DT</code>. To query the actual value 
+     * of the list or list of union type definitions use 
+     * <code>itemValueTypes</code>. If the <code>actualNormalizedValue</code>
+     *  is <code>null</code>, this method returns <code>UNAVAILABLE_DT</code>. 
+     * @exception XSException
+     *   NOT_SUPPORTED_ERR: Raised if the implementation does not support this 
+     *   method.
+     *   
+     *  @deprecated Use getSchemaValue().getActualValueType() instead
+     */
+    public short getActualNormalizedValueType()
+                                   throws XSException;
+
+    /**
+     * In the case the actual value represents a list, i.e. the 
+     * <code>actualNormalizedValueType</code> is <code>LIST_DT</code>, the 
+     * returned array consists of one type kind which represents the itemType
+     * . For example: 
+     * <pre> &lt;simpleType name="listtype"&gt; &lt;list 
+     * itemType="positiveInteger"/&gt; &lt;/simpleType&gt; &lt;element 
+     * name="list" type="listtype"/&gt; ... &lt;list&gt;1 2 3&lt;/list&gt; </pre>
+     *  
+     * The <code>schemaNormalizedValue</code> value is "1 2 3", the 
+     * <code>actualNormalizedValueType</code> value is <code>LIST_DT</code>, 
+     * and the <code>itemValueTypes</code> is an array of size 1 with the 
+     * value <code>POSITIVEINTEGER_DT</code>. 
+     * <br> If the actual value represents a list type definition whose item 
+     * type is a union type definition, i.e. <code>LISTOFUNION_DT</code>, 
+     * for each actual value in the list the array contains the 
+     * corresponding memberType kind. For example: 
+     * <pre> &lt;simpleType 
+     * name='union_type' memberTypes="integer string"/&gt; &lt;simpleType 
+     * name='listOfUnion'&gt; &lt;list itemType='union_type'/&gt; 
+     * &lt;/simpleType&gt; &lt;element name="list" type="listOfUnion"/&gt; 
+     * ... &lt;list&gt;1 2 foo&lt;/list&gt; </pre>
+     *  The 
+     * <code>schemaNormalizedValue</code> value is "1 2 foo", the 
+     * <code>actualNormalizedValueType</code> is <code>LISTOFUNION_DT</code>
+     * , and the <code>itemValueTypes</code> is an array of size 3 with the 
+     * following values: <code>INTEGER_DT, INTEGER_DT, STRING_DT</code>. 
+     * @exception XSException
+     *   NOT_SUPPORTED_ERR: Raised if the implementation does not support this 
+     *   method.
+     *  
+     *  @deprecated Use getSchemaValue().getListValueTypes() instead
+     */
+    public ShortList getItemValueTypes()
+                                   throws XSException;
+
+    /**
+     * If this item has a simple type definition or a complex type with simple
+     * content, then return the value with respect to the simple type. If
+     * this item doesn't have a simple-typed value, the behavior of this method
+     * is not specified.
+     */
+    public XSValue getSchemaValue();
+    
+    /**
+     * <code>[type definition]</code>: an item isomorphic to the type 
+     * definition used to validate the schema item. 
+     */
+    public XSTypeDefinition getTypeDefinition();
+
+    /**
+     * <code>[member type definition]</code>: if and only if that type 
+     * definition is a simple type definition with {variety} union, or a 
+     * complex type definition whose {content type} is a simple type 
+     * definition with {variety} union, then an item isomorphic to that 
+     * member of the union's {member type definitions} which actually 
+     * validated the schema item's normalized value. 
+     */
+    public XSSimpleTypeDefinition getMemberTypeDefinition();
+
+    /**
+     * <code>[schema default]</code>: the canonical lexical representation of 
+     * the declaration's {value constraint} value. For more information 
+     * refer to element schema default and attribute schema default. 
+     */
+    public String getSchemaDefault();
+
+    /**
+     * <code>[schema specified]</code>: if true, the value was specified in 
+     * the schema. If false, the value comes from the infoset. For more 
+     * information refer to element specified and attribute specified. 
+     */
+    public boolean getIsSchemaSpecified();
+
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/c9a7e646/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/LSInputList.java
----------------------------------------------------------------------
diff --git a/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/LSInputList.java b/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/LSInputList.java
new file mode 100644
index 0000000..fb01c55
--- /dev/null
+++ b/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/LSInputList.java
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.ext.xerces.xs;
+
+import java.util.List;
+
+import org.w3c.dom.ls.LSInput;
+
+/**
+ *  The <code>LSInputList</code> interface provides the abstraction of an 
+ * ordered collection of <code>LSInput</code>s, without defining or 
+ * constraining how this collection is implemented. 
+ */
+@SuppressWarnings("rawtypes")
+public interface LSInputList extends List {
+    /**
+     *  The number of <code>LSInput</code>s in the list. The range of valid 
+     * child object indices is 0 to <code>length-1</code> inclusive. 
+     */
+    public int getLength();
+
+    /**
+     *  Returns the <code>index</code>th item in the collection or 
+     * <code>null</code> if <code>index</code> is greater than or equal to 
+     * the number of objects in the list. The index starts at 0. 
+     * @param index  index into the collection. 
+     * @return  The <code>LSInput</code> at the <code>index</code>th 
+     *   position in the <code>LSInputList</code>, or <code>null</code> if 
+     *   the index specified is not valid. 
+     */
+    public LSInput item(int index);
+
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/c9a7e646/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/PSVIProvider.java
----------------------------------------------------------------------
diff --git a/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/PSVIProvider.java b/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/PSVIProvider.java
new file mode 100644
index 0000000..f271e8e
--- /dev/null
+++ b/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/PSVIProvider.java
@@ -0,0 +1,90 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.ext.xerces.xs;
+
+/**
+ * This interface provides access to the post schema validation infoset for an 
+ * API that provides a streaming document infoset, such as SAX, XNI, and 
+ * others. 
+ * <p>For implementations that would like to provide access to the PSVI in a 
+ * streaming model, a parser object should also implement the 
+ * <code>PSVIProvider</code> interface. Within the scope of the methods 
+ * handling the start and end of an element, applications may use the 
+ * <code>PSVIProvider</code> to retrieve the PSVI related to the element and 
+ * its attributes.
+ */
+public interface PSVIProvider {
+    /**
+     *  Provides the post schema validation item for the current element 
+     * information item. The method must be called by an application while 
+     * in the scope of the methods which report the start and end of an 
+     * element. For example, for SAX the method must be called within the 
+     * scope of the document handler's <code>startElement</code> or 
+     * <code>endElement</code> call. If the method is called outside of the 
+     * specified scope, the return value is undefined. 
+     * @return The post schema validation infoset for the current element. If 
+     *   an element information item is valid, then in the 
+     *   post-schema-validation infoset the following properties must be 
+     *   available for the element information item: The following 
+     *   properties are available in the scope of the method that reports 
+     *   the start of an element: {element declaration}, {validation 
+     *   context}, {notation}. The {schema information} property is 
+     *   available for the validation root. The {error codes} property is 
+     *   available if any errors occured during validation.  The following 
+     *   properties are available in the scope of the method that reports 
+     *   the end of an element: {nil}, {schema specified}, {normalized 
+     *   value},{ member type definition}, {validity}, {validation attempted}
+     *   . If the declaration has a value constraint, the property {schema 
+     *   default} is available. The {error codes} property is available if 
+     *   any errors occured during validation. Note: some processors may 
+     *   choose to provide all the PSVI properties in the scope of the 
+     *   method that reports the end of an element. 
+     */
+    public ElementPSVI getElementPSVI();
+
+    /**
+     * Provides <code>AttributePSVI</code> given the index of an attribute 
+     * information item in the current element's attribute list. The method 
+     * must be called by an application while in the scope of the methods 
+     * which report the start and end of an element at a point where the 
+     * attribute list is available. For example, for SAX the method must be 
+     * called while in the scope of the document handler's 
+     * <code>startElement</code> call. If the method is called outside of 
+     * the specified scope, the return value is undefined.
+     * @param index The attribute index. 
+     * @return The post schema validation properties of the attribute.
+     */
+    public AttributePSVI getAttributePSVI(int index);
+
+    /**
+     * Provides <code>AttributePSVI</code> given the namespace name and the 
+     * local name of an attribute information item in the current element's 
+     * attribute list. The method must be called by an application while in 
+     * the scope of the methods which report the start and end of an element 
+     * at a point where the attribute list is available. For example, for 
+     * SAX the method must be called while in the scope of the document 
+     * handler's <code>startElement</code> call. If the method is called 
+     * outside of the specified scope, the return value is undefined.
+     * @param uri The namespace name of an attribute. 
+     * @param localname The local name of an attribute. 
+     * @return The post schema validation properties of the attribute.
+     */
+    public AttributePSVI getAttributePSVIByName(String uri, 
+                                                String localname);
+
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/c9a7e646/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/ShortList.java
----------------------------------------------------------------------
diff --git a/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/ShortList.java b/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/ShortList.java
new file mode 100644
index 0000000..1c2b45e
--- /dev/null
+++ b/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/ShortList.java
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.ext.xerces.xs;
+
+import java.util.List;
+
+/**
+ *  The <code>ShortList</code> is an immutable ordered collection of 
+ * <code>unsigned short</code>. 
+ */
+@SuppressWarnings("rawtypes")
+public interface ShortList extends List {
+    /**
+     *  The number of <code>unsigned short</code>s in the list. The range of 
+     * valid child object indices is 0 to <code>length-1</code> inclusive. 
+     */
+    public int getLength();
+
+    /**
+     *  Checks if the <code>unsigned short</code> <code>item</code> is a 
+     * member of this list. 
+     * @param item  <code>unsigned short</code> whose presence in this list 
+     *   is to be tested. 
+     * @return  True if this list contains the <code>unsigned short</code> 
+     *   <code>item</code>. 
+     */
+    public boolean contains(short item);
+
+    /**
+     *  Returns the <code>index</code>th item in the collection. The index 
+     * starts at 0. 
+     * @param index  index into the collection. 
+     * @return  The <code>unsigned short</code> at the <code>index</code>th 
+     *   position in the <code>ShortList</code>. 
+     * @exception XSException
+     *   INDEX_SIZE_ERR: if <code>index</code> is greater than or equal to the 
+     *   number of objects in the list.
+     */
+    public short item(int index)
+                      throws XSException;
+
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/c9a7e646/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/StringList.java
----------------------------------------------------------------------
diff --git a/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/StringList.java b/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/StringList.java
new file mode 100644
index 0000000..581834a
--- /dev/null
+++ b/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/StringList.java
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.ext.xerces.xs;
+
+import java.util.List;
+
+/**
+ *  The <code>StringList</code> is an immutable ordered collection of 
+ * <code>GenericString</code>. 
+ */
+@SuppressWarnings("rawtypes")
+public interface StringList extends List {
+    /**
+     *  The number of <code>GenericString</code>s in the list. The range of 
+     * valid child object indices is 0 to <code>length-1</code> inclusive. 
+     */
+    public int getLength();
+
+    /**
+     *  Checks if the <code>GenericString</code> <code>item</code> is a member 
+     * of this list. 
+     * @param item  <code>GenericString</code> whose presence in this list is 
+     *   to be tested. 
+     * @return  True if this list contains the <code>GenericString</code> 
+     *   <code>item</code>. 
+     */
+    public boolean contains(String item);
+
+    /**
+     *  Returns the <code>index</code>th item in the collection or 
+     * <code>null</code> if <code>index</code> is greater than or equal to 
+     * the number of objects in the list. The index starts at 0. 
+     * @param index  index into the collection. 
+     * @return  The <code>GenericString</code> at the <code>index</code>th 
+     *   position in the <code>StringList</code>, or <code>null</code> if 
+     *   the index specified is not valid. 
+     */
+    public String item(int index);
+
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/c9a7e646/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/XSAnnotation.java
----------------------------------------------------------------------
diff --git a/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/XSAnnotation.java b/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/XSAnnotation.java
new file mode 100644
index 0000000..0912d93
--- /dev/null
+++ b/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/XSAnnotation.java
@@ -0,0 +1,60 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.ext.xerces.xs;
+
+/**
+ * This interface represents the Annotation schema component.
+ */
+public interface XSAnnotation extends XSObject {
+    // TargetType
+    /**
+     * The object type is <code>org.w3c.dom.Element</code>.
+     */
+    public static final short W3C_DOM_ELEMENT           = 1;
+    /**
+     * The object type is <code>org.xml.sax.ContentHandler</code>.
+     */
+    public static final short SAX_CONTENTHANDLER        = 2;
+    /**
+     * The object type is <code>org.w3c.dom.Document</code>.
+     */
+    public static final short W3C_DOM_DOCUMENT          = 3;
+
+    /**
+     *  Write contents of the annotation to the specified object. If the 
+     * specified <code>target</code> is a DOM object, in-scope namespace 
+     * declarations for <code>annotation</code> element are added as 
+     * attribute nodes of the serialized <code>annotation</code>, otherwise 
+     * the corresponding events for all in-scope namespace declarations are 
+     * sent via the specified document handler. 
+     * @param target  A target pointer to the annotation target object, i.e. 
+     *   <code>org.w3c.dom.Document</code>, <code>org.w3c.dom.Element</code>
+     *   , <code>org.xml.sax.ContentHandler</code>. 
+     * @param targetType  A target type. 
+     * @return  True if the <code>target</code> is a recognized type and 
+     *   supported by this implementation, otherwise false. 
+     */
+    public boolean writeAnnotation(Object target, 
+                                   short targetType);
+
+    /**
+     * A text representation of the annotation.
+     */
+    public String getAnnotationString();
+
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/c9a7e646/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/XSAttributeDeclaration.java
----------------------------------------------------------------------
diff --git a/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/XSAttributeDeclaration.java b/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/XSAttributeDeclaration.java
new file mode 100644
index 0000000..871f8d1
--- /dev/null
+++ b/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/XSAttributeDeclaration.java
@@ -0,0 +1,121 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.ext.xerces.xs;
+
+/**
+ * The interface represents the Attribute Declaration schema component.
+ */
+public interface XSAttributeDeclaration extends XSObject {
+    /**
+     * [type definition]: A simple type definition. 
+     */
+    public XSSimpleTypeDefinition getTypeDefinition();
+
+    /**
+     * [scope]. One of <code>SCOPE_GLOBAL</code>, <code>SCOPE_LOCAL</code>, or 
+     * <code>SCOPE_ABSENT</code>. If the scope is local, then the 
+     * <code>enclosingCTDefinition</code> is present. 
+     */
+    public short getScope();
+
+    /**
+     * The complex type definition for locally scoped declarations (see 
+     * <code>scope</code>), otherwise <code>null</code> if no such 
+     * definition exists. 
+     */
+    public XSComplexTypeDefinition getEnclosingCTDefinition();
+
+    /**
+     * Value constraint: one of <code>VC_NONE, VC_DEFAULT, VC_FIXED</code>. 
+     */
+    public short getConstraintType();
+
+    /**
+     * Value constraint: The constraint value with respect to the [type 
+     * definition], otherwise <code>null</code>. 
+     * 
+     * @deprecated Use getValueConstraintValue().getNormalizedValue() instead
+     */
+    public String getConstraintValue();
+
+    /**
+     * Value Constraint: Binding specific actual constraint value or 
+     * <code>null</code> if the value is in error or there is no value 
+     * constraint. 
+     * @exception XSException
+     *   NOT_SUPPORTED_ERR: Raised if the implementation does not support this 
+     *   method.
+     *  
+     *  @deprecated Use getValueConstraintValue().getActualValue() instead
+     */
+    public Object getActualVC()
+                                                        throws XSException;
+
+    /**
+     * The actual constraint value built-in datatype, e.g. 
+     * <code>STRING_DT, SHORT_DT</code>. If the type definition of this 
+     * value is a list type definition, this method returns 
+     * <code>LIST_DT</code>. If the type definition of this value is a list 
+     * type definition whose item type is a union type definition, this 
+     * method returns <code>LISTOFUNION_DT</code>. To query the actual 
+     * constraint value of the list or list of union type definitions use 
+     * <code>itemValueTypes</code>. If the <code>actualValue</code> is 
+     * <code>null</code>, this method returns <code>UNAVAILABLE_DT</code>. 
+     * @exception XSException
+     *   NOT_SUPPORTED_ERR: Raised if the implementation does not support this 
+     *   method.
+     *  
+     *  @deprecated Use getValueConstraintValue().getActualValueType() instead
+     */
+    public short getActualVCType()
+                                                        throws XSException;
+
+    /**
+     * In the case the actual constraint value represents a list, i.e. the 
+     * <code>actualValueType</code> is <code>LIST_DT</code>, the returned 
+     * array consists of one type kind which represents the itemType. If the 
+     * actual constraint value represents a list type definition whose item 
+     * type is a union type definition, i.e. <code>LISTOFUNION_DT</code>, 
+     * for each actual constraint value in the list the array contains the 
+     * corresponding memberType kind. For examples, see 
+     * <code>ItemPSVI.itemValueTypes</code>. 
+     * @exception XSException
+     *   NOT_SUPPORTED_ERR: Raised if the implementation does not support this 
+     *   method.
+     *   
+     *  @deprecated Use getValueConstraintValue().getListValueTypes() instead
+     */
+    public ShortList getItemValueTypes()
+                                                        throws XSException;
+
+    /**
+     * The actual value of the default or fixed value constraint.
+     */
+    public XSValue getValueConstraintValue();
+
+    /**
+     * An annotation if it exists, otherwise <code>null</code>. 
+     * If not null then the first [annotation] from the sequence of annotations.
+     */
+    public XSAnnotation getAnnotation();
+    
+    /**
+     * A sequence of [annotations] or an empty  <code>XSObjectList</code>. 
+     */
+    public XSObjectList getAnnotations();    
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/c9a7e646/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/XSAttributeGroupDefinition.java
----------------------------------------------------------------------
diff --git a/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/XSAttributeGroupDefinition.java b/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/XSAttributeGroupDefinition.java
new file mode 100644
index 0000000..f5db868
--- /dev/null
+++ b/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/XSAttributeGroupDefinition.java
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.ext.xerces.xs;
+
+/**
+ * This interface represents the Attribute Group Definition schema component.
+ */
+public interface XSAttributeGroupDefinition extends XSObject {
+    /**
+     * A set of [attribute uses] if it exists, otherwise an empty 
+     * <code>XSObjectList</code>. 
+     */
+    public XSObjectList getAttributeUses();
+
+    /**
+     * A [wildcard] if it exists, otherwise <code>null</code>. 
+     */
+    public XSWildcard getAttributeWildcard();
+
+    /**
+     * An annotation if it exists, otherwise <code>null</code>. If not null
+     * then the first [annotation] from the sequence of annotations.
+     */
+    public XSAnnotation getAnnotation();
+
+    /**
+     * A sequence of [annotations] or an empty <code>XSObjectList</code>.
+     */
+    public XSObjectList getAnnotations();    
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/c9a7e646/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/XSAttributeUse.java
----------------------------------------------------------------------
diff --git a/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/XSAttributeUse.java b/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/XSAttributeUse.java
new file mode 100644
index 0000000..c4d61bd
--- /dev/null
+++ b/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/XSAttributeUse.java
@@ -0,0 +1,108 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.ext.xerces.xs;
+
+/**
+ * This interface represents the Attribute Use schema component. 
+ */
+public interface XSAttributeUse extends XSObject {
+    /**
+     * [required]: determines whether this use of an attribute declaration 
+     * requires an appropriate attribute information item to be present, or 
+     * merely allows it. 
+     */
+    public boolean getRequired();
+
+    /**
+     * [attribute declaration]: provides the attribute declaration itself, 
+     * which will in turn determine the simple type definition used. 
+     */
+    public XSAttributeDeclaration getAttrDeclaration();
+
+    /**
+     * Value Constraint: one of default, fixed, or none.
+     */
+    public short getConstraintType();
+
+    /**
+     * Value Constraint: The constraint value, otherwise <code>null</code>. 
+     * 
+     * @deprecated Use getValueConstraintValue().getNormalizedValue() instead
+     */
+    public String getConstraintValue();
+
+    /**
+     * Value Constraint: Binding specific actual constraint value or 
+     * <code>null</code> if the value is in error or there is no value 
+     * constraint. 
+     * @exception XSException
+     *   NOT_SUPPORTED_ERR: Raised if the implementation does not support this 
+     *   method.
+     * 
+     * @deprecated Use getValueConstraintValue().getActualValue() instead
+     */
+    public Object getActualVC()
+                                       throws XSException;
+
+    /**
+     * The actual constraint value built-in datatype, e.g. 
+     * <code>STRING_DT, SHORT_DT</code>. If the type definition of this 
+     * value is a list type definition, this method returns 
+     * <code>LIST_DT</code>. If the type definition of this value is a list 
+     * type definition whose item type is a union type definition, this 
+     * method returns <code>LISTOFUNION_DT</code>. To query the actual 
+     * constraint value of the list or list of union type definitions use 
+     * <code>itemValueTypes</code>. If the <code>actualNormalizedValue</code>
+     *  is <code>null</code>, this method returns <code>UNAVAILABLE_DT</code>. 
+     * @exception XSException
+     *   NOT_SUPPORTED_ERR: Raised if the implementation does not support this 
+     *   method.
+     * 
+     * @deprecated Use getValueConstraintValue().getActualValueType() instead
+     */
+    public short getActualVCType()
+                                       throws XSException;
+
+    /**
+     * In the case the actual constraint value represents a list, i.e. the 
+     * <code>actualValueType</code> is <code>LIST_DT</code>, the returned 
+     * array consists of one type kind which represents the itemType. If the 
+     * actual constraint value represents a list type definition whose item 
+     * type is a union type definition, i.e. <code>LISTOFUNION_DT</code>, 
+     * for each actual constraint value in the list the array contains the 
+     * corresponding memberType kind. For examples, see 
+     * <code>ItemPSVI.itemValueTypes</code>. 
+     * @exception XSException
+     *   NOT_SUPPORTED_ERR: Raised if the implementation does not support this 
+     *   method.
+     * 
+     * @deprecated Use getValueConstraintValue().getListValueTypes() instead
+     */
+    public ShortList getItemValueTypes()
+                                       throws XSException;
+
+    /**
+     * The actual value of the default or fixed value constraint.
+     */
+    public XSValue getValueConstraintValue();
+
+    /**
+     * A sequence of [annotations] or an empty <code>XSObjectList</code>.
+     */
+    public XSObjectList getAnnotations();    
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/c9a7e646/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/XSComplexTypeDefinition.java
----------------------------------------------------------------------
diff --git a/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/XSComplexTypeDefinition.java b/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/XSComplexTypeDefinition.java
new file mode 100644
index 0000000..d34b1b5
--- /dev/null
+++ b/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/XSComplexTypeDefinition.java
@@ -0,0 +1,113 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.ext.xerces.xs;
+
+/**
+ * This interface represents the Complex Type Definition schema component.
+ */
+public interface XSComplexTypeDefinition extends XSTypeDefinition {
+    // Content Model Types
+    /**
+     * Represents an empty content type. A content type with the distinguished 
+     * value empty validates elements with no character or element 
+     * information item children. 
+     */
+    public static final short CONTENTTYPE_EMPTY         = 0;
+    /**
+     * Represents a simple content type. A content type which is simple 
+     * validates elements with character-only children. 
+     */
+    public static final short CONTENTTYPE_SIMPLE        = 1;
+    /**
+     * Represents an element-only content type. An element-only content type 
+     * validates elements with children that conform to the supplied content 
+     * model. 
+     */
+    public static final short CONTENTTYPE_ELEMENT       = 2;
+    /**
+     * Represents a mixed content type.
+     */
+    public static final short CONTENTTYPE_MIXED         = 3;
+
+    /**
+     * [derivation method]: either <code>DERIVATION_EXTENSION</code>, 
+     * <code>DERIVATION_RESTRICTION</code>, or <code>DERIVATION_NONE</code> 
+     * (see <code>XSConstants</code>). 
+     */
+    public short getDerivationMethod();
+
+    /**
+     * [abstract]: a boolean. Complex types for which <code>abstract</code> is 
+     * true must not be used as the type definition for the validation of 
+     * element information items. 
+     */
+    public boolean getAbstract();
+
+    /**
+     *  A set of attribute uses if it exists, otherwise an empty 
+     * <code>XSObjectList</code>. 
+     */
+    public XSObjectList getAttributeUses();
+
+    /**
+     * An attribute wildcard if it exists, otherwise <code>null</code>. 
+     */
+    public XSWildcard getAttributeWildcard();
+
+    /**
+     * [content type]: one of empty (<code>CONTENTTYPE_EMPTY</code>), a simple 
+     * type definition (<code>CONTENTTYPE_SIMPLE</code>), mixed (
+     * <code>CONTENTTYPE_MIXED</code>), or element-only (
+     * <code>CONTENTTYPE_ELEMENT</code>). 
+     */
+    public short getContentType();
+
+    /**
+     * A simple type definition corresponding to a simple content model, 
+     * otherwise <code>null</code>. 
+     */
+    public XSSimpleTypeDefinition getSimpleType();
+
+    /**
+     * A particle for a mixed or element-only content model, otherwise 
+     * <code>null</code>. 
+     */
+    public XSParticle getParticle();
+
+    /**
+     * [prohibited substitutions]: a subset of {extension, restriction}
+     * @param restriction  Extension or restriction constants (see 
+     *   <code>XSConstants</code>). 
+     * @return True if <code>restriction</code> is a prohibited substitution, 
+     *   otherwise false.
+     */
+    public boolean isProhibitedSubstitution(short restriction);
+
+    /**
+     *  [prohibited substitutions]: A subset of {extension, restriction} or 
+     * <code>DERIVATION_NONE</code> represented as a bit flag (see 
+     * <code>XSConstants</code>). 
+     */
+    public short getProhibitedSubstitutions();
+
+    /**
+     * A sequence of [annotations] or an empty <code>XSObjectList</code>.
+     */
+    public XSObjectList getAnnotations();
+
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/c9a7e646/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/XSConstants.java
----------------------------------------------------------------------
diff --git a/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/XSConstants.java b/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/XSConstants.java
new file mode 100644
index 0000000..f2daca9
--- /dev/null
+++ b/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/XSConstants.java
@@ -0,0 +1,326 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.ext.xerces.xs;
+
+/**
+ *  This interface defines constants used by this specification.
+ */
+public interface XSConstants {
+    // XML Schema Components
+    /**
+     * The object describes an attribute declaration.
+     */
+    public static final short ATTRIBUTE_DECLARATION     = 1;
+    /**
+     * The object describes an element declaration.
+     */
+    public static final short ELEMENT_DECLARATION       = 2;
+    /**
+     * The object describes a complex type or simple type definition.
+     */
+    public static final short TYPE_DEFINITION           = 3;
+    /**
+     * The object describes an attribute use definition.
+     */
+    public static final short ATTRIBUTE_USE             = 4;
+    /**
+     * The object describes an attribute group definition.
+     */
+    public static final short ATTRIBUTE_GROUP           = 5;
+    /**
+     * The object describes a model group definition.
+     */
+    public static final short MODEL_GROUP_DEFINITION    = 6;
+    /**
+     * A model group.
+     */
+    public static final short MODEL_GROUP               = 7;
+    /**
+     * The object describes a particle.
+     */
+    public static final short PARTICLE                  = 8;
+    /**
+     * The object describes a wildcard.
+     */
+    public static final short WILDCARD                  = 9;
+    /**
+     * The object describes an identity constraint definition.
+     */
+    public static final short IDENTITY_CONSTRAINT       = 10;
+    /**
+     * The object describes a notation declaration.
+     */
+    public static final short NOTATION_DECLARATION      = 11;
+    /**
+     * The object describes an annotation.
+     */
+    public static final short ANNOTATION                = 12;
+    /**
+     * The object describes a constraining facet. Note: this object does not 
+     * describe pattern and enumeration facets.
+     */
+    public static final short FACET                     = 13;
+    /**
+     * The object describes enumeration and pattern facets. 
+     */
+    public static final short MULTIVALUE_FACET          = 14;
+
+    // Derivation constants
+    /**
+     * No constraint is available.
+     */
+    public static final short DERIVATION_NONE           = 0;
+    /**
+     * <code>XSTypeDefinition</code> final set or 
+     * <code>XSElementDeclaration</code> disallowed substitution group.
+     */
+    public static final short DERIVATION_EXTENSION      = 1;
+    /**
+     * <code>XSTypeDefinition</code> final set or 
+     * <code>XSElementDeclaration</code> disallowed substitution group.
+     */
+    public static final short DERIVATION_RESTRICTION    = 2;
+    /**
+     * <code>XSTypeDefinition</code> final set.
+     */
+    public static final short DERIVATION_SUBSTITUTION   = 4;
+    /**
+     * <code>XSTypeDefinition</code> final set.
+     */
+    public static final short DERIVATION_UNION          = 8;
+    /**
+     * <code>XSTypeDefinition</code> final set.
+     */
+    public static final short DERIVATION_LIST           = 16;
+
+    // Scope
+    /**
+     * The scope of a declaration within named model groups or attribute 
+     * groups is <code>absent</code>. The scope of such a declaration is 
+     * determined when it is used in the construction of complex type 
+     * definitions. 
+     */
+    public static final short SCOPE_ABSENT              = 0;
+    /**
+     * A scope of <code>global</code> identifies top-level declarations. 
+     */
+    public static final short SCOPE_GLOBAL              = 1;
+    /**
+     * <code>Locally scoped</code> declarations are available for use only 
+     * within the complex type.
+     */
+    public static final short SCOPE_LOCAL               = 2;
+
+    // Value Constraint
+    /**
+     * Indicates that the component does not have any value constraint.
+     */
+    public static final short VC_NONE                   = 0;
+    /**
+     * Indicates that there is a default value constraint.
+     */
+    public static final short VC_DEFAULT                = 1;
+    /**
+     * Indicates that there is a fixed value constraint for this attribute.
+     */
+    public static final short VC_FIXED                  = 2;
+
+    // Built-in types: primitive and derived
+    /**
+     * anySimpleType
+     */
+    public static final short ANYSIMPLETYPE_DT          = 1;
+    /**
+     * string
+     */
+    public static final short STRING_DT                 = 2;
+    /**
+     * boolean
+     */
+    public static final short BOOLEAN_DT                = 3;
+    /**
+     * decimal
+     */
+    public static final short DECIMAL_DT                = 4;
+    /**
+     * float
+     */
+    public static final short FLOAT_DT                  = 5;
+    /**
+     * double
+     */
+    public static final short DOUBLE_DT                 = 6;
+    /**
+     * duration
+     */
+    public static final short DURATION_DT               = 7;
+    /**
+     * dateTime
+     */
+    public static final short DATETIME_DT               = 8;
+    /**
+     * time
+     */
+    public static final short TIME_DT                   = 9;
+    /**
+     * date
+     */
+    public static final short DATE_DT                   = 10;
+    /**
+     * gYearMonth
+     */
+    public static final short GYEARMONTH_DT             = 11;
+    /**
+     * gYear
+     */
+    public static final short GYEAR_DT                  = 12;
+    /**
+     * gMonthDay
+     */
+    public static final short GMONTHDAY_DT              = 13;
+    /**
+     * gDay
+     */
+    public static final short GDAY_DT                   = 14;
+    /**
+     * gMonth
+     */
+    public static final short GMONTH_DT                 = 15;
+    /**
+     * hexBinary
+     */
+    public static final short HEXBINARY_DT              = 16;
+    /**
+     * base64Binary
+     */
+    public static final short BASE64BINARY_DT           = 17;
+    /**
+     * anyURI
+     */
+    public static final short ANYURI_DT                 = 18;
+    /**
+     * QName
+     */
+    public static final short QNAME_DT                  = 19;
+    /**
+     * NOTATION
+     */
+    public static final short NOTATION_DT               = 20;
+    /**
+     * normalizedString
+     */
+    public static final short NORMALIZEDSTRING_DT       = 21;
+    /**
+     * token
+     */
+    public static final short TOKEN_DT                  = 22;
+    /**
+     * language
+     */
+    public static final short LANGUAGE_DT               = 23;
+    /**
+     * NMTOKEN
+     */
+    public static final short NMTOKEN_DT                = 24;
+    /**
+     * Name
+     */
+    public static final short NAME_DT                   = 25;
+    /**
+     * NCName
+     */
+    public static final short NCNAME_DT                 = 26;
+    /**
+     * ID
+     */
+    public static final short ID_DT                     = 27;
+    /**
+     * IDREF
+     */
+    public static final short IDREF_DT                  = 28;
+    /**
+     * ENTITY
+     */
+    public static final short ENTITY_DT                 = 29;
+    /**
+     * integer
+     */
+    public static final short INTEGER_DT                = 30;
+    /**
+     * nonPositiveInteger
+     */
+    public static final short NONPOSITIVEINTEGER_DT     = 31;
+    /**
+     * negativeInteger
+     */
+    public static final short NEGATIVEINTEGER_DT        = 32;
+    /**
+     * long
+     */
+    public static final short LONG_DT                   = 33;
+    /**
+     * int
+     */
+    public static final short INT_DT                    = 34;
+    /**
+     * short
+     */
+    public static final short SHORT_DT                  = 35;
+    /**
+     * byte
+     */
+    public static final short BYTE_DT                   = 36;
+    /**
+     * nonNegativeInteger
+     */
+    public static final short NONNEGATIVEINTEGER_DT     = 37;
+    /**
+     * unsignedLong
+     */
+    public static final short UNSIGNEDLONG_DT           = 38;
+    /**
+     * unsignedInt
+     */
+    public static final short UNSIGNEDINT_DT            = 39;
+    /**
+     * unsignedShort
+     */
+    public static final short UNSIGNEDSHORT_DT          = 40;
+    /**
+     * unsignedByte
+     */
+    public static final short UNSIGNEDBYTE_DT           = 41;
+    /**
+     * positiveInteger
+     */
+    public static final short POSITIVEINTEGER_DT        = 42;
+    /**
+     * The type represents a list type definition whose item type (itemType) 
+     * is a union type definition
+     */
+    public static final short LISTOFUNION_DT            = 43;
+    /**
+     * The type represents a list type definition.
+     */
+    public static final short LIST_DT                   = 44;
+    /**
+     * The built-in type category is not available.
+     */
+    public static final short UNAVAILABLE_DT            = 45;
+    
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/c9a7e646/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/XSElementDeclaration.java
----------------------------------------------------------------------
diff --git a/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/XSElementDeclaration.java b/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/XSElementDeclaration.java
new file mode 100644
index 0000000..9f6e373
--- /dev/null
+++ b/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/XSElementDeclaration.java
@@ -0,0 +1,189 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.ext.xerces.xs;
+
+/**
+ * The interface represents the Element Declaration schema component. 
+ */
+public interface XSElementDeclaration extends XSTerm {
+    /**
+     * [type definition]: either a simple type definition or a complex type 
+     * definition. 
+     */
+    public XSTypeDefinition getTypeDefinition();
+
+    /**
+     * [scope]. One of <code>SCOPE_GLOBAL</code>, <code>SCOPE_LOCAL</code>, or 
+     * <code>SCOPE_ABSENT</code>. If the scope is local, then the 
+     * <code>enclosingCTDefinition</code> is present. 
+     */
+    public short getScope();
+
+    /**
+     * The complex type definition for locally scoped declarations (see 
+     * <code>scope</code>), otherwise <code>null</code> if no such 
+     * definition exists. 
+     */
+    public XSComplexTypeDefinition getEnclosingCTDefinition();
+
+    /**
+     * [Value constraint]: one of <code>VC_NONE, VC_DEFAULT, VC_FIXED</code>. 
+     */
+    public short getConstraintType();
+
+    /**
+     * [Value constraint]: the constraint value with respect to the [type 
+     * definition], otherwise <code>null</code>. 
+     * 
+     * @deprecated Use getValueConstraintValue().getNormalizedValue() instead
+     */
+    public String getConstraintValue();
+
+    /**
+     * Value Constraint: Binding specific actual constraint value or 
+     * <code>null</code> if the value is in error or there is no value 
+     * constraint. 
+     * @exception XSException
+     *   NOT_SUPPORTED_ERR: Raised if the implementation does not support this 
+     *   method.
+     * 
+     * @deprecated Use getValueConstraintValue().getActualValue() instead
+     */
+    public Object getActualVC()
+                                            throws XSException;
+
+    /**
+     * The actual constraint value built-in datatype, e.g. 
+     * <code>STRING_DT, SHORT_DT</code>. If the type definition of this 
+     * value is a list type definition, this method returns 
+     * <code>LIST_DT</code>. If the type definition of this value is a list 
+     * type definition whose item type is a union type definition, this 
+     * method returns <code>LISTOFUNION_DT</code>. To query the actual 
+     * constraint value of the list or list of union type definitions use 
+     * <code>itemValueTypes</code>. If the <code>actualNormalizedValue</code>
+     *  is <code>null</code>, this method returns <code>UNAVAILABLE_DT</code>.
+     * @exception XSException
+     *   NOT_SUPPORTED_ERR: Raised if the implementation does not support this 
+     *   method.
+     * 
+     * @deprecated Use getValueConstraintValue().getActualValueType() instead
+     */
+    public short getActualVCType()
+                                            throws XSException;
+
+    /**
+     * In the case the actual constraint value represents a list, i.e. the 
+     * <code>actualValueType</code> is <code>LIST_DT</code>, the returned 
+     * array consists of one type kind which represents the itemType. If the 
+     * actual constraint value represents a list type definition whose item 
+     * type is a union type definition, i.e. <code>LISTOFUNION_DT</code>, 
+     * for each actual constraint value in the list the array contains the 
+     * corresponding memberType kind. For examples, see 
+     * <code>ItemPSVI.itemValueTypes</code>. 
+     * @exception XSException
+     *   NOT_SUPPORTED_ERR: Raised if the implementation does not support this 
+     *   method.
+     * 
+     * @deprecated Use getValueConstraintValue().getListValueTypes() instead
+     */
+    public ShortList getItemValueTypes()
+                                            throws XSException;
+
+    /**
+     * The actual value of the default or fixed value constraint.
+     */
+    public XSValue getValueConstraintValue();
+
+    /**
+     *  If nillable is true, then an element may also be valid if it carries 
+     * the namespace qualified attribute with local name <code>nil</code> 
+     * from namespace <code>http://www.w3.org/2001/XMLSchema-instance</code> 
+     * and value <code>true</code> (xsi:nil) even if it has no text or 
+     * element content despite a <code>content type</code> which would 
+     * otherwise require content. 
+     */
+    public boolean getNillable();
+
+    /**
+     * identity-constraint definitions: a set of constraint definitions if it 
+     * exists, otherwise an empty <code>XSNamedMap</code>. 
+     */
+    public XSNamedMap getIdentityConstraints();
+
+    /**
+     * [substitution group affiliation]: a top-level element definition if it 
+     * exists, otherwise <code>null</code>. 
+     */
+    public XSElementDeclaration getSubstitutionGroupAffiliation();
+
+    /**
+     * Convenience method that checks if <code>exclusion</code> is a 
+     * substitution group exclusion for this element declaration. 
+     * @param exclusion  
+     *   <code>DERIVATION_EXTENSION, DERIVATION_RESTRICTION</code> or 
+     *   <code>DERIVATION_NONE</code>. Represents final set for the element.
+     * @return True if <code>exclusion</code> is a part of the substitution 
+     *   group exclusion subset. 
+     */
+    public boolean isSubstitutionGroupExclusion(short exclusion);
+
+    /**
+     *  [substitution group exclusions]: the returned value is a bit 
+     * combination of the subset of {
+     * <code>DERIVATION_EXTENSION, DERIVATION_RESTRICTION</code>} or 
+     * <code>DERIVATION_NONE</code>. 
+     */
+    public short getSubstitutionGroupExclusions();
+
+    /**
+     * Convenience method that checks if <code>disallowed</code> is a 
+     * disallowed substitution for this element declaration. 
+     * @param disallowed {
+     *   <code>DERIVATION_SUBSTITUTION, DERIVATION_EXTENSION, DERIVATION_RESTRICTION</code>
+     *   } or <code>DERIVATION_NONE</code>. Represents a block set for the 
+     *   element.
+     * @return True if <code>disallowed</code> is a part of the substitution 
+     *   group exclusion subset. 
+     */
+    public boolean isDisallowedSubstitution(short disallowed);
+
+    /**
+     *  [disallowed substitutions]: the returned value is a bit combination of 
+     * the subset of {
+     * <code>DERIVATION_SUBSTITUTION, DERIVATION_EXTENSION, DERIVATION_RESTRICTION</code>
+     * } corresponding to substitutions disallowed by this 
+     * <code>XSElementDeclaration</code> or <code>DERIVATION_NONE</code>. 
+     */
+    public short getDisallowedSubstitutions();
+
+    /**
+     * {abstract} A boolean. 
+     */
+    public boolean getAbstract();
+
+    /**
+     * An annotation if it exists, otherwise <code>null</code>. If not null
+     * then the first [annotation] from the sequence of annotations.
+     */
+    public XSAnnotation getAnnotation();
+
+    /**
+     * A sequence of [annotations] or an empty <code>XSObjectList</code>.
+     */
+    public XSObjectList getAnnotations();    
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/c9a7e646/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/XSException.java
----------------------------------------------------------------------
diff --git a/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/XSException.java b/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/XSException.java
new file mode 100644
index 0000000..f10a239
--- /dev/null
+++ b/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/XSException.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.ext.xerces.xs;
+
+/**
+ * The XML Schema API operations only raise exceptions in "exceptional" 
+ * circumstances, i.e., when an operation is impossible to perform (either 
+ * for logical reasons, because data is lost, or because the implementation 
+ * has become unstable).
+ * <p>Implementations should raise other exceptions under other circumstances. 
+ * <p>Some languages and object systems do not support the concept of 
+ * exceptions. For such systems, error conditions may be indicated using 
+ * native error reporting mechanisms. For some bindings, for example, 
+ * methods may return error codes similar to those listed in the 
+ * corresponding method descriptions.
+ */
+public class XSException extends RuntimeException {
+
+    /** Serialization version. */
+    static final long serialVersionUID = 3111893084677917742L;
+    
+    public XSException(short code, String message) {
+       super(message);
+       this.code = code;
+    }
+    public short   code;
+    // ExceptionCode
+    /**
+     * If the implementation does not support the requested type of object or 
+     * operation.
+     */
+    public static final short NOT_SUPPORTED_ERR         = 1;
+    /**
+     * If index or size is negative, or greater than the allowed value
+     */
+    public static final short INDEX_SIZE_ERR            = 2;
+
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/c9a7e646/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/XSFacet.java
----------------------------------------------------------------------
diff --git a/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/XSFacet.java b/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/XSFacet.java
new file mode 100644
index 0000000..6e4774d
--- /dev/null
+++ b/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/XSFacet.java
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.ext.xerces.xs;
+
+/**
+ * Describes a constraining facet. Enumeration and pattern facets are exposed 
+ * via <code>XSMultiValueFacet</code> interface.
+ */
+public interface XSFacet extends XSObject {
+    /**
+     * The name of the facet, e.g. <code>FACET_LENGTH, FACET_TOTALDIGITS</code>
+     *  (see <code>XSSimpleTypeDefinition</code>). 
+     */
+    public short getFacetKind();
+
+    /**
+     * A value of this facet. 
+     */
+    public String getLexicalFacetValue();
+
+    /**
+     * If this facet is length, minLength, maxLength, totalDigits, or
+     * fractionDigits, and if the value can fit in "int", then return the value
+     * of the facet as an int. If the value can't fit, return -1. Use
+     * getActualFacetValue() to get the BigInteger representation. For all other
+     * facets, return 0.
+     */
+    public int getIntFacetValue();
+
+    /**
+     * If this facet is minInclusive, maxInclusive, minExclusive, or
+     * maxExclusive, then return the actual value of the facet. If this facet
+     * is length, minLength, maxLength, totalDigits, or fractionDigits, then
+     * return a BigInteger representation of the value. If this facet is
+     * whiteSpace, then return the String representation of the facet.
+     */
+    public Object getActualFacetValue();
+
+    /**
+     * [Facets]: check whether a facet is fixed. 
+     */
+    public boolean getFixed();
+
+    /**
+     * An annotation if it exists, otherwise <code>null</code>. If not null
+     * then the first [annotation] from the sequence of annotations.
+     */
+    public XSAnnotation getAnnotation();
+
+    /**
+     * A sequence of [annotations] or an empty <code>XSObjectList</code>.
+     */
+    public XSObjectList getAnnotations();    
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/c9a7e646/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/XSIDCDefinition.java
----------------------------------------------------------------------
diff --git a/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/XSIDCDefinition.java b/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/XSIDCDefinition.java
new file mode 100644
index 0000000..c2c3e2d
--- /dev/null
+++ b/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/XSIDCDefinition.java
@@ -0,0 +1,69 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.ext.xerces.xs;
+
+/**
+ * This interface represents the Identity-constraint Definition schema 
+ * component.
+ */
+public interface XSIDCDefinition extends XSObject {
+    // Identity Constraints
+    /**
+     * See the definition of <code>key</code> in the identity-constraint 
+     * category.
+     */
+    public static final short IC_KEY                    = 1;
+    /**
+     * See the definition of <code>keyref</code> in the identity-constraint 
+     * category.
+     */
+    public static final short IC_KEYREF                 = 2;
+    /**
+     * See the definition of <code>unique</code> in the identity-constraint 
+     * category.
+     */
+    public static final short IC_UNIQUE                 = 3;
+
+    /**
+     * [identity-constraint category]: one of key, keyref or unique. 
+     */
+    public short getCategory();
+
+    /**
+     * [selector]: a restricted XPath 1.0 expression. 
+     */
+    public String getSelectorStr();
+
+    /**
+     * [fields]: a non-empty list of restricted  XPath 1.0 expressions. 
+     */
+    public StringList getFieldStrs();
+
+    /**
+     * [referenced key]: required if [identity-constraint category] is keyref, 
+     * <code>null</code> otherwise. An identity-constraint definition with [
+     * identity-constraint category] equal to key or unique. 
+     */
+    public XSIDCDefinition getRefKey();
+
+    /**
+     * A sequence of [annotations] or an empty  <code>XSObjectList</code>. 
+     */
+    public XSObjectList getAnnotations();
+
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/c9a7e646/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/XSImplementation.java
----------------------------------------------------------------------
diff --git a/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/XSImplementation.java b/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/XSImplementation.java
new file mode 100644
index 0000000..4eabca8
--- /dev/null
+++ b/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/XSImplementation.java
@@ -0,0 +1,64 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.ext.xerces.xs;
+
+import org.w3c.dom.ls.LSInput;
+
+/**
+ * This interface allows one to retrieve an instance of <code>XSLoader</code>. 
+ * This interface should be implemented on the same object that implements 
+ * DOMImplementation.
+ */
+public interface XSImplementation {
+    /**
+     * A list containing the versions of XML Schema documents recognized by 
+     * this <code>XSImplemenation</code>.
+     */
+    public StringList getRecognizedVersions();
+
+
+    /**
+     * Creates a new XSLoader. The newly constructed loader may then be 
+     * configured and used to load XML Schemas.
+     * @param versions  A list containing the versions of XML Schema 
+     *   documents which can be loaded by the <code>XSLoader</code> or 
+     *   <code>null</code> to permit XML Schema documents of any recognized 
+     *   version to be loaded by the XSLoader. 
+     * @return  An XML Schema loader. 
+     * @exception XSException
+     *   NOT_SUPPORTED_ERR: Raised if the implementation does not support one 
+     *   of the specified versions.
+     */
+    public XSLoader createXSLoader(StringList versions)
+                                   throws XSException;
+    
+    /**
+     * Creates an immutable <code>StringList</code> from the given array of <code>String</code>s.
+     * @param values the array containing the <code>String</code> values that will be placed in the list.
+     * @return an immutable <code>StringList</code> from the given array of <code>String</code>s.
+     */
+    public StringList createStringList(String[] values);
+    
+    /**
+     * Creates an immutable <code>LSInputList</code> from the given array of <code>LSInput</code>s.
+     * @param values the array containing the <code>LSInput</code> values that will be placed in the list.
+     * @return an immutable <code>LSInputList</code> from the given array of <code>LSInput</code>s.
+     */
+    public LSInputList createLSInputList(LSInput[] values);
+
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/c9a7e646/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/XSLoader.java
----------------------------------------------------------------------
diff --git a/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/XSLoader.java b/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/XSLoader.java
new file mode 100644
index 0000000..c8adf02
--- /dev/null
+++ b/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/XSLoader.java
@@ -0,0 +1,90 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.ext.xerces.xs;
+
+import org.w3c.dom.DOMConfiguration;
+import org.w3c.dom.ls.LSInput;
+
+/**
+ * An interface that provides a method to load XML Schema documents. This 
+ * interface uses the DOM Level 3 Core and Load and Save interfaces.
+ */
+public interface XSLoader {
+    /**
+     *  The configuration of a document. It maintains a table of recognized 
+     * parameters. Using the configuration, it is possible to change the 
+     * behavior of the load methods. The configuration may support the 
+     * setting of and the retrieval of the following non-boolean parameters 
+     * defined on the <code>DOMConfiguration</code> interface: 
+     * <code>error-handler</code> (<code>DOMErrorHandler</code>) and 
+     * <code>resource-resolver</code> (<code>LSResourceResolver</code>). 
+     * <br> The following list of boolean parameters is defined: 
+     * <dl>
+     * <dt>
+     * <code>"validate"</code></dt>
+     * <dd>
+     * <dl>
+     * <dt><code>true</code></dt>
+     * <dd>[required] (default) Validate an XML 
+     * Schema during loading. If validation errors are found, the error 
+     * handler is notified. </dd>
+     * <dt><code>false</code></dt>
+     * <dd>[optional] Do not 
+     * report errors during the loading of an XML Schema document. </dd>
+     * </dl></dd>
+     * </dl>
+     */
+    public DOMConfiguration getConfig();
+
+    /**
+     * Parses the content of XML Schema documents specified as the list of URI 
+     * references. If the URI contains a fragment identifier, the behavior 
+     * is not defined by this specification. 
+     * @param uriList The list of URI locations.
+     * @return An XSModel representing the schema documents.
+     */
+    public XSModel loadURIList(StringList uriList);
+
+    /**
+     *  Parses the content of XML Schema documents specified as a list of 
+     * <code>LSInput</code>s. 
+     * @param is  The list of <code>LSInput</code>s from which the XML 
+     *   Schema documents are to be read. 
+     * @return An XSModel representing the schema documents.
+     */
+    public XSModel loadInputList(LSInputList is);
+
+    /**
+     * Parse an XML Schema document from a location identified by a URI 
+     * reference. If the URI contains a fragment identifier, the behavior is 
+     * not defined by this specification. 
+     * @param uri The location of the XML Schema document to be read.
+     * @return An XSModel representing this schema.
+     */
+    public XSModel loadURI(String uri);
+
+    /**
+     *  Parse an XML Schema document from a resource identified by a 
+     * <code>LSInput</code> . 
+     * @param is  The <code>LSInput</code> from which the source 
+     *   document is to be read. 
+     * @return An XSModel representing this schema.
+     */
+    public XSModel load(LSInput is);
+
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/c9a7e646/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/XSModel.java
----------------------------------------------------------------------
diff --git a/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/XSModel.java b/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/XSModel.java
new file mode 100644
index 0000000..ab29cb8
--- /dev/null
+++ b/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/XSModel.java
@@ -0,0 +1,173 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.ext.xerces.xs;
+
+/**
+ * This interface represents an XML Schema. 
+ */
+public interface XSModel {
+    /**
+     * Convenience method. Returns a list of all namespaces that belong to 
+     * this schema. The value <code>null</code> is not a valid namespace 
+     * name, but if there are components that do not have a target namespace
+     * , <code>null</code> is included in this list. 
+     */
+    public StringList getNamespaces();
+
+    /**
+     * A set of namespace schema information information items (of type 
+     * <code>XSNamespaceItem</code>), one for each namespace name which 
+     * appears as the target namespace of any schema component in the schema 
+     * used for that assessment, and one for absent if any schema component 
+     * in the schema had no target namespace. For more information see 
+     * schema information. 
+     */
+    public XSNamespaceItemList getNamespaceItems();
+
+    /**
+     * Returns a list of top-level components, i.e. element declarations, 
+     * attribute declarations, etc. Identity-constraint definitions are also
+     * considered top-level.
+     * 
+     * @param objectType The type of the declaration, i.e. 
+     *   <code>ELEMENT_DECLARATION</code>. Note that 
+     *   <code>XSTypeDefinition.SIMPLE_TYPE</code> and 
+     *   <code>XSTypeDefinition.COMPLEX_TYPE</code> can also be used as the 
+     *   <code>objectType</code> to retrieve only complex types or simple 
+     *   types, instead of all types.
+     * @return  A list of top-level definitions of the specified type in 
+     *   <code>objectType</code> or an empty <code>XSNamedMap</code> if no 
+     *   such definitions exist. 
+     */
+    public XSNamedMap getComponents(short objectType);
+
+    /**
+     * Convenience method. Returns a list of top-level component declarations 
+     * that are defined within the specified namespace, i.e. element 
+     * declarations, attribute declarations, etc. Identity-constraint
+     * definitions are also considered top-level.
+     * 
+     * @param objectType The type of the declaration, i.e. 
+     *   <code>ELEMENT_DECLARATION</code>.
+     * @param namespace The namespace to which the declaration belongs or 
+     *   <code>null</code> (for components with no target namespace).
+     * @return  A list of top-level definitions of the specified type in 
+     *   <code>objectType</code> and defined in the specified 
+     *   <code>namespace</code> or an empty <code>XSNamedMap</code>. 
+     */
+    public XSNamedMap getComponentsByNamespace(short objectType, 
+                                               String namespace);
+
+    /**
+     *  [annotations]: a set of annotations if it exists, otherwise an empty 
+     * <code>XSObjectList</code>. 
+     */
+    public XSObjectList getAnnotations();
+
+    /**
+     * Convenience method. Returns a top-level element declaration. 
+     * @param name The name of the declaration.
+     * @param namespace The namespace of the declaration, otherwise 
+     *   <code>null</code>.
+     * @return A top-level element declaration or <code>null</code> if such a 
+     *   declaration does not exist. 
+     */
+    public XSElementDeclaration getElementDeclaration(String name, 
+                                                      String namespace);
+
+    /**
+     * Convenience method. Returns a top-level attribute declaration. 
+     * @param name The name of the declaration.
+     * @param namespace The namespace of the declaration, otherwise 
+     *   <code>null</code>.
+     * @return A top-level attribute declaration or <code>null</code> if such 
+     *   a declaration does not exist. 
+     */
+    public XSAttributeDeclaration getAttributeDeclaration(String name, 
+                                                          String namespace);
+
+    /**
+     * Convenience method. Returns a top-level simple or complex type 
+     * definition. 
+     * @param name The name of the definition.
+     * @param namespace The namespace of the declaration, otherwise 
+     *   <code>null</code>.
+     * @return An <code>XSTypeDefinition</code> or <code>null</code> if such 
+     *   a definition does not exist. 
+     */
+    public XSTypeDefinition getTypeDefinition(String name, 
+                                              String namespace);
+
+    /**
+     * Convenience method. Returns a top-level attribute group definition. 
+     * @param name The name of the definition.
+     * @param namespace The namespace of the definition, otherwise 
+     *   <code>null</code>.
+     * @return A top-level attribute group definition or <code>null</code> if 
+     *   such a definition does not exist. 
+     */
+    public XSAttributeGroupDefinition getAttributeGroup(String name, 
+                                                        String namespace);
+
+    /**
+     * Convenience method. Returns a top-level model group definition. 
+     * @param name The name of the definition.
+     * @param namespace The namespace of the definition, otherwise 
+     *   <code>null</code>.
+     * @return A top-level model group definition or <code>null</code> if 
+     *   such a definition does not exist. 
+     */
+    public XSModelGroupDefinition getModelGroupDefinition(String name, 
+                                                          String namespace);
+
+    /**
+     * Convenience method. Returns a top-level notation declaration. 
+     * @param name The name of the declaration.
+     * @param namespace The namespace of the declaration, otherwise 
+     *   <code>null</code>.
+     * @return A top-level notation declaration or <code>null</code> if such 
+     *   a declaration does not exist. 
+     */
+    public XSNotationDeclaration getNotationDeclaration(String name, 
+                                                        String namespace);
+    
+    /**
+     * Convenience method. Returns an identity-constraint definition.
+     * @param name The name of the definition.
+     * @param namespace The namespace of the definition, otherwise 
+     *   <code>null</code>.
+     * @return An identity-constraint definition or <code>null</code> if such 
+     *   a declaration does not exist. 
+     */
+    public XSIDCDefinition getIDCDefinition(String name,
+                                            String namespace);
+    
+    /**
+     * Convenience method. Returns a list containing the members of the
+     * substitution group for the given <code>XSElementDeclaration</code>
+     * or an empty <code>XSObjectList</code> if the substitution group
+     * contains no members.
+     * @param head The substitution group head.
+     * @return A list containing the members of the substitution group 
+     *  for the given <code>XSElementDeclaration</code> or an empty 
+     *  <code>XSObjectList</code> if the substitution group contains 
+     *  no members.
+     */
+    public XSObjectList getSubstitutionGroup(XSElementDeclaration head);
+
+}

http://git-wip-us.apache.org/repos/asf/jena/blob/c9a7e646/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/XSModelGroup.java
----------------------------------------------------------------------
diff --git a/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/XSModelGroup.java b/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/XSModelGroup.java
new file mode 100644
index 0000000..3bd4086
--- /dev/null
+++ b/jena-core/src/main/java/org/apache/jena/ext/xerces/xs/XSModelGroup.java
@@ -0,0 +1,63 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.ext.xerces.xs;
+
+/**
+ * This interface represents the Model Group schema component.
+ */
+public interface XSModelGroup extends XSTerm {
+    // Content model compositors
+    /**
+     * This constant value signifies a sequence operator.
+     */
+    public static final short COMPOSITOR_SEQUENCE       = 1;
+    /**
+     * This constant value signifies a choice operator.
+     */
+    public static final short COMPOSITOR_CHOICE         = 2;
+    /**
+     * This content model represents a simplified version of the SGML 
+     * &amp;-Connector and is limited to the top-level of any content model. 
+     * No element in the all content model may appear more than once.
+     */
+    public static final short COMPOSITOR_ALL            = 3;
+
+    /**
+     * [compositor]: one of all, choice or sequence. The valid constant values 
+     * are: 
+     * <code>COMPOSITOR_SEQUENCE, COMPOSITOR_CHOICE, COMPOSITOR_ALL</code>. 
+     */
+    public short getCompositor();
+
+    /**
+     *  A list of [particles] if it exists, otherwise an empty 
+     * <code>XSObjectList</code>. 
+     */
+    public XSObjectList getParticles();
+
+    /**
+     * An annotation if it exists, otherwise <code>null</code>. If not null
+     * then the first [annotation] from the sequence of annotations.
+     */
+    public XSAnnotation getAnnotation();
+
+    /**
+     * A sequence of [annotations] or an empty <code>XSObjectList</code>.
+     */
+    public XSObjectList getAnnotations();    
+}