xerces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sandy...@apache.org
Subject svn commit: r1023886 - in /xerces/java/branches/xml-schema-1.1-dev: src/org/apache/xerces/impl/scd/ tests/scd/
Date Mon, 18 Oct 2010 16:23:20 GMT
Author: sandygao
Date: Mon Oct 18 16:23:20 2010
New Revision: 1023886

URL: http://svn.apache.org/viewvc?rev=1023886&view=rev
Log:
For Jira issue https://issues.apache.org/jira/browse/XERCESJ-1426. Committing patch from Ishan, for SCD unit tests.

Added:
    xerces/java/branches/xml-schema-1.1-dev/tests/scd/
    xerces/java/branches/xml-schema-1.1-dev/tests/scd/BaseTest.java
    xerces/java/branches/xml-schema-1.1-dev/tests/scd/HasDefaultNamespace.java
    xerces/java/branches/xml-schema-1.1-dev/tests/scd/HasTargetNamespace.java
    xerces/java/branches/xml-schema-1.1-dev/tests/scd/NoTargetNamespace.java
    xerces/java/branches/xml-schema-1.1-dev/tests/scd/dd.xsd
    xerces/java/branches/xml-schema-1.1-dev/tests/scd/po1.xsd
    xerces/java/branches/xml-schema-1.1-dev/tests/scd/po2.xsd
Modified:
    xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/scd/Axis.java
    xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/scd/SCDException.java
    xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/scd/SCDParser.java
    xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/scd/SCDResolver.java
    xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/scd/Step.java

Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/scd/Axis.java
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/scd/Axis.java?rev=1023886&r1=1023885&r2=1023886&view=diff
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/scd/Axis.java (original)
+++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/scd/Axis.java Mon Oct 18 16:23:20 2010
@@ -31,7 +31,7 @@ final class Axis {
         "substitutionGroup", "baseType", "itemType", "memberType", "primitiveType",
         "key", "annotation", "component", "currentComponent", "attributeUse",
         "particle", null};
-        
+
     public static final short SCHEMA_ATTRIBUTE   = 0;              
     public static final short SCHEMA_ELEMENT     = 1;
     public static final short TYPE               = 2;
@@ -60,10 +60,10 @@ final class Axis {
     public static final short PARTICLE           = 25;
     public static final short EXTENSION_AXIS     = 26;
     public static final short SPECIAL_COMPONENT  = 27;
-   
+
     private static final short UNKNOWN_AXIS      = -1;
     public static final short NO_AXIS           = 100;
-    
+
     /**
      * returns the string representation of an axis
      * @param axis the input axis type
@@ -75,7 +75,7 @@ final class Axis {
         }
         return null;
     }
-    
+
     /**
      * returns the axis type of a name
      * @param name : the qname that needs to be tested against the axis names
@@ -83,10 +83,10 @@ final class Axis {
      */
     public static short qnameToAxis(String name) {
         for (short i = 0; i < AXIS_TYPES.length; ++i) {
-           if (AXIS_TYPES[i].equals(name)) {
-               return i;
-           }
+            if (AXIS_TYPES[i].equals(name)) {
+                return i;
+            }
         }
         return UNKNOWN_AXIS;
     }
-} // class Axis
+} // class Axis
\ No newline at end of file

Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/scd/SCDException.java
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/scd/SCDException.java?rev=1023886&r1=1023885&r2=1023886&view=diff
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/scd/SCDException.java (original)
+++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/scd/SCDException.java Mon Oct 18 16:23:20 2010
@@ -25,7 +25,7 @@ public class SCDException extends Except
 
     /** Serialization version. */
     static final long serialVersionUID = -948482312169512085L;
-    
+
     // Data
 
     // hold the value of the key this Exception refers to.

Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/scd/SCDParser.java
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/scd/SCDParser.java?rev=1023886&r1=1023885&r2=1023886&view=diff
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/scd/SCDParser.java (original)
+++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/scd/SCDParser.java Mon Oct 18 16:23:20 2010
@@ -53,7 +53,7 @@ class SCDParser {
     public SCDParser() {
         steps = new ArrayList(LIST_SIZE);
     }
-    
+
     private static int getCharType(int c) throws SCDException {
         switch (c) {
         case '@':
@@ -92,7 +92,7 @@ class SCDParser {
             return CHARTYPE_NC_NAME;
         }
         throw new SCDException("Error in SCP: Unsupported character "
-                        + (char) c + " (" + c + ")");
+                + (char) c + " (" + c + ")");
     }
 
     public static char charAt(String s, int position) {
@@ -104,7 +104,7 @@ class SCDParser {
     }
 
     private static QName readQName(String step, int[] finalPosition, int currentPosition, NamespaceContext nsContext)
-            throws SCDException {
+    throws SCDException {
         return readNameTest(step, finalPosition, currentPosition, nsContext);
     }
 
@@ -117,13 +117,13 @@ class SCDParser {
      * TODO: this is the name test zero
      */
     public static final QName ZERO = new QName(null, "0", "0", null);
-    
+
     /*
      * Similar to readQName() method. But this method additionally tests for another two types
      * of name tests. i.e the wildcard name test and the zero name test.
      */
     private static QName readNameTest(String step, int[] finalPosition, int currentPosition, NamespaceContext nsContext)
-            throws SCDException {
+    throws SCDException {
         int initialPosition = currentPosition;
         int start = currentPosition;
         String prefix = ""; // for the default namespace
@@ -174,7 +174,7 @@ class SCDParser {
             throw new SCDException("Error in SCP: Namespace context is null");
         }
         throw new SCDException("Error in SCP: Invalid nametest starting character \'"
-                        + charAt(step, currentPosition) + "\'");
+                + charAt(step, currentPosition) + "\'");
     } // readNameTest()
 
     private static int scanNCName(String data, int currentPosition) {
@@ -210,12 +210,12 @@ class SCDParser {
                         }
                         if (charAt(data, currentPosition - 2) == '(') {
                             throw new SCDException(
-                                    "Error in SCD: empty xmlns scheme data between '(' and ')'");
+                            "Error in SCD: empty xmlns scheme data between '(' and ')'");
                         }
                     }
                 } else { // check if '^' is used as an escape char
                     if (charAt(data, currentPosition + 1) == '('
-                            || charAt(data, currentPosition + 1) == ')'
+                        || charAt(data, currentPosition + 1) == ')'
                             || charAt(data, currentPosition + 1) == '^') {
                         currentPosition = currentPosition + 2;
                     } else {
@@ -259,12 +259,12 @@ class SCDParser {
             } catch (NumberFormatException e) {
                 e.printStackTrace();
                 throw new SCDException(
-                        "Error in SCP: A NumberFormatException occurred while reading the predicate");
+                "Error in SCP: A NumberFormatException occurred while reading the predicate");
             }
         }
         throw new SCDException(
                 "Error in SCP: Attempt to read an invalid predicate starting from position "
-                        + ++currentPosition);
+                + ++currentPosition);
     } // readPredicate()
 
     /**
@@ -273,10 +273,10 @@ class SCDParser {
      * @return a list of Steps contained in the SCDParser
      */
     public List parseSCP(String scp, NamespaceContext nsContext, boolean isRelative)
-            throws SCDException {
+    throws SCDException {
         steps.clear();
         Step step;
-        
+
         if (scp.length() == 1 && scp.charAt(0) == '/') { // read a schema
             // schema step.
             //System.out.println("<SCHEMA STEP>");
@@ -323,7 +323,7 @@ class SCDParser {
     }
 
     private static Step processStep(String step, int[] newPosition, int currentPosition, NamespaceContext nsContext)
-            throws SCDException {
+    throws SCDException {
         short axis = -1;
         QName nameTest = null;
         int predicate = 0;
@@ -363,7 +363,7 @@ class SCDParser {
                 axis = Axis.SCHEMA_ELEMENT;
                 nameTest = name;
             } else if (charAt(step, newPos) == ':'
-                    && charAt(step, newPos + 1) == ':') {
+                && charAt(step, newPos + 1) == ':') {
                 // TODO: what to do with extension axes?
                 // Could be a hashtable look up; fail if extension axis
                 axis = Axis.qnameToAxis(name.rawname);
@@ -375,7 +375,7 @@ class SCDParser {
                         nsContext);
             } else if (charAt(step, newPos) == '(') {
                 throw new SCDException(
-                        "Error in SCP: Extension accessor not supported!");
+                "Error in SCP: Extension accessor not supported!");
             } else if (charAt(step, newPos) == '/') { // /abc:def/...
                 axis = Axis.SCHEMA_ELEMENT;
                 nameTest = name;
@@ -431,20 +431,20 @@ class SCDParser {
                 // process xscd() part
                 String data = relativeSCD.substring(currentPosition[0] + 4, relativeSCD.length());
                 if (charAt(data, 0) == '('
-                        && charAt(data, data.length() - 1) == ')') {
+                    && charAt(data, data.length() - 1) == ')') {
                     return parseSCP(data.substring(1, data.length() - 1), nsContext, isIncompleteSCD);
                 }
                 throw new SCDException("Error in SCD: xscd() part is invalid at position "
-                                + ++currentPosition[0]);
+                        + ++currentPosition[0]);
             } else {
                 throw new SCDException("Error in SCD: Expected \'xmlns\' or \'xscd\' at position "
-                                + ++currentPosition[0]);
+                        + ++currentPosition[0]);
             }
         }
         throw new SCDException("Error in SCD: Error at position "
                 + ++currentPosition[0]);
     } // createSteps()
-        
+
     private static int readxmlns(String data, NamespaceContext nsContext,
             int currentPosition) throws SCDException {
         if (charAt(data, currentPosition++) == '(') {
@@ -454,7 +454,7 @@ class SCDParser {
             if (currentPosition == pos) {
                 throw new SCDException(
                         "Error in SCD: Missing namespace name at position "
-                                + ++currentPosition);
+                        + ++currentPosition);
             }
             String name = data.substring(pos, currentPosition);
             // skip S
@@ -462,7 +462,7 @@ class SCDParser {
             // read '='
             if (charAt(data, currentPosition) != '=') {
                 throw new SCDException("Error in SCD: Expected a  \'=\' character at position "
-                                + ++currentPosition);
+                        + ++currentPosition);
             }
             // skip S
             currentPosition = skipWhiteSpaces(data, ++currentPosition);
@@ -471,7 +471,7 @@ class SCDParser {
             currentPosition = scanXmlnsSchemeData(data, currentPosition);
             if (currentPosition == pos) {
                 throw new SCDException("Error in SCD: Missing namespace value at position "
-                                + ++currentPosition);
+                        + ++currentPosition);
             }
             String uri = data.substring(pos, currentPosition);
             if (charAt(data, currentPosition) == ')') {
@@ -479,10 +479,10 @@ class SCDParser {
                 return ++currentPosition;
             }
             throw new SCDException("Error in SCD: Invalid xmlns pointer part at position "
-                            + ++currentPosition);
+                    + ++currentPosition);
         }
         throw new SCDException("Error in SCD: Invalid xmlns pointer part at position "
-                        + ++currentPosition);
+                + ++currentPosition);
     } // readxmlns()
-      
+
 }

Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/scd/SCDResolver.java
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/scd/SCDResolver.java?rev=1023886&r1=1023885&r2=1023886&view=diff
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/scd/SCDResolver.java (original)
+++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/scd/SCDResolver.java Mon Oct 18 16:23:20 2010
@@ -238,14 +238,15 @@ public class SCDResolver {
             if (typeDef != null && !currentComponents.contains(typeDef)) {
                 currentComponents.add(typeDef);
             }
-            break;
         }
-        case XSConstants.ATTRIBUTE_DECLARATION:
+        break;
+        case XSConstants.ATTRIBUTE_DECLARATION: {
             XSObject typeDef = ((XSAttributeDeclaration)sourceComponent).getTypeDefinition();
             if (typeDef != null && !currentComponents.contains(typeDef)) {
                 currentComponents.add(typeDef);
             }
-            break;
+        }
+        break;
         }
         // TODO: we dont have type alternative for now.
     } // getElidedComponents()
@@ -291,8 +292,8 @@ public class SCDResolver {
             for (int i = start; i < currentComponents.size(); ++i) {
                 addComponent((XSObject)currentComponents.get(i), step.getNametest(), result);
             }
-            break;
         }
+        break;
         default:
             throw new SCDException("Error in SCD: Unsupported top level component type "
                     + step.getAxisName());
@@ -339,8 +340,8 @@ public class SCDResolver {
             for (int i = start; i < currentComponents.size(); ++i) {
                 addComponent((XSObject)currentComponents.get(i), step.getNametest(), result);
             }
-            break;
         }
+        break;
         case Axis.ATTRIBUTE_GROUP:
             for (int i = 0, n = currentComponents.size(); i < n; ++i) {
                 componentLinked((XSObject)currentComponents.get(i), XSConstants.ATTRIBUTE_GROUP, step.getNametest(), result);
@@ -493,8 +494,8 @@ public class SCDResolver {
                     }
                 }
             }
-            break;
         }
+        break;
         case Axis.PARTICLE: {
             for (int i = 0, n = currentComponents.size(); i < n; ++i) {
                 XSObject comp = (XSObject)currentComponents.get(i);
@@ -506,8 +507,8 @@ public class SCDResolver {
                     }
                 }
             }
-            break;
         }
+        break;
         case Axis.EXTENSION_AXIS:
             throw new SCDException("Error in SCD: Extension axis is not supported");
             //break;
@@ -521,7 +522,7 @@ public class SCDResolver {
         // get the annotations() components
         XSObjectList annotations = xsModel.getAnnotations();
         for (int i = 0, n = annotations.size(); i < n; ++i) {
-            addComponent(annotations.item(i), nameTest, currentComponents);
+            addComponent(annotations.item(i), nameTest, result);
         }
         final short[] SCHEMA_COMPONENTS = new short[] {
                 XSConstants.ELEMENT_DECLARATION, XSConstants.TYPE_DEFINITION, XSConstants.ATTRIBUTE_DECLARATION,
@@ -533,7 +534,7 @@ public class SCDResolver {
             map = xsModel.getComponents(SCHEMA_COMPONENTS[i]);
             if (!map.isEmpty()) {
                 for (int j = 0, n =map.size(); j < n; ++j) {
-                    addComponent(map.item(i), nameTest, currentComponents);
+                    addComponent(map.item(i), nameTest, result);
                 }
             }
         }
@@ -577,8 +578,8 @@ public class SCDResolver {
             if (NO_FILTER == filter || (term != null && term.getType() == filter)) {
                 addComponent(term, nameTest, outputComponents);
             }
-            break;
         }
+        break;
         case XSConstants.MODEL_GROUP:
             if (IS_SPEC_COMPLIANT == false) {
                 XSObjectList particles = ((XSModelGroup) sourceComponent).getParticles();
@@ -661,8 +662,8 @@ public class SCDResolver {
                             nameTest, targetComponents);
                 }
             }
-            break;
         }
+        break;
         case XSConstants.ELEMENT_DECLARATION: {
             componentChildren(sourceComponent, filter, nameTest, targetComponents);
             if (NO_FILTER == filter || XSConstants.ANNOTATION == filter) {
@@ -685,8 +686,8 @@ public class SCDResolver {
                 addComponent(((XSElementDeclaration)sourceComponent).getSubstitutionGroupAffiliation(),
                         nameTest, targetComponents);
             }
-            break;
         }
+        break;
         case XSConstants.TYPE_DEFINITION:
             if (((XSTypeDefinition)sourceComponent).getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE) {
                 componentChildren(sourceComponent, filter, nameTest, targetComponents);
@@ -799,15 +800,15 @@ public class SCDResolver {
                 addComponent(((XSAttributeDeclaration)sourceComponent).getTypeDefinition(),
                         nameTest, targetComponents);
             }
-            break;
         }
+        break;
         case XSConstants.ELEMENT_DECLARATION: {
             if (NO_FILTER == filter || XSConstants.TYPE_DEFINITION == filter) {
                 addComponent(((XSElementDeclaration)sourceComponent).getTypeDefinition(),
                         nameTest, targetComponents);
             }
-            break;
         }
+        break;
         case XSConstants.TYPE_DEFINITION:
             if (((XSTypeDefinition)sourceComponent).getTypeCategory() == XSTypeDefinition.SIMPLE_TYPE) {
                 if (NO_FILTER == filter || XSConstants.FACET == filter) {
@@ -872,15 +873,15 @@ public class SCDResolver {
                     addComponent(term, nameTest, targetComponents);
                 }
             }
-            break;
         }
+        break;
         case XSConstants.PARTICLE: {
             XSTerm term = ((XSParticle)sourceComponent).getTerm();
             if (NO_FILTER == filter || term.getType() == filter) {
                 addComponent(term, nameTest, targetComponents);
             }
-            break;
         }
+        break;
         default:
             break; // TODO: cases Schema and Type Alternative yet to be implemented
         }   

Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/scd/Step.java
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/scd/Step.java?rev=1023886&r1=1023885&r2=1023886&view=diff
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/scd/Step.java (original)
+++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/impl/scd/Step.java Mon Oct 18 16:23:20 2010
@@ -28,13 +28,13 @@ class Step {
     private final short axis;
     private final QName nametest;
     private final int predicate;
-    
+
     public Step(short axis, QName nametest, int predicate) {
         this.axis = axis;
         this.nametest = nametest;
         this.predicate = predicate;
     }
-    
+
     /**
      * returns the axis type of the axis contained in the step
      * @return the axis type
@@ -42,7 +42,7 @@ class Step {
     public short getAxisType() {
         return this.axis;
     }
-    
+
     /**
      * the string representation of the axis of the step
      * @return the axis name
@@ -50,7 +50,7 @@ class Step {
     public String getAxisName() {
         return Axis.axisToString(axis);
     }
-    
+
     /**
      * returns the name test of the step
      * @return the nametest
@@ -58,7 +58,7 @@ class Step {
     public QName getNametest() {
         return this.nametest;
     }
-    
+
     /**
      * returns the predicate value of the step
      * @return the predicate
@@ -66,15 +66,15 @@ class Step {
     public int getPredicate() {
         return this.predicate;
     }
-    
+
     /**
      * prints the content of the axis
      */
     public String toString() {
         return "(" +
-        		"axis=" + Axis.axisToString(axis) +
-        		", nametest=" + ((nametest != null) ? ("{\"" + nametest.uri + "\"" + " \"" + nametest.rawname + "\"}") : null) +
-        		", predicate= " + predicate +
-        		")";
+        "axis=" + Axis.axisToString(axis) +
+        ", nametest=" + ((nametest != null) ? ("{\"" + nametest.uri + "\"" + " \"" + nametest.rawname + "\"}") : null) +
+        ", predicate= " + predicate +
+        ")";
     }
 } // class Step

Added: xerces/java/branches/xml-schema-1.1-dev/tests/scd/BaseTest.java
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/tests/scd/BaseTest.java?rev=1023886&view=auto
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/tests/scd/BaseTest.java (added)
+++ xerces/java/branches/xml-schema-1.1-dev/tests/scd/BaseTest.java Mon Oct 18 16:23:20 2010
@@ -0,0 +1,155 @@
+/*
+ * 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 scd;
+
+import java.util.List;
+
+import org.apache.xerces.impl.scd.SCDException;
+import org.apache.xerces.impl.scd.SCDResolver;
+import org.apache.xerces.impl.xs.util.XSObjectListImpl;
+import org.apache.xerces.xni.NamespaceContext;
+import org.apache.xerces.xs.XSImplementation;
+import org.apache.xerces.xs.XSLoader;
+import org.apache.xerces.xs.XSModel;
+import org.apache.xerces.xs.XSObject;
+import org.apache.xerces.xs.XSObjectList;
+import org.w3c.dom.DOMConfiguration;
+import org.w3c.dom.DOMError;
+import org.w3c.dom.DOMErrorHandler;
+import org.w3c.dom.bootstrap.DOMImplementationRegistry;
+
+
+/**
+ * @version $Id: $
+ */
+public class BaseTest implements DOMErrorHandler {
+    private SCDResolver resolver;
+
+    private BaseTest() {}
+    public BaseTest(String URI) {
+        resolver = new SCDResolver(createXSModel(URI));
+    }
+
+    private XSModel createXSModel(String URI) {
+        try {
+            DOMImplementationRegistry registry = DOMImplementationRegistry.newInstance();
+            XSImplementation impl = (XSImplementation) registry.getDOMImplementation("XS-Loader");
+            XSLoader schemaLoader = impl.createXSLoader(null);
+            DOMConfiguration config = schemaLoader.getConfig();
+            // create Error Handler
+            DOMErrorHandler errorHandler = new BaseTest();
+            // set error handler
+            config.setParameter("error-handler", errorHandler);
+            // set validation feature
+            config.setParameter("validate", Boolean.TRUE);
+            // parse document
+            System.out.println("Parsing " + URI + "...");
+            return schemaLoader.loadURI(URI);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    /**
+     * Test method for {@link org.apache.xerces.impl.scd.SCDResolver#resolve(java.lang.String)}.
+     */
+    public XSObjectList testResolveString(String s) {
+        try {
+            XSObjectList result = resolver.resolve(s);
+            printComps(result);
+            return result;
+        } catch (SCDException e) {
+            System.err.println(e.getKey());
+            e.printStackTrace();
+        }
+        return new XSObjectListImpl();
+    }
+
+    /**
+     * Test method for {@link org.apache.xerces.impl.scd.SCDResolver#resolve(java.lang.String, org.apache.xerces.xni.NamespaceContext)}.
+     */
+    public XSObjectList testResolveStringNamespaceContext(String s, NamespaceContext nc) {
+        try {
+            XSObjectList result = resolver.resolve(s, nc);
+            printComps(result);
+            return result;
+        } catch (SCDException e) {
+            System.err.println(e.getKey());
+            e.printStackTrace();
+        }
+        return new XSObjectListImpl();
+    }
+
+    /**
+     * Test method for {@link org.apache.xerces.impl.scd.SCDResolver#resolve(java.lang.String, org.apache.xerces.xni.NamespaceContext, org.apache.xerces.xs.XSObject)}.
+     */
+
+    public XSObjectList testResolveStringNamespaceContextXSObject(String s, NamespaceContext nc, XSObject comp) {
+        try {
+            XSObjectList result = resolver.resolve(s, nc, comp);
+            printComps(result);
+            return result;
+        } catch (SCDException e) {
+            System.err.println(e.getKey());
+            e.printStackTrace();
+        }
+        return new XSObjectListImpl();
+    }
+
+    /**
+     * Test method for {@link org.apache.xerces.impl.scd.SCDResolver#resolve(java.lang.String, org.apache.xerces.xs.XSObject)}.
+     */
+    public XSObjectList testResolveStringXSObject(String s, XSObject comp) {
+        try {
+            XSObjectList result = resolver.resolve(s, comp);
+            printComps(result);
+            return result;
+        } catch (SCDException e) {
+            System.err.println(e.getKey());
+            e.printStackTrace();
+        }
+        return new XSObjectListImpl();
+    }
+
+    private static final String[] typeNames = {"", "ATTRIBUTE_DECLARATION", "ELEMENT_DECLARATION", "TYPE_DEFINITION",
+        "ATTRIBUTE_USE", "ATTRIBUTE_GROUP", "MODEL_GROUP_DEFINITION", "MODEL_GROUP", "PARTICLE", "WILDCARD",
+        "IDENTITY_CONSTRAINT", "NOTATION_DECLARATION", "ANNOTATION", "FACET", "MULTIVALUE_FACET"};
+
+
+    public static void printComps(List comps) { 
+        System.out.println("\n{"+comps.size()+"} resulting components###\n[");
+        for (int i = 0; i < comps.size(); ++i) { // TODO: this fails if the type is a Particle
+            System.out.println("  " + typeNames[((XSObject)comps.get(i)).getType()]
+                                                + " {" + ((XSObject)comps.get(i)).getNamespace()+ ", "+ ((XSObject)comps.get(i)).getName()+"}");
+        }
+        System.out.println("]");
+    }
+
+    public boolean handleError(DOMError error) {
+        short severity = error.getSeverity();
+        if (severity == DOMError.SEVERITY_ERROR) {
+            System.out.println("[SCD-Error]: " + error.getMessage());
+        }
+
+        if (severity == DOMError.SEVERITY_WARNING) {
+            System.out.println("[SCD-Warning]: " + error.getMessage());
+        }
+        return true;
+    }
+}

Added: xerces/java/branches/xml-schema-1.1-dev/tests/scd/HasDefaultNamespace.java
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/tests/scd/HasDefaultNamespace.java?rev=1023886&view=auto
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/tests/scd/HasDefaultNamespace.java (added)
+++ xerces/java/branches/xml-schema-1.1-dev/tests/scd/HasDefaultNamespace.java Mon Oct 18 16:23:20 2010
@@ -0,0 +1,59 @@
+/*
+ * 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 scd;
+
+/**
+ * Tests for the SCD API that designate components of a schema that
+ * has a default namespace.
+ * @version $Id: $
+ * @author Ishan Jayawardena udeshike@gmail.com
+ */
+public class HasDefaultNamespace extends BaseTest {
+
+    private HasDefaultNamespace(String URI) {
+        super(URI);
+    }
+
+    /**
+     * @param args
+     */
+    public static void main(String[] args) {
+        HasDefaultNamespace test = new HasDefaultNamespace("tests/scd/po2.xsd");
+
+        test.testResolveString("xmlns(p=http://www.example.com/schema/po)xscd(/schemaElement::p:purchaseOrder)");
+        // test.testResolveString("xmlns(p=http://www.example.com/schema/po)xscd(/schemaElement::*)");
+        // test.testResolveString("xmlns(p=http://www.example.com/schema/po)xscd(/~p:USAddress)");
+        // test.testResolveString("xmlns(p=http://www.example.com/schema/po)xscd(/type::*)");
+        // test.testResolveString("xmlns(p=http://www.example.com/schema/po)xscd(/~p:USAddress/component::*)");
+        // test.testResolveString("xmlns(p=http://www.example.com/schema/po)xscd(/~p:USAddress/schemaAttribute::country)");
+        // test.testResolveString("xmlns(p=http://www.example.com/schema/po)xscd(/type::p:USAddress/model::sequence/schemaElement::*[4])");
+        // test.testResolveString("xmlns(p=http://www.example.com/schema/po)xscd(/type::p:PurchaseOrderType/model::sequence/any::*)");
+        // test.testResolveString("xmlns(p=http://www.example.com/schema/po)xscd(/type::p:PurchaseOrderType/model::sequence/schemaElement::shipTo)");
+        // test.testResolveString("xmlns(p=http://www.example.com/schema/po)xscd(/~p:PurchaseOrderType/shipTo)");
+        // test.testResolveString("xmlns(p=http://www.example.com/schema/po)xscd(/type::p:PurchaseOrderType/anyAttribute::*)");
+        // test.testResolveString("xmlns(p=http://www.example.com/schema/po)xscd(/type::p:Items/model::sequence/schemaElement::item/~0/model::sequence/schemaElement::p:comment)");
+        // test.testResolveString("xmlns(p=http://www.example.com/schema/po)xscd(/type::p:Items/model::sequence/schemaElement::item/~0/model::sequence/schemaElement::*)");
+        // test.testResolveString("xmlns(p=http://www.example.com/schema/po)xscd(/type::p:Items/model::sequence/schemaElement::item/~0/attributeUse::*)");
+        // test.testResolveString("xmlns(p=http://www.example.com/schema/po)xscd(/~p:PurchaseOrderType/schemaAttribute::orderDate)");
+        // test.testResolveString("xmlns(p=http://www.example.com/schema/po)xscd(/type::p:USAddress/model::sequence/schemaElement::city)");
+        // test.testResolveString("xmlns(p=http://www.example.com/schema/po)xscd(/type::p:Items/model::sequence/schemaElement::item/type::0/model::sequence/schemaElement::*[1])");
+        // test.testResolveString("xmlns(p=http://www.example.com/schema/po)xscd(/type::p:Items/model::sequence/schemaElement::item/type::0/model::sequence/schemaElement::quantity/type::0)");
+        // test.testResolveString("xmlns(p=http://www.example.com/schema/po)xscd(/type::p:SKU/facet::pattern)");
+    }
+
+}

Added: xerces/java/branches/xml-schema-1.1-dev/tests/scd/HasTargetNamespace.java
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/tests/scd/HasTargetNamespace.java?rev=1023886&view=auto
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/tests/scd/HasTargetNamespace.java (added)
+++ xerces/java/branches/xml-schema-1.1-dev/tests/scd/HasTargetNamespace.java Mon Oct 18 16:23:20 2010
@@ -0,0 +1,80 @@
+/*
+ * 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 scd;
+
+import org.apache.xerces.util.NamespaceSupport;
+import org.apache.xerces.xni.NamespaceContext;
+import org.apache.xerces.xs.XSObject;
+
+/**
+ * Tests for the SCD API that designate components of a schema that
+ * has a target namespace. 
+ * @author Ishan Jayawardena udeshike@gmail.com
+ * @version $Id: $
+ */
+public class HasTargetNamespace extends BaseTest {
+
+    private HasTargetNamespace(String URI) {
+        super(URI);
+    }
+
+    /**
+     * @param args
+     */
+    public static void main(String[] args) {
+        HasTargetNamespace test = new HasTargetNamespace("tests/scd/dd.xsd");
+
+        // tests for endpoint.xsd which has a target namespace
+        // ##
+        // test resolve(String relativeSCD)
+        // ##
+        // test.testResolveString("xmlns(dd=http://www.apache.org/ode/schemas/dd/2007/03)xscd(/type::dd:tDeployment/model::sequence/schemaElement::dd:process/type::0/model::sequence/schemaElement::dd:active/annotation::*)");
+        // test.testResolveString("xmlns(dd=http://www.apache.org/ode/schemas/dd/2007/03)xscd(/type::dd:tInvoke/model::choice/schemaElement::dd:binding/type::0/component::*)");
+        // test.testResolveString("xmlns(dd=http://www.apache.org/ode/schemas/dd/2007/03)xscd(/type::dd:tInvoke/model::choice/schemaElement::dd:binding/type::0//schemaAttribute::name)");
+        // test.testResolveString("xmlns(dd=http://www.apache.org/ode/schemas/dd/2007/03)xscd(/type::dd:tService/model::sequence/any::*)");
+        // test.testResolveString("xmlns(dd=http://www.apache.org/ode/schemas/dd/2007/03)xscd(/type::dd:tProcessEvents/component::*/facet::enumeration)");
+        test.testResolveString("xmlns(dd=http://www.apache.org/ode/schemas/dd/2007/03)xscd(/type::dd:tDeployment/model::sequence/schemaElement::dd:process/type::0/schemaElement::*[8])");
+
+        NamespaceContext nsContext = new NamespaceSupport();
+        nsContext.declarePrefix("dd", "http://www.apache.org/ode/schemas/dd/2007/03");
+        // ##
+        // test resolve(String incompleteSCP, NamespaceContext nsContext, XSObject currentComponent)
+        // ##
+        XSObject currentComponent = test.testResolveString("xmlns(dd=http://www.apache.org/ode/schemas/dd/2007/03)xscd(/type::dd:tDeployment/model::sequence/schemaElement::dd:process)").item(0);
+        test.testResolveStringNamespaceContextXSObject(
+                "./type::0/model::sequence/schemaElement::dd:active",
+                nsContext, 
+                currentComponent);
+
+        // ##
+        // test resolve(String incompleteSCD, XSObject currentComponent)
+        // ##
+        test.testResolveStringXSObject(
+                "xmlns(dd=http://www.apache.org/ode/schemas/dd/2007/03)xscd(./type::0/model::sequence/schemaElement::dd:active)",
+                currentComponent);
+
+        // ##
+        // test resolve(String scp, NamespaceContext nsContext)
+        // ##
+        test.testResolveStringNamespaceContext(
+                "/type::dd:tDeployment/model::sequence/schemaElement::dd:process/type::0/model::sequence/schemaElement::dd:active",
+                nsContext);
+
+    }
+
+}

Added: xerces/java/branches/xml-schema-1.1-dev/tests/scd/NoTargetNamespace.java
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/tests/scd/NoTargetNamespace.java?rev=1023886&view=auto
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/tests/scd/NoTargetNamespace.java (added)
+++ xerces/java/branches/xml-schema-1.1-dev/tests/scd/NoTargetNamespace.java Mon Oct 18 16:23:20 2010
@@ -0,0 +1,129 @@
+/*
+ * 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 scd;
+
+import org.apache.xerces.util.NamespaceSupport;
+import org.apache.xerces.xni.NamespaceContext;
+import org.apache.xerces.xs.XSObject;
+
+import junit.framework.TestCase;
+
+/**
+ * @author Ishan Jayawardena udeshike@gmail.com
+ * @version $Id: $
+ */
+public class NoTargetNamespace extends TestCase {
+
+    private BaseTest fNoTargetNamespace = new BaseTest("tests/scd/po1.xsd");
+
+    public NoTargetNamespace(String name) {
+        super(name);
+    }
+
+    /* (non-Javadoc)
+     * @see junit.framework.TestCase#setUp()
+     */
+    protected void setUp() throws Exception {
+        super.setUp();
+    }
+
+    /* (non-Javadoc)
+     * @see junit.framework.TestCase#tearDown()
+     */
+    protected void tearDown() throws Exception {
+        super.tearDown();
+    }
+
+    /**
+     * Test method for {@link org.apache.xerces.impl.scd.SCDResolver#resolve(java.lang.String)}.
+     */
+    public void testResolveString() {
+        assertEquals(false, fNoTargetNamespace.testResolveString("xscd(/type::PurchaseOrderType)").isEmpty());
+        assertEquals(false, fNoTargetNamespace.testResolveString("xscd(/type::PurchaseOrderType/model::sequence/schemaElement::shipTo)").isEmpty());
+        assertEquals(false, fNoTargetNamespace.testResolveString("xscd(/type::PurchaseOrderType/attributeUse::*)").isEmpty());
+        assertEquals(false, fNoTargetNamespace.testResolveString("xscd(/type::PurchaseOrderType/model::sequence/schemaElement::billTo)").isEmpty());
+        assertEquals(false, fNoTargetNamespace.testResolveString("xscd(/schemaElement::comment)").isEmpty());
+        assertEquals(false, fNoTargetNamespace.testResolveString("xscd(/type::PurchaseOrderType/model::sequence/schemaElement::items)").isEmpty());
+        assertEquals(false, fNoTargetNamespace.testResolveString("xscd(/type::PurchaseOrderType/schemaAttribute::orderDate)").isEmpty());
+        assertEquals(false, fNoTargetNamespace.testResolveString("xscd(/type::USAddress)").isEmpty());
+        assertEquals(false, fNoTargetNamespace.testResolveString("xscd(/type::USAddress/model::sequence/schemaElement::name)").isEmpty());
+        assertEquals(false, fNoTargetNamespace.testResolveString("xscd(/type::USAddress/model::sequence/schemaElement::street)").isEmpty());
+        assertEquals(false, fNoTargetNamespace.testResolveString("xscd(/type::USAddress/model::sequence/schemaElement::city)").isEmpty());
+        assertEquals(false, fNoTargetNamespace.testResolveString("xscd(/type::USAddress/model::sequence/schemaElement::state)").isEmpty());
+        assertEquals(false, fNoTargetNamespace.testResolveString("xscd(/type::USAddress/model::sequence/schemaElement::zip)").isEmpty());
+        assertEquals(false, fNoTargetNamespace.testResolveString("xscd(/type::USAddress/schemaAttribute::country)").isEmpty());
+        assertEquals(false, fNoTargetNamespace.testResolveString("xscd(/type::Items)").isEmpty());
+        assertEquals(false, fNoTargetNamespace.testResolveString("xscd(//quantity)").isEmpty());
+        assertEquals(false, fNoTargetNamespace.testResolveString("xscd(/type::Items/model::sequence/schemaElement::item/type::0)").isEmpty());
+        assertEquals(false, fNoTargetNamespace.testResolveString("xscd(/type::Items/model::sequence/schemaElement::item/type::0/model::sequence/schemaElement::productName)").isEmpty());
+        assertEquals(false, fNoTargetNamespace.testResolveString("xscd(/type::Items/model::sequence/schemaElement::item/type::0/model::sequence/schemaElement::quantity/type::0/facet::maxExclusive)").isEmpty());
+        assertEquals(false, fNoTargetNamespace.testResolveString("xscd(/type::Items/model::sequence/schemaElement::item/type::0/component::partNum)").isEmpty());
+        assertEquals(false, fNoTargetNamespace.testResolveString("xscd(/type::SKU)").isEmpty());
+        assertEquals(false, fNoTargetNamespace.testResolveString("xscd(/type::SKU/facet::pattern)").isEmpty());
+        assertEquals(false, fNoTargetNamespace.testResolveString("xscd(/annotation::*)").isEmpty());
+        assertEquals(false, fNoTargetNamespace.testResolveString("xscd(/type::Items/model::sequence/schemaElement::item/type::0/model::sequence/schemaElement::*[3])").isEmpty());
+        assertEquals(false, fNoTargetNamespace.testResolveString("xscd(/type::Items/component::comment)").isEmpty());
+        /// abbreviated SCDs
+        assertEquals(false, fNoTargetNamespace.testResolveString("xscd(/~PurchaseOrderType)").isEmpty());
+        assertEquals(false, fNoTargetNamespace.testResolveString("xscd(/~PurchaseOrderType/shipTo)").isEmpty());
+        assertEquals(false, fNoTargetNamespace.testResolveString("xscd(/comment)").isEmpty());
+        assertEquals(false, fNoTargetNamespace.testResolveString("xscd(/~PurchaseOrderType/items)").isEmpty());
+        assertEquals(false, fNoTargetNamespace.testResolveString("xscd(/~Items/item/~0)").isEmpty());
+        // next two do not work
+        assertEquals(false, fNoTargetNamespace.testResolveString("xscd(/~Items/item/productName)").isEmpty());
+        assertEquals(false, fNoTargetNamespace.testResolveString("xscd(/~Items/item/quantity/~0)").isEmpty());
+    }
+
+    /**
+     * Test method for {@link org.apache.xerces.impl.scd.SCDResolver#resolve(java.lang.String, org.apache.xerces.xni.NamespaceContext)}.
+     */
+    public void testResolveStringNamespaceContext() {
+        // define a namespace context
+        NamespaceContext nsContext = new NamespaceSupport();
+        nsContext.declarePrefix(null, null);
+        // get a schema component
+        XSObject currentComponent = fNoTargetNamespace.testResolveString("xscd(/type::Items)").item(0);
+        // evaluate
+        assertEquals(false, fNoTargetNamespace.testResolveStringNamespaceContextXSObject(
+                "./model::sequence/schemaElement::item/type::0//schemaAttribute::partNum",
+                nsContext,
+                currentComponent).isEmpty());
+    }
+
+    /**
+     * Test method for {@link org.apache.xerces.impl.scd.SCDResolver#resolve(java.lang.String, org.apache.xerces.xni.NamespaceContext, org.apache.xerces.xs.XSObject)}.
+     */
+    public void testResolveStringNamespaceContextXSObject() {
+        XSObject currentComponent = fNoTargetNamespace.testResolveString("xscd(/type::Items)").item(0);
+        assertEquals(false, fNoTargetNamespace.testResolveStringXSObject(
+                "xscd(./model::sequence/schemaElement::item/type::0//schemaAttribute::partNum)",
+                currentComponent).isEmpty());
+    }
+
+    /**
+     * Test method for {@link org.apache.xerces.impl.scd.SCDResolver#resolve(java.lang.String, org.apache.xerces.xs.XSObject)}.
+     */
+    public void testResolveStringXSObject() {
+        NamespaceContext nsContext = new NamespaceSupport();
+        nsContext.declarePrefix(null, null);
+        assertEquals(false, fNoTargetNamespace.testResolveStringNamespaceContext(
+                "/type::Items/model::sequence/schemaElement::item/type::0//schemaAttribute::partNum",
+                nsContext).isEmpty());
+    }
+
+}

Added: xerces/java/branches/xml-schema-1.1-dev/tests/scd/dd.xsd
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/tests/scd/dd.xsd?rev=1023886&view=auto
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/tests/scd/dd.xsd (added)
+++ xerces/java/branches/xml-schema-1.1-dev/tests/scd/dd.xsd Mon Oct 18 16:23:20 2010
@@ -0,0 +1,173 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  -->
+
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+           targetNamespace="http://www.apache.org/ode/schemas/dd/2007/03"
+           xmlns:dd="http://www.apache.org/ode/schemas/dd/2007/03"
+           elementFormDefault="qualified">
+
+    <xs:element name="deploy" id="deploy" type="dd:tDeployment"/>
+
+    <xs:complexType name="tDeployment">
+        <xs:sequence>
+            <xs:element name="process"  minOccurs="0" maxOccurs="unbounded">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element name="active" minOccurs="0" maxOccurs="1" type="xs:boolean"
+                                    default="true">
+                            <xs:annotation>
+                                <xs:documentation> Active flag, if set process will be activated once
+                                    deployed. </xs:documentation>
+                            </xs:annotation>
+                        </xs:element>
+                        <xs:element name="retired" minOccurs="0" maxOccurs="1" type="xs:boolean"
+                                    default="false">
+                            <xs:annotation>
+                                <xs:documentation> Retired flag, if set process will be retired once
+                                    deployed. </xs:documentation>
+                            </xs:annotation>
+                        </xs:element>
+                        <xs:element name="in-memory" minOccurs="0" maxOccurs="1" type="xs:boolean"
+                                    default="false">
+                            <xs:annotation>
+                                <xs:documentation>Should the process be persistent or only execute
+                                    in-memory.</xs:documentation>
+                            </xs:annotation>
+                        </xs:element>
+                        <xs:element name="property"  minOccurs="0" maxOccurs="unbounded">
+                            <xs:annotation>
+                                <xs:documentation>
+                                    A user-defined property that will be attached to a process upon
+                                    deployment.
+                                </xs:documentation>
+                            </xs:annotation>
+                            <xs:complexType>
+                                <xs:sequence>
+                                    <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
+                                </xs:sequence>
+                                <xs:attribute name="name" type="xs:QName" use="required"/>
+                            </xs:complexType>
+                        </xs:element>
+                        <xs:element name="process-events" minOccurs="0" maxOccurs="1" type="dd:tProcessEvents"/>
+                        <xs:element name="provide"  minOccurs="0" maxOccurs="unbounded" type="dd:tProvide"/>
+                        <xs:element name="invoke"  minOccurs="0" maxOccurs="unbounded" type="dd:tInvoke"/>
+                        <xs:element name="mex-interceptors" minOccurs="0" maxOccurs="1" >
+                            <xs:annotation>
+                                <xs:documentation>
+                                    List of message exchange interceptors that should be registered for this process.
+                                </xs:documentation>
+                            </xs:annotation>
+                            <xs:complexType>
+                                <xs:sequence>
+                                    <xs:element name="mex-interceptor" minOccurs="0" maxOccurs="unbounded" type="dd:tMexInterceptor" />
+                                </xs:sequence>
+                            </xs:complexType>
+                        </xs:element>
+                        <xs:element name="type" minOccurs="0" maxOccurs="1"  type="xs:QName">
+                            <xs:annotation>
+                                <xs:documentation> Process type -- indicates which process defintion should be used
+                                    for the process.</xs:documentation>
+                            </xs:annotation>
+                        </xs:element>
+                    </xs:sequence>
+                    <xs:attribute name="name" type="xs:QName" use="required"/>
+                    <xs:attribute name="fileName" type="xs:string" use="optional"/>
+                    <xs:attribute name="bpel11wsdlFileName" type="xs:string" use="optional">
+                            <xs:annotation>
+                                <xs:documentation>
+                                Allows you to specify a WSDL for BPEL 1.1 processes which do not support an "import" element.
+                                </xs:documentation>
+                            </xs:annotation>
+                    </xs:attribute>
+                </xs:complexType>
+            </xs:element>
+        </xs:sequence>
+    </xs:complexType>
+
+    <xs:complexType name="tProvide">
+        <xs:sequence>
+            <xs:element name="service" minOccurs="1" maxOccurs="1" type="dd:tService"/>
+        </xs:sequence>
+        <xs:attribute name="partnerLink" type="xs:string" use="required"/>
+    </xs:complexType>
+
+    <xs:complexType name="tInvoke">
+        <xs:choice>
+            <xs:element name="service" minOccurs="1" maxOccurs="1" type="dd:tService"/>
+            <xs:element name="binding" minOccurs="1" maxOccurs="1">
+                <xs:complexType>
+                    <xs:attribute name="name" type="xs:QName" use="required"/>
+                </xs:complexType>
+            </xs:element>
+        </xs:choice>
+        <xs:attribute name="partnerLink" type="xs:string" use="required"/>
+    </xs:complexType>
+
+    <xs:complexType name="tService">
+        <xs:sequence>
+            <xs:any namespace="##other" minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
+        </xs:sequence>
+        <xs:attribute name="name" type="xs:QName" use="required"/>
+        <xs:attribute name="port" type="xs:NCName" use="required"/>
+    </xs:complexType>
+
+    <xs:complexType name="tMexInterceptor" >
+        <xs:annotation>
+            <xs:documentation>
+                Message exchange interceptor configuration.
+            </xs:documentation>
+        </xs:annotation>
+        <xs:sequence>
+            <xs:element name="class-name" type="xs:string" />
+        </xs:sequence>
+    </xs:complexType>
+
+    <xs:complexType name="tEnableEventList">
+        <xs:sequence>
+            <xs:element name="enable-event" minOccurs="1" maxOccurs="unbounded" type="xs:string"/>
+        </xs:sequence>
+    </xs:complexType>
+
+    <xs:complexType name="tScopeEvents">
+        <xs:complexContent>
+            <xs:extension base="dd:tEnableEventList">
+                <xs:attribute name="name" use="required" type="xs:string"/>
+            </xs:extension>
+        </xs:complexContent>
+    </xs:complexType>
+
+    <xs:complexType name="tProcessEvents">
+        <xs:complexContent>
+            <xs:extension base="dd:tEnableEventList">
+                <xs:sequence>
+                    <xs:element name="scope-events" minOccurs="1" maxOccurs="unbounded" type="dd:tScopeEvents"/>
+                </xs:sequence>
+                <xs:attribute name="generate" use="optional">
+                    <xs:simpleType>
+                        <xs:restriction base="xs:string">
+                            <xs:enumeration value="all"/>
+                            <xs:enumeration value="none"/>
+                        </xs:restriction>
+                    </xs:simpleType>
+                </xs:attribute>
+            </xs:extension>
+        </xs:complexContent>
+    </xs:complexType>
+</xs:schema>

Added: xerces/java/branches/xml-schema-1.1-dev/tests/scd/po1.xsd
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/tests/scd/po1.xsd?rev=1023886&view=auto
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/tests/scd/po1.xsd (added)
+++ xerces/java/branches/xml-schema-1.1-dev/tests/scd/po1.xsd Mon Oct 18 16:23:20 2010
@@ -0,0 +1,56 @@
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+    <xsd:annotation>
+        <xsd:documentation xml:lang="en"> Purchase order schema for Example.com.
+            Copyright 2000 Example.com. All rights reserved.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:element name="purchaseOrder" type="PurchaseOrderType" />
+    <xsd:element name="comment" type="xsd:string" />
+    <xsd:complexType name="PurchaseOrderType">
+        <xsd:sequence>
+            <xsd:element name="shipTo" type="USAddress" />
+            <xsd:element name="billTo" type="USAddress" />
+            <xsd:element ref="comment" minOccurs="0" />
+            <xsd:element name="items" type="Items" />
+        </xsd:sequence>
+        <xsd:attribute name="orderDate" type="xsd:date" />
+    </xsd:complexType>
+    <xsd:complexType name="USAddress">
+        <xsd:sequence>
+            <xsd:element name="name" type="xsd:string" />
+            <xsd:element name="street" type="xsd:string" />
+            <xsd:element name="city" type="xsd:string" />
+            <xsd:element name="state" type="xsd:string" />
+            <xsd:element name="zip" type="xsd:decimal" />
+        </xsd:sequence>
+        <xsd:attribute name="country" type="xsd:NMTOKEN" fixed="US" />
+    </xsd:complexType>
+    <xsd:complexType name="Items">
+        <xsd:sequence>
+            <xsd:element name="item" minOccurs="0" maxOccurs="unbounded">
+                <xsd:complexType>
+                    <xsd:sequence>
+                        <xsd:element name="productName" type="xsd:string" />
+                        <xsd:element name="quantity">
+                            <xsd:simpleType>
+                                <xsd:restriction base="xsd:positiveInteger">
+                                    <xsd:maxExclusive value="100" />
+                                </xsd:restriction>
+                            </xsd:simpleType>
+                        </xsd:element>
+                        <xsd:element name="USPrice" type="xsd:decimal" />
+                        <xsd:element ref="comment" minOccurs="0" />
+                        <xsd:element name="shipDate" type="xsd:date" minOccurs="0" />
+                    </xsd:sequence>
+                    <xsd:attribute name="partNum" type="SKU" use="required" />
+                </xsd:complexType>
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:complexType>
+
+    <!-- Stock Keeping Unit, a code for identifying products -->
+    <xsd:simpleType name="SKU">
+        <xsd:restriction base="xsd:string">
+            <xsd:pattern value="\d{3}-[A-Z]{2}" />
+        </xsd:restriction>
+    </xsd:simpleType>
+</xsd:schema>
\ No newline at end of file

Added: xerces/java/branches/xml-schema-1.1-dev/tests/scd/po2.xsd
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/tests/scd/po2.xsd?rev=1023886&view=auto
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/tests/scd/po2.xsd (added)
+++ xerces/java/branches/xml-schema-1.1-dev/tests/scd/po2.xsd Mon Oct 18 16:23:20 2010
@@ -0,0 +1,75 @@
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+    targetNamespace="http://www.example.com/schema/po"
+    xmlns="http://www.example.com/schema/po">
+    <xsd:annotation>
+        <xsd:documentation xml:lang="en"> Purchase order schema for Example.com.
+            Copyright 2000 Example.com. All rights reserved.</xsd:documentation>
+    </xsd:annotation>
+    <xsd:element name="purchaseOrder" type="PurchaseOrderType"/>
+    <xsd:element name="comment" type="xsd:string" />
+    <xsd:complexType name="PurchaseOrderType">
+        <xsd:sequence>
+            <xsd:element name="shipTo" type="USAddress" />
+            <xsd:element name="billTo" type="USAddress" />
+            <xsd:element ref="comment" minOccurs="0" />
+            <xsd:element name="items" type="Items" />
+            <xsd:any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
+        </xsd:sequence>
+        <xsd:attribute name="orderDate" type="xsd:date" />
+        <xsd:anyAttribute namespace="##other"/>
+    </xsd:complexType>
+    <xsd:complexType name="USAddress">
+        <xsd:sequence>
+            <xsd:element name="name" type="xsd:string" />
+            <xsd:element name="street" type="xsd:string" />
+            <xsd:element name="city" type="xsd:string" />
+            <xsd:element name="state" type="xsd:string" />
+            <xsd:element name="zip" type="xsd:decimal" />
+        </xsd:sequence>
+        <xsd:attribute name="country" type="xsd:NMTOKEN" fixed="US" />
+    </xsd:complexType>
+    <xsd:complexType name="Items">
+        <xsd:sequence>
+            <xsd:element name="item" minOccurs="0" maxOccurs="unbounded">
+                <xsd:complexType>
+                    <xsd:sequence>
+                        <xsd:element name="productName" type="xsd:string" />
+                        <xsd:element name="quantity">
+                            <xsd:simpleType>
+                                <xsd:restriction base="xsd:positiveInteger">
+                                    <xsd:maxExclusive value="100" />
+                                </xsd:restriction>
+                            </xsd:simpleType>
+                        </xsd:element>
+                        <xsd:element name="USPrice" type="xsd:decimal" />
+                        <xsd:element ref="comment" minOccurs="0" />
+                        <xsd:element name="shipDate" type="xsd:date" minOccurs="0" />
+                    </xsd:sequence>
+                    <xsd:attribute name="partNum" type="SKU" use="required" />
+                </xsd:complexType>
+                <!--
+                <xsd:unique name="partNumAndName">
+                    <xsd:selector xpath="item" />
+                    <xsd:field xpath="@partNum" />
+                    <xsd:field xpath="productName" />
+                </xsd:unique>
+                  -->
+            </xsd:element>
+        </xsd:sequence>
+    </xsd:complexType>
+
+    <xsd:element name="items" type="Items">
+        <xsd:unique name="partNumAndName">
+            <xsd:selector xpath="item"/>
+            <xsd:field    xpath="@partNum"/>
+            <xsd:field    xpath="productName"/>
+        </xsd:unique>
+    </xsd:element>
+
+    <!-- Stock Keeping Unit, a code for identifying products -->
+    <xsd:simpleType name="SKU">
+        <xsd:restriction base="xsd:string">
+            <xsd:pattern value="\d{3}-[A-Z]{2}" />
+        </xsd:restriction>
+    </xsd:simpleType>
+</xsd:schema>



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org


Mime
View raw message