You are viewing a plain text version of this content. The canonical link for it is here.
Posted to woden-dev@ws.apache.org by hu...@apache.org on 2006/10/19 13:01:58 UTC

svn commit: r465571 [1/3] - in /incubator/woden/trunk/java: ./ src/org/apache/woden/ src/org/apache/woden/internal/ src/org/apache/woden/internal/resolver/ src/org/apache/woden/resolver/ test/javax/xml/namespace/ test/org/apache/woden/resolver/ test/or...

Author: hughesj
Date: Thu Oct 19 04:01:55 2006
New Revision: 465571

URL: http://svn.apache.org/viewvc?view=rev&rev=465571
Log:
WODEN-14: Applied Graham Turrell's woden14-patch4all.txt.
Added LICENSE.wsdl2.html which contains the W3C license that applies to 
the WSDL v2.0 schemas. Updated build.xml so that this LICENSE file is
included in the zip/tar distros

Added:
    incubator/woden/trunk/java/LICENSE.wsdl2.html
    incubator/woden/trunk/java/src/org/apache/woden/internal/resolver/
    incubator/woden/trunk/java/src/org/apache/woden/internal/resolver/EntityResolverAdapter.java
    incubator/woden/trunk/java/src/org/apache/woden/internal/resolver/SchemaResolverAdapter.java
    incubator/woden/trunk/java/src/org/apache/woden/internal/resolver/SimpleURIResolver.java
    incubator/woden/trunk/java/src/org/apache/woden/resolver/
    incubator/woden/trunk/java/src/org/apache/woden/resolver/URIResolver.java
    incubator/woden/trunk/java/test/org/apache/woden/resolver/
    incubator/woden/trunk/java/test/org/apache/woden/resolver/OMSimpleURIResolverTest.java
    incubator/woden/trunk/java/test/org/apache/woden/resolver/SimpleURIResolverTest.java
    incubator/woden/trunk/java/test/org/apache/woden/resolver/resources/
    incubator/woden/trunk/java/test/org/apache/woden/resolver/resources/XMLSchema.dtd
    incubator/woden/trunk/java/test/org/apache/woden/resolver/resources/XMLSchema.xsd
    incubator/woden/trunk/java/test/org/apache/woden/resolver/resources/binding.wsdl
    incubator/woden/trunk/java/test/org/apache/woden/resolver/resources/datatypes.dtd
    incubator/woden/trunk/java/test/org/apache/woden/resolver/resources/interface.wsdl
    incubator/woden/trunk/java/test/org/apache/woden/resolver/resources/schemaImport.xsd
    incubator/woden/trunk/java/test/org/apache/woden/resolver/resources/schemaInclude.xsd
    incubator/woden/trunk/java/test/org/apache/woden/resolver/resources/simpleresolver.catalog
    incubator/woden/trunk/java/test/org/apache/woden/resolver/resources/woden14.wsdl
    incubator/woden/trunk/java/test/org/apache/woden/resolver/resources/wsdl20-extensions.xsd
    incubator/woden/trunk/java/test/org/apache/woden/resolver/resources/wsdl20-http.xsd
    incubator/woden/trunk/java/test/org/apache/woden/resolver/resources/wsdl20-instance.xsd
    incubator/woden/trunk/java/test/org/apache/woden/resolver/resources/wsdl20-rpc.xsd
    incubator/woden/trunk/java/test/org/apache/woden/resolver/resources/wsdl20-soap.xsd
    incubator/woden/trunk/java/test/org/apache/woden/resolver/resources/wsdl20.xsd
    incubator/woden/trunk/java/test/org/apache/woden/resolver/resources/xml.xsd
Modified:
    incubator/woden/trunk/java/build.xml
    incubator/woden/trunk/java/src/org/apache/woden/WSDLReader.java
    incubator/woden/trunk/java/src/org/apache/woden/internal/BaseWSDLReader.java
    incubator/woden/trunk/java/src/org/apache/woden/internal/DOMWSDLReader.java
    incubator/woden/trunk/java/src/org/apache/woden/internal/Messages.properties
    incubator/woden/trunk/java/test/javax/xml/namespace/QNameTest.java
    incubator/woden/trunk/java/test/org/apache/woden/tests/AllWodenTestsDOM.java
    incubator/woden/trunk/java/test/org/apache/woden/tests/AllWodenTestsOM.java

Added: incubator/woden/trunk/java/LICENSE.wsdl2.html
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/LICENSE.wsdl2.html?view=auto&rev=465571
==============================================================================
--- incubator/woden/trunk/java/LICENSE.wsdl2.html (added)
+++ incubator/woden/trunk/java/LICENSE.wsdl2.html Thu Oct 19 04:01:55 2006
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+  <title>W3C Software License</title>
+  <link rel="stylesheet" type="text/css" href="/StyleSheets/base.css" />
+  <style type="text/css">
+ <!--
+h3#version { margin-top: -0.8em;}  
+-->
+
+
+
+
+
+
+
+
+
+  </style>
+</head>
+
+<body text="#000000" bgcolor="#FFFFFF">
+<h1>W3C<sup>®</sup> SOFTWARE NOTICE AND LICENSE</h1>
+
+<h3 id="version"><a
+href="http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231">http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231</a></h3>
+
+<p>This work (and included software, documentation such as READMEs, or other
+related items) is being provided by the copyright holders under the following
+license. By obtaining, using and/or copying this work, you (the licensee)
+agree that you have read, understood, and will comply with the following
+terms and conditions.</p>
+
+<p>Permission to copy, modify, and distribute this software and its
+documentation, with or without modification,&nbsp;for any purpose and without
+fee or royalty is hereby granted, provided that you include the following on
+ALL copies of the software and documentation or portions thereof, including
+modifications:</p>
+<ol>
+  <li>The full text of this NOTICE in a location viewable to users of the
+    redistributed or derivative work.</li>
+  <li>Any pre-existing intellectual property disclaimers, notices, or terms
+    and conditions. If none exist, the <a
+    href="copyright-software-short-notice-20021231.html">W3C Software Short
+    Notice</a> should be included (hypertext is preferred, text is permitted)
+    within the body of any redistributed or derivative code.</li>
+
+  <li>Notice of any changes or modifications to the files, including the date
+    changes were made. (We recommend you provide URIs to the location from
+    which the code is derived.)</li>
+</ol>
+
+<p>THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS
+MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT
+LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR
+PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE
+ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.</p>
+
+<p>COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR
+DOCUMENTATION.</p>
+
+<p>The name and trademarks of copyright holders may NOT be used in
+advertising or publicity pertaining to the software without specific, written
+prior permission. Title to copyright in this software and any associated
+documentation will at all times remain with copyright holders.</p>
+
+<p></p>
+
+<p>____________________________________</p>
+
+<p>This formulation of W3C's notice and license became active on December 31
+2002. This version removes the copyright ownership notice such that this
+license can be used with materials other than those owned by the W3C,
+reflects that ERCIM is now a host of the W3C, includes references to this
+specific dated version of the license, and removes the ambiguous grant of
+"use". Otherwise, this version is the same as the <a
+href="http://www.w3.org/Consortium/Legal/copyright-software-19980720">previous
+version</a> and is written so as to preserve the <a
+href="http://www.gnu.org/philosophy/license-list.html#GPLCompatibleLicenses">Free
+Software Foundation's assessment of GPL compatibility</a> and <a
+href="http://www.opensource.org/licenses/W3C.php">OSI's certification</a>
+under the <a href="http://www.opensource.org/docs/definition.php">Open Source
+Definition</a>. Please see our <a
+href="http://www.w3.org/Consortium/Legal/IPR-FAQ">Copyright FAQ</a> for
+common questions about using materials from our site, including specific
+terms and conditions for packages like libwww, Amaya, and Jigsaw. Other
+questions about this notice can be directed to <a
+href="mailto:site-policy@w3.org">site-policy@w3.org</a>.<br />
+
+&nbsp;</p>
+<address>
+  Joseph Reagle &lt;<a
+  href="mailto:site-policy@w3.org">site-policy@w3.org&gt;</a>
+</address>
+
+<p>Last revised $Id: copyright-software-20021231.html,v 1.11 2004/07/06 16:02:49 slesch Exp $</p>
+</body>
+</html>

Modified: incubator/woden/trunk/java/build.xml
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/build.xml?view=diff&rev=465571&r1=465570&r2=465571
==============================================================================
--- incubator/woden/trunk/java/build.xml (original)
+++ incubator/woden/trunk/java/build.xml Thu Oct 19 04:01:55 2006
@@ -487,6 +487,7 @@
 				<include name="LICENSE.dom" />
 				<include name="LICENSE.sax" />
 				<include name="LICENSE.xerces" />
+				<include name="LICENSE.wsdl2.html" />
 				<include name="NOTICE" />
 				<include name="README" />
 				<include name="release-notes.html" />

Modified: incubator/woden/trunk/java/src/org/apache/woden/WSDLReader.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/src/org/apache/woden/WSDLReader.java?view=diff&rev=465571&r1=465570&r2=465571
==============================================================================
--- incubator/woden/trunk/java/src/org/apache/woden/WSDLReader.java (original)
+++ incubator/woden/trunk/java/src/org/apache/woden/WSDLReader.java Thu Oct 19 04:01:55 2006
@@ -15,6 +15,7 @@
  */
 package org.apache.woden;
 
+import org.apache.woden.resolver.URIResolver;
 import org.apache.woden.wsdl20.extensions.ExtensionRegistry;
 import org.apache.woden.wsdl20.xml.DescriptionElement;
 
@@ -265,5 +266,19 @@
      * @throws IllegalArgumentException if the property name is not recognized.
      */
     public Object getProperty(String name);
+    
+    /**
+     * Sets the URI resolver to be used.
+     * 
+     * @param resolver
+     */
+    public void setURIResolver(URIResolver resolver);
+    
+    /**
+     * Gets the URI Resolver currently in use
+     * @return
+     */
+    public URIResolver getURIResolver();
+
     
 }

Modified: incubator/woden/trunk/java/src/org/apache/woden/internal/BaseWSDLReader.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/src/org/apache/woden/internal/BaseWSDLReader.java?view=diff&rev=465571&r1=465570&r2=465571
==============================================================================
--- incubator/woden/trunk/java/src/org/apache/woden/internal/BaseWSDLReader.java (original)
+++ incubator/woden/trunk/java/src/org/apache/woden/internal/BaseWSDLReader.java Thu Oct 19 04:01:55 2006
@@ -15,10 +15,16 @@
  */
 package org.apache.woden.internal;
 
+import java.io.IOException;
+import java.net.URI;
+
 import org.apache.woden.ErrorReporter;
 import org.apache.woden.WSDLException;
 import org.apache.woden.WSDLFactory;
 import org.apache.woden.WSDLReader;
+import org.apache.woden.internal.resolver.SimpleURIResolver;
+import org.apache.woden.internal.util.PropertyUtils;
+import org.apache.woden.resolver.URIResolver;
 import org.apache.woden.wsdl20.extensions.ExtensionRegistry;
 
 
@@ -35,17 +41,64 @@
  * @author jkaputin@apache.org
  */
 public abstract class BaseWSDLReader implements WSDLReader {
+	
+	private final String DEFAULT_RESOLVER_PROPERTY="org.apache.woden.resolver.default";
     
     private WSDLFactory fFactory;    
     private String fFactoryImplName = null;
     private ErrorReporter fErrorReporter;
     private ExtensionRegistry fExtReg;
+    private URIResolver fResolver = null;
+    
     
     protected ReaderFeatures features;
 
     protected BaseWSDLReader() throws WSDLException {
         fErrorReporter= new ErrorReporterImpl(); 
         features = new ReaderFeatures();
+
+        /* Establish the default URIResolver.
+         * 
+         * Find the class representing the default:
+         * Search for a property setting for the default URI resolver.
+         * The property can be set via:
+         * 1. JVM system properties (e.g. java -D arguments)
+         * 		use -Dorg.apache.woden.resolver.default=<fully qualified class name> on the command line
+         * 		where RHS is the name of the chosen default URIResolver implementation.
+         * 2. application properties defined in /META-INF/services (e.g. in a jar file)
+         *      (when implemented in PropertyUtils.findProperty(String p)...)
+         * 3. properties defined in a wsdl properties file located in JAVAHOME/lib directory
+         */
+       
+        String defaultURIResolver = PropertyUtils.findProperty(DEFAULT_RESOLVER_PROPERTY);
+        if (defaultURIResolver == null)
+        {
+        	// property not set (an allowable condition)
+        	// use the "default default" URI resolver
+        	fResolver = new SimpleURIResolver();
+        }
+        else
+        {
+	        try 
+	        {
+	        	Class resolverClass = Class.forName(defaultURIResolver);
+	        	fResolver = (URIResolver) resolverClass.newInstance();
+	        } 
+	        catch (Exception e)
+	        {
+                /*
+                Catches and wraps:
+                ClassNotFoundException
+                InstantiationException
+                IllegalAccessException
+                */
+               
+               throw new WSDLException(WSDLException.CONFIGURATION_ERROR,
+                       "Problem instantiating a URIResolver implementation " +
+                       "using classname '" + defaultURIResolver + "' ",
+                       e);
+           }
+        }
     }
     
     /**
@@ -241,5 +294,69 @@
                     fErrorReporter.getFormattedMessage("WSDL008", args));
         }
     }
+    
+    /**
+     * Provides the capability of setting a supplied URI Resolver.
+     * 
+     */
+    public void setURIResolver(URIResolver resolver) {
+    	fResolver = resolver;
+    }
+
+    /*
+     * convenience method to call the URI resolver and handle common exceptions.
+     * Unlike the actual Resolver, returns the original URI if no resolution is 
+     * available.
+     * 
+     * TODO move to o.a.w.internal.util ?
+     */
+    protected URI resolveURI(URI uri) throws WSDLException {
+    	
+    	if (uri != null) {
+        	URI resolvedUri = null;
+        	try {
+        		resolvedUri = getURIResolver().resolveURI(uri);
+        	} catch (IOException e) {
+        		getErrorReporter().reportError(
+                        new ErrorLocatorImpl(),  //TODO line&col nos.
+                        "WSDL524",
+                        new Object[] {uri}, 
+                        ErrorReporter.SEVERITY_ERROR, 
+                        e);
+        	}
+        	if (resolvedUri != null) {
+        		uri = resolvedUri;
+        	}
+        }
+    	
+    	return uri;
+    }
+
+    /*
+     * Convenience method for resolving URI's to Strings
+     * 
+     * @param uri
+     * @return
+     */
+    protected String resolveURI(String uri) {
+    	String resolvedUri;
+    	try {
+    		resolvedUri = getURIResolver().resolveURI(new URI(uri)).toString();
+    	} catch (Exception e) {
+    		// revert to "default" behaviour
+    		resolvedUri = uri;
+    	}
+    	
+    	return resolvedUri;	
+    }
+ 
+    
+    /**
+     * Find the current URI Resolver
+     */
+	public URIResolver getURIResolver() {
+		return fResolver;
+	}
+    
     
 }

Modified: incubator/woden/trunk/java/src/org/apache/woden/internal/DOMWSDLReader.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/src/org/apache/woden/internal/DOMWSDLReader.java?view=diff&rev=465571&r1=465570&r2=465571
==============================================================================
--- incubator/woden/trunk/java/src/org/apache/woden/internal/DOMWSDLReader.java (original)
+++ incubator/woden/trunk/java/src/org/apache/woden/internal/DOMWSDLReader.java Thu Oct 19 04:01:55 2006
@@ -34,6 +34,8 @@
 import org.apache.woden.WSDLException;
 import org.apache.woden.WSDLReader;
 import org.apache.woden.WSDLSource;
+import org.apache.woden.internal.resolver.EntityResolverAdapter;
+import org.apache.woden.internal.resolver.SchemaResolverAdapter;
 import org.apache.woden.internal.schema.ImportedSchemaImpl;
 import org.apache.woden.internal.schema.InlinedSchemaImpl;
 import org.apache.woden.internal.schema.SchemaConstants;
@@ -481,9 +483,10 @@
         if(locationURI != null)
         {
             //TODO handle missing locationURI (OPTIONAL attr)
-            imp.setLocation(getURI(locationURI));
+        	URI resolvedLocationURI = resolveURI(getURI(locationURI));
+            imp.setLocation(resolvedLocationURI);
             DescriptionElement importedDesc = 
-                getWSDLFromLocation(locationURI, desc, wsdlModules);
+                getWSDLFromLocation(resolvedLocationURI.toString(), desc, wsdlModules);
             imp.setDescriptionElement(importedDesc);
         }
         
@@ -503,9 +506,10 @@
 
         if(locationURI != null)
         {
-            include.setLocation(getURI(locationURI));
+        	URI resolvedLocationURI = resolveURI(getURI(locationURI));
+        	include.setLocation(resolvedLocationURI);
             DescriptionElement includedDesc = 
-                getWSDLFromLocation(locationURI, desc, wsdlModules);
+                getWSDLFromLocation(resolvedLocationURI.toString(), desc, wsdlModules);
             include.setDescriptionElement(includedDesc);
         }
         
@@ -579,6 +583,9 @@
         
         try {
             XmlSchemaCollection xsc = new XmlSchemaCollection();
+            
+            // Plug in the selected woden URI Resolver
+            xsc.setSchemaResolver(new SchemaResolverAdapter(getURIResolver()));         
             schemaDef = xsc.read(schemaEl, baseURI);
         } 
         catch (XmlSchemaException e) 
@@ -709,6 +716,10 @@
             try {
                 String baseLoc = contextURI != null ? contextURI.toString() : null;
                 XmlSchemaCollection xsc = new XmlSchemaCollection();
+                
+                // Plug in the selected woden URI Resolver
+                xsc.setSchemaResolver(new SchemaResolverAdapter(getURIResolver()));   
+                
                 schemaDef = xsc.read(schemaEl, baseLoc);
                 fImportedSchemas.put(schemaURL, schemaDef);
             } 

Modified: incubator/woden/trunk/java/src/org/apache/woden/internal/Messages.properties
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/src/org/apache/woden/internal/Messages.properties?view=diff&rev=465571&r1=465570&r2=465571
==============================================================================
--- incubator/woden/trunk/java/src/org/apache/woden/internal/Messages.properties (original)
+++ incubator/woden/trunk/java/src/org/apache/woden/internal/Messages.properties Thu Oct 19 04:01:55 2006
@@ -74,6 +74,7 @@
 WSDL521=Could not parse an inline schema in the WSDL at URL "{0}".
 WSDL522=Could not parse a schema imported from URL "{0}".
 WSDL523=The QName of an extension attribute must not be null.
+WSDL524=URI resolution failed on URI "{0}".
 
 # ------------ TODO determine if these errors are needed -------------------
 

Added: incubator/woden/trunk/java/src/org/apache/woden/internal/resolver/EntityResolverAdapter.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/src/org/apache/woden/internal/resolver/EntityResolverAdapter.java?view=auto&rev=465571
==============================================================================
--- incubator/woden/trunk/java/src/org/apache/woden/internal/resolver/EntityResolverAdapter.java (added)
+++ incubator/woden/trunk/java/src/org/apache/woden/internal/resolver/EntityResolverAdapter.java Thu Oct 19 04:01:55 2006
@@ -0,0 +1,71 @@
+/**
+ * Copyright 2006 Apache Software Foundation 
+ *
+ * Licensed 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.
+ * 
+ * @author Graham Turrell
+ */
+
+package org.apache.woden.internal.resolver;
+
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import org.xml.sax.EntityResolver;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+public class EntityResolverAdapter implements EntityResolver {
+
+	private org.apache.woden.resolver.URIResolver fActualResolver;
+	
+	public EntityResolverAdapter(org.apache.woden.resolver.URIResolver actualResolver) {
+		fActualResolver = actualResolver;
+	}
+	
+	public InputSource resolveEntity(String publicId, String systemId)
+			throws SAXException, IOException {
+		
+		/* build the URI from args
+		 * 
+		 */
+		URI uri = null;
+		try 
+		{
+			// dumb placeholder:
+			uri = new URI(systemId);
+		} 
+		catch (URISyntaxException e) 
+		{
+			throw new RuntimeException(e);
+		}		
+		
+		/* resolve with target resolver
+		 * 
+		 */		
+		URI resolved = null;
+		try 
+		{
+			resolved = fActualResolver.resolveURI(uri);
+		} 
+		catch (Exception e) 
+		{
+			throw new RuntimeException(e);
+		}
+		
+		// dumb placeholder:
+		return (resolved == null)? null : new InputSource(resolved.toString());
+	}
+
+}

Added: incubator/woden/trunk/java/src/org/apache/woden/internal/resolver/SchemaResolverAdapter.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/src/org/apache/woden/internal/resolver/SchemaResolverAdapter.java?view=auto&rev=465571
==============================================================================
--- incubator/woden/trunk/java/src/org/apache/woden/internal/resolver/SchemaResolverAdapter.java (added)
+++ incubator/woden/trunk/java/src/org/apache/woden/internal/resolver/SchemaResolverAdapter.java Thu Oct 19 04:01:55 2006
@@ -0,0 +1,94 @@
+/**
+ * Copyright 2006 Apache Software Foundation 
+ *
+ * Licensed 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.woden.internal.resolver;
+
+import java.io.File;
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import org.xml.sax.InputSource;
+
+/**
+ * Adapter from woden to ws.commons resolver, for use with XMLSchemaCollection
+ * (Effectively chains ws.commons DefaultURIResolver...)
+ * 
+ * @author Graham Turrell
+ *
+ */
+public class SchemaResolverAdapter implements org.apache.ws.commons.schema.resolver.URIResolver {
+	
+	private org.apache.woden.resolver.URIResolver fActualResolver;
+	
+	public SchemaResolverAdapter(org.apache.woden.resolver.URIResolver actualResolver) {
+		fActualResolver = actualResolver;
+	}
+		
+	public InputSource resolveEntity(String targetNamespace,
+               String schemaLocation,
+               String baseUri
+               ) {
+		
+		/* build the URI from args
+		 * 
+		 */
+		URI uri = null;
+		try 
+		{
+			uri = buildUri(targetNamespace, schemaLocation, baseUri); 
+		} 
+		catch (URISyntaxException e) 
+		{
+			throw new RuntimeException(e);
+		}
+		
+		/* resolve with target resolver
+		 * 
+		 */		
+		URI resolved = null;
+		try 
+		{
+			resolved = fActualResolver.resolveURI(uri);
+		} 
+		catch (Exception e) 
+		{
+			throw new RuntimeException(e);
+		}
+		
+		return new InputSource(resolved != null? resolved.toString() : uri.toString());
+		   
+		   
+	   }
+
+	/* based on ws commons DefaultURIResolver.resolveEntity(...)
+	 * 
+	 */
+	private URI buildUri(String targetNamespace,
+               String schemaLocation,
+               String baseUri) throws URISyntaxException {
+		
+       if (baseUri!=null) 
+        {
+
+    	   File baseFile = new File(baseUri);
+           if (baseFile.exists()) baseUri = baseFile.toURI().toString();
+                
+           return new URI(baseUri).resolve(new URI(schemaLocation));
+
+        }
+        return new URI(schemaLocation);
+		
+	}
+}

Added: incubator/woden/trunk/java/src/org/apache/woden/internal/resolver/SimpleURIResolver.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/src/org/apache/woden/internal/resolver/SimpleURIResolver.java?view=auto&rev=465571
==============================================================================
--- incubator/woden/trunk/java/src/org/apache/woden/internal/resolver/SimpleURIResolver.java (added)
+++ incubator/woden/trunk/java/src/org/apache/woden/internal/resolver/SimpleURIResolver.java Thu Oct 19 04:01:55 2006
@@ -0,0 +1,210 @@
+/**
+ * Copyright 2006 Apache Software Foundation 
+ *
+ * Licensed 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.
+ * 
+ * @author Graham Turrell
+ */
+package org.apache.woden.internal.resolver;
+
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Enumeration;
+import java.util.Hashtable;
+import java.util.Properties;
+
+import org.apache.woden.WSDLException;
+import org.apache.woden.internal.util.PropertyUtils;
+import org.apache.woden.resolver.URIResolver;
+
+/**
+ * A Simple URI Resolver.
+ * 
+ * Locating the catalog file:
+ * These alternatives, listed in search order, are:
+ * 1. JVM system properties (e.g. java -D arguments)
+ * 		use -Dorg.apache.woden.resolver.simpleresolver.catalog="<filespec>" on the command line
+ * 		where <filespec> is the location of the simple resolver catalog on the local file system.
+ * 2. application properties defined in /META-INF/services (e.g. in a jar file)
+ *      (when implemented in PropertyUtils.findProperty(String p)...)
+ * 3. properties defined in a wsdl properties file located in JAVAHOME/lib directory
+ * 		For (2) and (3) use regular property assignment notation:
+ *      org.apache.woden.resolver.simpleresolver.catalog="<filespec>"
+ *      
+ *  Catalog file format:
+ *  This is as for Java Properties file format, with one entry for each resolution mapping:
+ *  <listed document URI>=<physical location>.
+ *  
+ *  A typical catalog will include resolutions of XML schema and associated documents, sufficient to
+ *  run the parser "offline".
+ *  Example catalog file contents:
+ *  
+ *  	# standard resolutions for XML Schema
+ *  	# {referenced URI}={actual location}
+ *  	#
+ *  	http\://www.w3.org/2006/01/wsdl/wsdl20.xsd=file:///c:/schema/wsdl20.xsd
+ *  	http\://www.w3.org/2001/XMLSchema.xsd=file:///c:/schema/XMLSchema.xsd
+ *  	http\://www.w3.org/2006/01/wsdl-extensions.xsd=file:///c:/schema/wsdl-extensions.xsd
+ *  	# end
+ *  
+ *  Note the use of backslash on the first colon of each line.
+ *  Also {actual location} is treated as a URI but for local files the abbreviated form can be used
+ *  like this:
+ *  
+ *  	http\://www.w3.org/2006/01/wsdl/wsdl20.xsd=c:/schema/wsdl20.xsd 
+ */
+
+public class SimpleURIResolver implements URIResolver {
+		
+	private final String RESOLVER_PROPERTIES_PROPERTY="org.apache.woden.resolver.simpleresolver.catalog";
+	private final String ResolverPropertiesFile = PropertyUtils.findProperty(RESOLVER_PROPERTIES_PROPERTY);
+	private Hashtable uriTable = null;
+	
+	public SimpleURIResolver() throws WSDLException {
+		
+		// read & retain the resolver references from properties file.
+		Properties properties = new Properties();
+	    try 
+	    {
+	    	if (ResolverPropertiesFile != null) {
+	    		properties.load(new FileInputStream(ResolverPropertiesFile));
+	    	}
+	    } 
+	    catch (FileNotFoundException e) {
+	    	// treat missing properties file as empty file, ie no resolves specified.
+	    	// TODO log this
+	    }
+	    catch (IOException e) {
+	    	// load() failed, continue with no resolves
+	    	// TODO log this
+	    }
+	    
+	    // convert keys and values to URIs
+	    try 
+	    {
+	    	uriTable = toURI(properties);
+	    } 
+	    catch (URISyntaxException e) {
+			throw new WSDLException(WSDLException.CONFIGURATION_ERROR,
+                    "Problem instantiating the URI resolution table.",
+                    e);
+		}
+	}
+
+	/** 
+	 * Alternative constructor that accepts a properties object representing
+	 * catalog entries instead of reading a catalog file...
+	 */
+	public SimpleURIResolver(Properties properties) throws WSDLException {
+
+	    // convert provided keys and values to URIs
+	    try 
+	    {
+	    	uriTable = toURI(properties);
+	    } catch (URISyntaxException e) {
+			throw new WSDLException(WSDLException.CONFIGURATION_ERROR,
+                    "Problem instantiating the URI resolution table.",
+                    e);
+		}
+	}
+	
+	/** 
+	 * Alternative constructor that accepts a root URI String from which
+	 * *all* resolve-target entries in the supplied catalog are considered to
+	 * be based.
+	 */
+	public SimpleURIResolver(String rootURI) throws WSDLException {
+
+		// read & retain the resolver references from properties file.
+		Properties properties = new Properties();
+	    try 
+	    {
+	    	if (ResolverPropertiesFile != null) {
+	    		properties.load(new FileInputStream(ResolverPropertiesFile));
+	    	}
+	    } 
+	    catch (FileNotFoundException e) {
+	    	// treat missing properties file as empty file, ie no resolves specified.
+	    	// TODO log this
+	    }
+	    catch (IOException e) {
+	    	// load() failed, continue with no resolves
+	    	// TODO log this
+	    }
+	    
+	    // convert provided keys and values to URIs
+	    try 
+	    {
+	    	uriTable = toURI(properties, rootURI);
+	    } catch (URISyntaxException e) {
+			throw new WSDLException(WSDLException.CONFIGURATION_ERROR,
+                    "Problem instantiating the URI resolution table.",
+                    e);
+		}
+	}
+	
+	public URI resolveURI(URI uri) throws WSDLException {
+		URI resolvedURI = null;
+		if (uriTable.containsKey(uri)) 
+		{ // TODO is this sufficient?
+			resolvedURI = (URI)uriTable.get(uri); 
+		}
+		return resolvedURI;
+	}
+	
+	/**
+	 * Convert resolve elements Properties (Hashtable of Strings) to Hashtable of URIs
+	 * 
+	 * @param p - set of properties representing initial catalog
+	 * @return
+	 * @throws URISyntaxException
+	 */
+	// TODO could replace with a call to toURI(p, null)
+	private Hashtable toURI(Properties p) throws URISyntaxException {
+		Hashtable h = new Hashtable();
+		if (p != null)
+		{
+			Enumeration keys = p.keys();
+			while (keys.hasMoreElements()) {
+				String key = (String)keys.nextElement();
+				String value = p.getProperty(key);
+				h.put(new URI(key), new URI(value));			
+			}
+		}
+		return h;
+	}
+	/**
+	 * Convert resolve elements Properties (Hashtable of Strings) to Hashtable of URIs
+	 * 
+	 * @param p - set of properties representing initial catalog
+	 * @param root - URI to prepend to each resolved URI in the catalog
+	 * @return
+	 * @throws URISyntaxException
+	 */
+	private Hashtable toURI(Properties p, String root) throws URISyntaxException {
+		Hashtable h = new Hashtable();
+		if (p != null)
+		{
+			Enumeration keys = p.keys();
+			while (keys.hasMoreElements()) {
+				String key = (String)keys.nextElement();
+				String value = root + p.getProperty(key);
+				h.put(new URI(key), new URI(value));			
+			}
+		}
+		return h;
+	}
+}

Added: incubator/woden/trunk/java/src/org/apache/woden/resolver/URIResolver.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/src/org/apache/woden/resolver/URIResolver.java?view=auto&rev=465571
==============================================================================
--- incubator/woden/trunk/java/src/org/apache/woden/resolver/URIResolver.java (added)
+++ incubator/woden/trunk/java/src/org/apache/woden/resolver/URIResolver.java Thu Oct 19 04:01:55 2006
@@ -0,0 +1,52 @@
+/**
+ * Copyright 2006 Apache Software Foundation 
+ *
+ * Licensed 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.
+ * 
+ *  @author Graham Turrell
+ */
+package org.apache.woden.resolver;
+
+import java.io.IOException;
+import java.net.URI;
+
+import org.apache.woden.WSDLException;
+
+/**
+ *  URI Resolver interface
+ *  
+ *  To associate a URI resolver programmatically, the following should be called prior to parser invocation.
+ *  Example:
+ *  
+ *  	WSDLFactory factory = WSDLFactory.newInstance();
+ *  	WSDLReader reader = factory.newWSDLReader();
+ *  	URIResolver resolver = new XXXURIResolver(); // XXXURIResolver implements this interface
+ *  	reader.setURIResolver(resolver);
+ *  	...
+ *  	DescriptionElement descElem = reader.readWSDL(wsdlurl);
+ * 
+ *
+ */
+public interface URIResolver {
+	
+	/** 
+	 * Implementation should return null if there is no resolution for the uri
+	 * 
+	 * @param uri
+	 * @return
+	 * @throws WSDLException
+	 * @throws IOException
+	 */
+	public URI resolveURI(URI uri) throws WSDLException, IOException;
+
+}

Modified: incubator/woden/trunk/java/test/javax/xml/namespace/QNameTest.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/test/javax/xml/namespace/QNameTest.java?view=diff&rev=465571&r1=465570&r2=465571
==============================================================================
--- incubator/woden/trunk/java/test/javax/xml/namespace/QNameTest.java (original)
+++ incubator/woden/trunk/java/test/javax/xml/namespace/QNameTest.java Thu Oct 19 04:01:55 2006
@@ -459,7 +459,7 @@
         
         URL url = getClass().getClassLoader().getResource("javax/xml/namespace/serialized_QName_no_prefix");
 
-        File f = new File(url.getFile());
+        File f = new File(url.getFile().replaceAll("%20", " "));
         
         ObjectInputStream ois =
             new ObjectInputStream(new FileInputStream(f));

Added: incubator/woden/trunk/java/test/org/apache/woden/resolver/OMSimpleURIResolverTest.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/test/org/apache/woden/resolver/OMSimpleURIResolverTest.java?view=auto&rev=465571
==============================================================================
--- incubator/woden/trunk/java/test/org/apache/woden/resolver/OMSimpleURIResolverTest.java (added)
+++ incubator/woden/trunk/java/test/org/apache/woden/resolver/OMSimpleURIResolverTest.java Thu Oct 19 04:01:55 2006
@@ -0,0 +1,236 @@
+/**
+ * Copyright 2006 Apache Software Foundation 
+ *
+ * Licensed 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.woden.resolver;
+
+
+import java.io.IOException;
+import java.net.URL;
+import java.net.URLConnection;
+import java.util.Iterator;
+import java.util.Properties;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+import org.apache.woden.ErrorHandler;
+import org.apache.woden.WSDLFactory;
+import org.apache.woden.WSDLReader;
+import org.apache.woden.internal.OMWSDLFactory;
+import org.apache.woden.internal.resolver.SimpleURIResolver;
+import org.apache.woden.schema.ImportedSchema;
+import org.apache.woden.schema.InlinedSchema;
+import org.apache.woden.schema.Schema;
+import org.apache.woden.tests.TestErrorHandler;
+import org.apache.woden.wsdl20.Binding;
+import org.apache.woden.wsdl20.Description;
+import org.apache.woden.wsdl20.Interface;
+import org.apache.woden.wsdl20.xml.DescriptionElement;
+import org.apache.woden.wsdl20.xml.TypesElement;
+import org.apache.ws.commons.schema.XmlSchema;
+import org.apache.ws.commons.schema.XmlSchemaExternal;
+import org.apache.ws.commons.schema.XmlSchemaImport;
+import org.apache.ws.commons.schema.XmlSchemaInclude;
+import org.apache.ws.commons.schema.XmlSchemaObjectCollection;
+
+/**
+ * Functional verification test of SimpleURIResolver.
+ * 
+ * @author Graham Turrell
+ */
+public class OMSimpleURIResolverTest extends TestCase 
+{
+    private Binding[] fBindings = null;
+    private Interface[] fInterfaces = null;
+    private Schema[] fSchemas = null;
+	private ImportedSchema[] fImportedSchemas = null;
+	private InlinedSchema[] fInlinedSchemas = null;
+    private String fCatalogPropValue = null;
+    private String fHttpProxyHostValue = null;
+    private String fHttpProxyHostProperty = "http.proxyHost";
+    private String fCatalogProperty = "org.apache.woden.resolver.simpleresolver.catalog";
+    private String fWsdlPath = "org/apache/woden/resolver/resources/woden14.wsdl";
+    private String fCatalogPath = "org/apache/woden/resolver/resources/simpleresolver.catalog";
+    private String fResources = "org/apache/woden/resolver/resources/";
+    
+
+    public static Test suite()
+    {
+        return new TestSuite(OMSimpleURIResolverTest.class);
+    }
+    
+    /*
+     * @see TestCase#setUp()
+     */
+    protected void setUp() throws Exception 
+    {
+        super.setUp();
+        
+        // disable external http connections to ensure that test resolves only to local files
+        // specify a fantasy proxy host server fo use by HttpURLConnection ...
+        fHttpProxyHostValue = System.setProperty(fHttpProxyHostProperty, "proxy.thedomainforthisproxydoesnotexist.com");
+        
+        // ensure any external (http) connection now fails
+    	URLConnection testConnection = null;
+    	try
+        {
+        	testConnection = new URL("www.apache.org").openConnection();
+        } 
+    	catch (IOException e){
+        	
+        }
+        assertNull("Expected no connection IOException due to non-existent HTTP Proxy.", testConnection);
+        
+        // locate catalog file and set org.apache.woden.resolver.simpleresolver.catalog
+        // property to be that file.
+        
+        URL catalogURL = getClass().getClassLoader().getResource(fCatalogPath);
+        assertNotNull("Failed to find the Resolver Catalog document on the classpath using the path: " + fCatalogPath + ".", 
+        		catalogURL);
+        // simulate the standard compiler "-D" option ...
+        // (cater for URL space char representation)
+        fCatalogPropValue = System.setProperty(fCatalogProperty, catalogURL.getFile().replaceAll("%20", " ")); 
+        
+        WSDLFactory factory = OMWSDLFactory.newInstance();
+        WSDLReader reader = factory.newWSDLReader();
+        ErrorHandler handler = new TestErrorHandler();
+        reader.setFeature(WSDLReader.FEATURE_VALIDATION, true);
+        reader.getErrorReporter().setErrorHandler(handler);
+        
+        URL wsdlURL = getClass().getClassLoader().getResource(fWsdlPath);
+        assertNotNull("Failed to find the WSDL document on the classpath using the path: " + fWsdlPath + ".", 
+                wsdlURL);
+        
+        URL rootURL = getClass().getClassLoader().getResource(fResources);
+        assertNotNull("Failed to find the Base URL document on the classpath using the path: " + fResources + ".", 
+                wsdlURL);
+
+		// set the resolver explicitly, using the root as a base URL 
+		// (SimpleURIResolver() default constructor is the default behaviour)
+		reader.setURIResolver(new SimpleURIResolver(rootURL.toString()));
+		
+        DescriptionElement descElem = reader.readWSDL(wsdlURL.toString().replaceAll("%20", " "));
+        assertNotNull("The reader did not return a WSDL description.", descElem);
+        Description descComp = descElem.toComponent();
+        
+        fBindings = descComp.getBindings();
+        fInterfaces = descComp.getInterfaces();
+        
+        TypesElement types = descElem.getTypesElement();	
+		fSchemas = types.getSchemas();
+		fImportedSchemas = types.getImportedSchemas();
+		fInlinedSchemas = types.getInlinedSchemas();
+        
+        assertEquals("The Description should contain 1 Binding component.", 1, fBindings.length);
+        assertEquals("The Description should contain 1 Interface component.", 1, fInterfaces.length);
+        assertEquals("The Description should contain 1 imported schema.", 1, fImportedSchemas.length);
+        assertEquals("The Description should contain 1 included (inlined) schema.", 1, fInlinedSchemas.length);
+        assertEquals("The Description should contain total of 2 imported & inlined schema.", 2, fSchemas.length);
+    }
+    
+  /**
+  * Test that the included binding matches the expected value parsed from the WSDL.
+  */
+ public void testCheckWSDLInclude()
+ {
+     Binding binding1 = fBindings[0];
+    
+     assertEquals("Unexpected binding name.", "{http://example.com/bank}BankSOAPBinding", binding1.getName().toString());
+ }
+ 
+ /**
+  * Test that the imported interface matches the expected value parsed from the WSDL.
+  */
+ public void testCheckWSDLImport()
+ {
+     Interface interface1 = fInterfaces[0];
+    
+     assertEquals("Unexpected interface name.", "{http://example.com/bank}Bank", interface1.getName().toString());
+ }
+ 
+ /**
+  * Test that the imported schema document matches the expected value parsed from the WSDL.
+  */
+ public void testCheckSchemaImport()
+ {
+	 Schema schema1 = fSchemas[0];
+     XmlSchema xmlSchema = schema1.getSchemaDefinition();
+     assertEquals("Unexpected targetNamespace.", "http://example.org/getAccountDetails/", schema1.getNamespace().toString());
+     
+     XmlSchemaObjectCollection schemaIncludes = xmlSchema.getIncludes(); // returns both includes and imports
+	 Iterator schemaIterator = schemaIncludes.getIterator();
+	 while (schemaIterator.hasNext()) 
+	 {
+		XmlSchemaExternal xso = (XmlSchemaExternal) schemaIterator.next();
+		if (xso instanceof XmlSchemaImport) 
+		{
+			assertEquals("Unexpected namespace.", "http://example.org/getOverdraft", ((XmlSchemaImport)xso).getNamespace());
+			assertEquals("Unexpected schemaLocation.", "http://test.com/getOverdraft.xsd", xso.getSchemaLocation());
+		}
+	 }
+ }
+ 
+ /**
+  * Test that the included schema document matches the expected value parsed from the WSDL.
+  */
+ public void testCheckSchemaInclude()
+ {
+	 InlinedSchema schema1 = fInlinedSchemas[0];
+	 XmlSchema xmlSchema = schema1.getSchemaDefinition();
+	 assertEquals("Unexpected targetNamespace.", "http://example.org/getAccountDetails/", schema1.getNamespace().toString());
+	     
+	 XmlSchemaObjectCollection schemaIncludes = xmlSchema.getIncludes(); // returns both includes and imports
+     Iterator schemaIterator = schemaIncludes.getIterator();
+	 while (schemaIterator.hasNext()) 
+	 {
+		XmlSchemaExternal xso = (XmlSchemaExternal) schemaIterator.next();
+		if (xso instanceof XmlSchemaInclude) 
+		{
+			assertEquals("Unexpected schemaLocation.", "http://test.com/getBalance.xsd", xso.getSchemaLocation());
+		}
+	 }
+ }
+ 
+ 
+ protected void tearDown() throws Exception 
+ {
+	 Properties p = System.getProperties();
+	 if (fCatalogPropValue == null)
+	 {
+		 p.remove(fCatalogProperty);
+	 }
+	 else 
+	 {
+		 p.setProperty(fCatalogProperty, fCatalogPropValue);
+	 }
+	 
+	 if (fHttpProxyHostValue == null)
+	 {
+		 p.remove(fHttpProxyHostProperty);
+	 }
+	 else 
+	 {
+		 p.setProperty(fHttpProxyHostProperty, fHttpProxyHostValue);
+	 }
+
+	 // above required as following throws NPE when arg1 == null (contrary to spec)
+	 //System.setProperty(fCatalogProperty, fCatalogPropValue);
+	 //System.setProperty("http.proxyHost", fHttpProxyHostValue);
+	 
+	 System.setProperties(p);
+ }
+   
+}

Added: incubator/woden/trunk/java/test/org/apache/woden/resolver/SimpleURIResolverTest.java
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/test/org/apache/woden/resolver/SimpleURIResolverTest.java?view=auto&rev=465571
==============================================================================
--- incubator/woden/trunk/java/test/org/apache/woden/resolver/SimpleURIResolverTest.java (added)
+++ incubator/woden/trunk/java/test/org/apache/woden/resolver/SimpleURIResolverTest.java Thu Oct 19 04:01:55 2006
@@ -0,0 +1,235 @@
+/**
+ * Copyright 2006 Apache Software Foundation 
+ *
+ * Licensed 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.woden.resolver;
+
+
+import java.io.IOException;
+import java.net.URL;
+import java.net.URLConnection;
+import java.util.Iterator;
+import java.util.Properties;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+import org.apache.woden.ErrorHandler;
+import org.apache.woden.WSDLFactory;
+import org.apache.woden.WSDLReader;
+import org.apache.woden.internal.resolver.SimpleURIResolver;
+import org.apache.woden.schema.ImportedSchema;
+import org.apache.woden.schema.InlinedSchema;
+import org.apache.woden.schema.Schema;
+import org.apache.woden.tests.TestErrorHandler;
+import org.apache.woden.wsdl20.Binding;
+import org.apache.woden.wsdl20.Description;
+import org.apache.woden.wsdl20.Interface;
+import org.apache.woden.wsdl20.xml.DescriptionElement;
+import org.apache.woden.wsdl20.xml.TypesElement;
+import org.apache.ws.commons.schema.XmlSchema;
+import org.apache.ws.commons.schema.XmlSchemaExternal;
+import org.apache.ws.commons.schema.XmlSchemaImport;
+import org.apache.ws.commons.schema.XmlSchemaInclude;
+import org.apache.ws.commons.schema.XmlSchemaObjectCollection;
+
+/**
+ * Functional verification test of SimpleURIResolver.
+ * 
+ * @author Graham Turrell
+ */
+public class SimpleURIResolverTest extends TestCase 
+{
+    private Binding[] fBindings = null;
+    private Interface[] fInterfaces = null;
+    private Schema[] fSchemas = null;
+	private ImportedSchema[] fImportedSchemas = null;
+	private InlinedSchema[] fInlinedSchemas = null;
+    private String fCatalogPropValue = null;
+    private String fHttpProxyHostValue = null;
+    private String fHttpProxyHostProperty = "http.proxyHost";
+    private String fCatalogProperty = "org.apache.woden.resolver.simpleresolver.catalog";
+    private String fWsdlPath = "org/apache/woden/resolver/resources/woden14.wsdl";
+    private String fCatalogPath = "org/apache/woden/resolver/resources/simpleresolver.catalog";
+    private String fResources = "org/apache/woden/resolver/resources/";
+    
+
+    public static Test suite()
+    {
+        return new TestSuite(SimpleURIResolverTest.class);
+    }
+    
+    /*
+     * @see TestCase#setUp()
+     */
+    protected void setUp() throws Exception 
+    {
+        super.setUp();
+        
+        // disable external http connections to ensure that test resolves only to local files
+        // specify a fantasy proxy host server fo use by HttpURLConnection ...
+        fHttpProxyHostValue = System.setProperty(fHttpProxyHostProperty, "proxy.thedomainforthisproxydoesnotexist.com");
+        
+        // ensure any external (http) connection now fails
+    	URLConnection testConnection = null;
+    	try
+        {
+        	testConnection = new URL("www.apache.org").openConnection();
+        } 
+    	catch (IOException e){
+        	
+        }
+        assertNull("Expected no connection IOException due to non-existent HTTP Proxy.", testConnection);
+        
+        // locate catalog file and set org.apache.woden.resolver.simpleresolver.catalog
+        // property to be that file.
+        
+        URL catalogURL = getClass().getClassLoader().getResource(fCatalogPath);
+        assertNotNull("Failed to find the Resolver Catalog document on the classpath using the path: " + fCatalogPath + ".", 
+        		catalogURL);
+        // simulate the standard compiler "-D" option ...
+        // (cater for URL space char representation)
+        fCatalogPropValue = System.setProperty(fCatalogProperty, catalogURL.getFile().replaceAll("%20", " ")); 
+        
+        WSDLFactory factory = WSDLFactory.newInstance();
+        WSDLReader reader = factory.newWSDLReader();
+        ErrorHandler handler = new TestErrorHandler();
+        reader.setFeature(WSDLReader.FEATURE_VALIDATION, true);
+        reader.getErrorReporter().setErrorHandler(handler);
+        
+        URL wsdlURL = getClass().getClassLoader().getResource(fWsdlPath);
+        assertNotNull("Failed to find the WSDL document on the classpath using the path: " + fWsdlPath + ".", 
+                wsdlURL);
+        
+        URL rootURL = getClass().getClassLoader().getResource(fResources);
+        assertNotNull("Failed to find the Base URL document on the classpath using the path: " + fResources + ".", 
+                wsdlURL);
+
+		// set the resolver explicitly, using the root as a base URL 
+		// (SimpleURIResolver() default constructor is the default behaviour)
+		reader.setURIResolver(new SimpleURIResolver(rootURL.toString()));
+		
+        DescriptionElement descElem = reader.readWSDL(wsdlURL.toString().replaceAll("%20", " "));
+        assertNotNull("The reader did not return a WSDL description.", descElem);
+        Description descComp = descElem.toComponent();
+        
+        fBindings = descComp.getBindings();
+        fInterfaces = descComp.getInterfaces();
+        
+        TypesElement types = descElem.getTypesElement();	
+		fSchemas = types.getSchemas();
+		fImportedSchemas = types.getImportedSchemas();
+		fInlinedSchemas = types.getInlinedSchemas();
+        
+        assertEquals("The Description should contain 1 Binding component.", 1, fBindings.length);
+        assertEquals("The Description should contain 1 Interface component.", 1, fInterfaces.length);
+        assertEquals("The Description should contain 1 imported schema.", 1, fImportedSchemas.length);
+        assertEquals("The Description should contain 1 included (inlined) schema.", 1, fInlinedSchemas.length);
+        assertEquals("The Description should contain total of 2 imported & inlined schema.", 2, fSchemas.length);
+    }
+    
+  /**
+  * Test that the included binding matches the expected value parsed from the WSDL.
+  */
+ public void testCheckWSDLInclude()
+ {
+     Binding binding1 = fBindings[0];
+    
+     assertEquals("Unexpected binding name.", "{http://example.com/bank}BankSOAPBinding", binding1.getName().toString());
+ }
+ 
+ /**
+  * Test that the imported interface matches the expected value parsed from the WSDL.
+  */
+ public void testCheckWSDLImport()
+ {
+     Interface interface1 = fInterfaces[0];
+    
+     assertEquals("Unexpected interface name.", "{http://example.com/bank}Bank", interface1.getName().toString());
+ }
+ 
+ /**
+  * Test that the imported schema document matches the expected value parsed from the WSDL.
+  */
+ public void testCheckSchemaImport()
+ {
+	 Schema schema1 = fSchemas[0];
+     XmlSchema xmlSchema = schema1.getSchemaDefinition();
+     assertEquals("Unexpected targetNamespace.", "http://example.org/getAccountDetails/", schema1.getNamespace().toString());
+     
+     XmlSchemaObjectCollection schemaIncludes = xmlSchema.getIncludes(); // returns both includes and imports
+	 Iterator schemaIterator = schemaIncludes.getIterator();
+	 while (schemaIterator.hasNext()) 
+	 {
+		XmlSchemaExternal xso = (XmlSchemaExternal) schemaIterator.next();
+		if (xso instanceof XmlSchemaImport) 
+		{
+			assertEquals("Unexpected namespace.", "http://example.org/getOverdraft", ((XmlSchemaImport)xso).getNamespace());
+			assertEquals("Unexpected schemaLocation.", "http://test.com/getOverdraft.xsd", xso.getSchemaLocation());
+		}
+	 }
+ }
+ 
+ /**
+  * Test that the included schema document matches the expected value parsed from the WSDL.
+  */
+ public void testCheckSchemaInclude()
+ {
+	 InlinedSchema schema1 = fInlinedSchemas[0];
+	 XmlSchema xmlSchema = schema1.getSchemaDefinition();
+	 assertEquals("Unexpected targetNamespace.", "http://example.org/getAccountDetails/", schema1.getNamespace().toString());
+	     
+	 XmlSchemaObjectCollection schemaIncludes = xmlSchema.getIncludes(); // returns both includes and imports
+     Iterator schemaIterator = schemaIncludes.getIterator();
+	 while (schemaIterator.hasNext()) 
+	 {
+		XmlSchemaExternal xso = (XmlSchemaExternal) schemaIterator.next();
+		if (xso instanceof XmlSchemaInclude) 
+		{
+			assertEquals("Unexpected schemaLocation.", "http://test.com/getBalance.xsd", xso.getSchemaLocation());
+		}
+	 }
+ }
+ 
+ 
+ protected void tearDown() throws Exception 
+ {
+	 Properties p = System.getProperties();
+	 if (fCatalogPropValue == null)
+	 {
+		 p.remove(fCatalogProperty);
+	 }
+	 else 
+	 {
+		 p.setProperty(fCatalogProperty, fCatalogPropValue);
+	 }
+	 
+	 if (fHttpProxyHostValue == null)
+	 {
+		 p.remove(fHttpProxyHostProperty);
+	 }
+	 else 
+	 {
+		 p.setProperty(fHttpProxyHostProperty, fHttpProxyHostValue);
+	 }
+
+	 // above required as following throws NPE when arg1 == null (contrary to spec)
+	 //System.setProperty(fCatalogProperty, fCatalogPropValue);
+	 //System.setProperty("http.proxyHost", fHttpProxyHostValue);
+	 
+	 System.setProperties(p);
+ }
+   
+}

Added: incubator/woden/trunk/java/test/org/apache/woden/resolver/resources/XMLSchema.dtd
URL: http://svn.apache.org/viewvc/incubator/woden/trunk/java/test/org/apache/woden/resolver/resources/XMLSchema.dtd?view=auto&rev=465571
==============================================================================
--- incubator/woden/trunk/java/test/org/apache/woden/resolver/resources/XMLSchema.dtd (added)
+++ incubator/woden/trunk/java/test/org/apache/woden/resolver/resources/XMLSchema.dtd Thu Oct 19 04:01:55 2006
@@ -0,0 +1,402 @@
+<!-- DTD for XML Schemas: Part 1: Structures
+     Public Identifier: "-//W3C//DTD XMLSCHEMA 200102//EN"
+     Official Location: http://www.w3.org/2001/XMLSchema.dtd -->
+<!-- $Id: XMLSchema.dtd,v 1.31 2001/10/24 15:50:16 ht Exp $ -->
+<!-- Note this DTD is NOT normative, or even definitive. -->           <!--d-->
+<!-- prose copy in the structures REC is the definitive version -->    <!--d-->
+<!-- (which shouldn't differ from this one except for this -->         <!--d-->
+<!-- comment and entity expansions, but just in case) -->              <!--d-->
+<!-- With the exception of cases with multiple namespace
+     prefixes for the XML Schema namespace, any XML document which is
+     not valid per this DTD given redefinitions in its internal subset of the
+     'p' and 's' parameter entities below appropriate to its namespace
+     declaration of the XML Schema namespace is almost certainly not
+     a valid schema. -->
+
+<!-- The simpleType element and its constituent parts
+     are defined in XML Schema: Part 2: Datatypes -->
+<!ENTITY % xs-datatypes PUBLIC 'datatypes' 'datatypes.dtd' >
+
+<!ENTITY % p 'xs:'> <!-- can be overriden in the internal subset of a
+                         schema document to establish a different
+                         namespace prefix -->
+<!ENTITY % s ':xs'> <!-- if %p is defined (e.g. as foo:) then you must
+                         also define %s as the suffix for the appropriate
+                         namespace declaration (e.g. :foo) -->
+<!ENTITY % nds 'xmlns%s;'>
+
+<!-- Define all the element names, with optional prefix -->
+<!ENTITY % schema "%p;schema">
+<!ENTITY % complexType "%p;complexType">
+<!ENTITY % complexContent "%p;complexContent">
+<!ENTITY % simpleContent "%p;simpleContent">
+<!ENTITY % extension "%p;extension">
+<!ENTITY % element "%p;element">
+<!ENTITY % unique "%p;unique">
+<!ENTITY % key "%p;key">
+<!ENTITY % keyref "%p;keyref">
+<!ENTITY % selector "%p;selector">
+<!ENTITY % field "%p;field">
+<!ENTITY % group "%p;group">
+<!ENTITY % all "%p;all">
+<!ENTITY % choice "%p;choice">
+<!ENTITY % sequence "%p;sequence">
+<!ENTITY % any "%p;any">
+<!ENTITY % anyAttribute "%p;anyAttribute">
+<!ENTITY % attribute "%p;attribute">
+<!ENTITY % attributeGroup "%p;attributeGroup">
+<!ENTITY % include "%p;include">
+<!ENTITY % import "%p;import">
+<!ENTITY % redefine "%p;redefine">
+<!ENTITY % notation "%p;notation">
+
+<!-- annotation elements -->
+<!ENTITY % annotation "%p;annotation">
+<!ENTITY % appinfo "%p;appinfo">
+<!ENTITY % documentation "%p;documentation">
+
+<!-- Customisation entities for the ATTLIST of each element type.
+     Define one of these if your schema takes advantage of the
+     anyAttribute='##other' in the schema for schemas -->
+
+<!ENTITY % schemaAttrs ''>
+<!ENTITY % complexTypeAttrs ''>
+<!ENTITY % complexContentAttrs ''>
+<!ENTITY % simpleContentAttrs ''>
+<!ENTITY % extensionAttrs ''>
+<!ENTITY % elementAttrs ''>
+<!ENTITY % groupAttrs ''>
+<!ENTITY % allAttrs ''>
+<!ENTITY % choiceAttrs ''>
+<!ENTITY % sequenceAttrs ''>
+<!ENTITY % anyAttrs ''>
+<!ENTITY % anyAttributeAttrs ''>
+<!ENTITY % attributeAttrs ''>
+<!ENTITY % attributeGroupAttrs ''>
+<!ENTITY % uniqueAttrs ''>
+<!ENTITY % keyAttrs ''>
+<!ENTITY % keyrefAttrs ''>
+<!ENTITY % selectorAttrs ''>
+<!ENTITY % fieldAttrs ''>
+<!ENTITY % includeAttrs ''>
+<!ENTITY % importAttrs ''>
+<!ENTITY % redefineAttrs ''>
+<!ENTITY % notationAttrs ''>
+<!ENTITY % annotationAttrs ''>
+<!ENTITY % appinfoAttrs ''>
+<!ENTITY % documentationAttrs ''>
+
+<!ENTITY % complexDerivationSet "CDATA">
+      <!-- #all or space-separated list drawn from derivationChoice -->
+<!ENTITY % blockSet "CDATA">
+      <!-- #all or space-separated list drawn from
+                      derivationChoice + 'substitution' -->
+
+<!ENTITY % mgs '%all; | %choice; | %sequence;'>
+<!ENTITY % cs '%choice; | %sequence;'>
+<!ENTITY % formValues '(qualified|unqualified)'>
+
+
+<!ENTITY % attrDecls    '((%attribute;| %attributeGroup;)*,(%anyAttribute;)?)'>
+
+<!ENTITY % particleAndAttrs '((%mgs; | %group;)?, %attrDecls;)'>
+
+<!-- This is used in part2 -->
+<!ENTITY % restriction1 '((%mgs; | %group;)?)'>
+
+%xs-datatypes;
+
+<!-- the duplication below is to produce an unambiguous content model
+     which allows annotation everywhere -->
+<!ELEMENT %schema; ((%include; | %import; | %redefine; | %annotation;)*,
+                    ((%simpleType; | %complexType;
+                      | %element; | %attribute;
+                      | %attributeGroup; | %group;
+                      | %notation; ),
+                     (%annotation;)*)* )>
+<!ATTLIST %schema;
+   targetNamespace      %URIref;               #IMPLIED
+   version              CDATA                  #IMPLIED
+   %nds;                %URIref;               #FIXED 'http://www.w3.org/2001/XMLSchema'
+   xmlns                CDATA                  #IMPLIED
+   finalDefault         %complexDerivationSet; ''
+   blockDefault         %blockSet;             ''
+   id                   ID                     #IMPLIED
+   elementFormDefault   %formValues;           'unqualified'
+   attributeFormDefault %formValues;           'unqualified'
+   xml:lang             CDATA                  #IMPLIED
+   %schemaAttrs;>
+<!-- Note the xmlns declaration is NOT in the Schema for Schemas,
+     because at the Infoset level where schemas operate,
+     xmlns(:prefix) is NOT an attribute! -->
+<!-- The declaration of xmlns is a convenience for schema authors -->
+ 
+<!-- The id attribute here and below is for use in external references
+     from non-schemas using simple fragment identifiers.
+     It is NOT used for schema-to-schema reference, internal or
+     external. -->
+
+<!-- a type is a named content type specification which allows attribute
+     declarations-->
+<!-- -->
+
+<!ELEMENT %complexType; ((%annotation;)?,
+                         (%simpleContent;|%complexContent;|
+                          %particleAndAttrs;))>
+
+<!ATTLIST %complexType;
+          name      %NCName;                        #IMPLIED
+          id        ID                              #IMPLIED
+          abstract  %boolean;                       #IMPLIED
+          final     %complexDerivationSet;          #IMPLIED
+          block     %complexDerivationSet;          #IMPLIED
+          mixed (true|false) 'false'
+          %complexTypeAttrs;>
+
+<!-- particleAndAttrs is shorthand for a root type -->
+<!-- mixed is disallowed if simpleContent, overriden if complexContent
+     has one too. -->
+
+<!-- If anyAttribute appears in one or more referenced attributeGroups
+     and/or explicitly, the intersection of the permissions is used -->
+
+<!ELEMENT %complexContent; ((%annotation;)?, (%restriction;|%extension;))>
+<!ATTLIST %complexContent;
+          mixed (true|false) #IMPLIED
+          id    ID           #IMPLIED
+          %complexContentAttrs;>
+
+<!-- restriction should use the branch defined above, not the simple
+     one from part2; extension should use the full model  -->
+
+<!ELEMENT %simpleContent; ((%annotation;)?, (%restriction;|%extension;))>
+<!ATTLIST %simpleContent;
+          id    ID           #IMPLIED
+          %simpleContentAttrs;>
+
+<!-- restriction should use the simple branch from part2, not the 
+     one defined above; extension should have no particle  -->
+
+<!ELEMENT %extension; ((%annotation;)?, (%particleAndAttrs;))>
+<!ATTLIST %extension;
+          base  %QName;      #REQUIRED
+          id    ID           #IMPLIED
+          %extensionAttrs;>
+
+<!-- an element is declared by either:
+ a name and a type (either nested or referenced via the type attribute)
+ or a ref to an existing element declaration -->
+
+<!ELEMENT %element; ((%annotation;)?, (%complexType;| %simpleType;)?,
+                     (%unique; | %key; | %keyref;)*)>
+<!-- simpleType or complexType only if no type|ref attribute -->
+<!-- ref not allowed at top level -->
+<!ATTLIST %element;
+            name               %NCName;               #IMPLIED
+            id                 ID                     #IMPLIED
+            ref                %QName;                #IMPLIED
+            type               %QName;                #IMPLIED
+            minOccurs          %nonNegativeInteger;   #IMPLIED
+            maxOccurs          CDATA                  #IMPLIED
+            nillable           %boolean;              #IMPLIED
+            substitutionGroup  %QName;                #IMPLIED
+            abstract           %boolean;              #IMPLIED
+            final              %complexDerivationSet; #IMPLIED
+            block              %blockSet;             #IMPLIED
+            default            CDATA                  #IMPLIED
+            fixed              CDATA                  #IMPLIED
+            form               %formValues;           #IMPLIED
+            %elementAttrs;>
+<!-- type and ref are mutually exclusive.
+     name and ref are mutually exclusive, one is required -->
+<!-- In the absence of type AND ref, type defaults to type of
+     substitutionGroup, if any, else the ur-type, i.e. unconstrained -->
+<!-- default and fixed are mutually exclusive -->
+
+<!ELEMENT %group; ((%annotation;)?,(%mgs;)?)>
+<!ATTLIST %group; 
+          name        %NCName;               #IMPLIED
+          ref         %QName;                #IMPLIED
+          minOccurs   %nonNegativeInteger;   #IMPLIED
+          maxOccurs   CDATA                  #IMPLIED
+          id          ID                     #IMPLIED
+          %groupAttrs;>
+
+<!ELEMENT %all; ((%annotation;)?, (%element;)*)>
+<!ATTLIST %all;
+          minOccurs   (1)                    #IMPLIED
+          maxOccurs   (1)                    #IMPLIED
+          id          ID                     #IMPLIED
+          %allAttrs;>
+
+<!ELEMENT %choice; ((%annotation;)?, (%element;| %group;| %cs; | %any;)*)>
+<!ATTLIST %choice;
+          minOccurs   %nonNegativeInteger;   #IMPLIED
+          maxOccurs   CDATA                  #IMPLIED
+          id          ID                     #IMPLIED
+          %choiceAttrs;>
+
+<!ELEMENT %sequence; ((%annotation;)?, (%element;| %group;| %cs; | %any;)*)>
+<!ATTLIST %sequence;
+          minOccurs   %nonNegativeInteger;   #IMPLIED
+          maxOccurs   CDATA                  #IMPLIED
+          id          ID                     #IMPLIED
+          %sequenceAttrs;>
+
+<!-- an anonymous grouping in a model, or
+     a top-level named group definition, or a reference to same -->
+
+<!-- Note that if order is 'all', group is not allowed inside.
+     If order is 'all' THIS group must be alone (or referenced alone) at
+     the top level of a content model -->
+<!-- If order is 'all', minOccurs==maxOccurs==1 on element/any inside -->
+<!-- Should allow minOccurs=0 inside order='all' . . . -->
+
+<!ELEMENT %any; (%annotation;)?>
+<!ATTLIST %any;
+            namespace       CDATA                  '##any'
+            processContents (skip|lax|strict)      'strict'
+            minOccurs       %nonNegativeInteger;   '1'
+            maxOccurs       CDATA                  '1'
+            id              ID                     #IMPLIED
+            %anyAttrs;>
+
+<!-- namespace is interpreted as follows:
+                  ##any      - - any non-conflicting WFXML at all
+
+                  ##other    - - any non-conflicting WFXML from namespace other
+                                  than targetNamespace
+
+                  ##local    - - any unqualified non-conflicting WFXML/attribute
+                  one or     - - any non-conflicting WFXML from
+                  more URI        the listed namespaces
+                  references
+
+                  ##targetNamespace ##local may appear in the above list,
+                    with the obvious meaning -->
+
+<!ELEMENT %anyAttribute; (%annotation;)?>
+<!ATTLIST %anyAttribute;
+            namespace       CDATA              '##any'
+            processContents (skip|lax|strict)  'strict'
+            id              ID                 #IMPLIED
+            %anyAttributeAttrs;>
+<!-- namespace is interpreted as for 'any' above -->
+
+<!-- simpleType only if no type|ref attribute -->
+<!-- ref not allowed at top level, name iff at top level -->
+<!ELEMENT %attribute; ((%annotation;)?, (%simpleType;)?)>
+<!ATTLIST %attribute;
+          name      %NCName;      #IMPLIED
+          id        ID            #IMPLIED
+          ref       %QName;       #IMPLIED
+          type      %QName;       #IMPLIED
+          use       (prohibited|optional|required) #IMPLIED
+          default   CDATA         #IMPLIED
+          fixed     CDATA         #IMPLIED
+          form      %formValues;  #IMPLIED
+          %attributeAttrs;>
+<!-- type and ref are mutually exclusive.
+     name and ref are mutually exclusive, one is required -->
+<!-- default for use is optional when nested, none otherwise -->
+<!-- default and fixed are mutually exclusive -->
+<!-- type attr and simpleType content are mutually exclusive -->
+
+<!-- an attributeGroup is a named collection of attribute decls, or a
+     reference thereto -->
+<!ELEMENT %attributeGroup; ((%annotation;)?,
+                       (%attribute; | %attributeGroup;)*,
+                       (%anyAttribute;)?) >
+<!ATTLIST %attributeGroup;
+                 name       %NCName;       #IMPLIED
+                 id         ID             #IMPLIED
+                 ref        %QName;        #IMPLIED
+                 %attributeGroupAttrs;>
+
+<!-- ref iff no content, no name.  ref iff not top level -->
+
+<!-- better reference mechanisms -->
+<!ELEMENT %unique; ((%annotation;)?, %selector;, (%field;)+)>
+<!ATTLIST %unique;
+          name     %NCName;       #REQUIRED
+	  id       ID             #IMPLIED
+	  %uniqueAttrs;>
+
+<!ELEMENT %key;    ((%annotation;)?, %selector;, (%field;)+)>
+<!ATTLIST %key;
+          name     %NCName;       #REQUIRED
+	  id       ID             #IMPLIED
+	  %keyAttrs;>
+
+<!ELEMENT %keyref; ((%annotation;)?, %selector;, (%field;)+)>
+<!ATTLIST %keyref;
+          name     %NCName;       #REQUIRED
+	  refer    %QName;        #REQUIRED
+	  id       ID             #IMPLIED
+	  %keyrefAttrs;>
+
+<!ELEMENT %selector; ((%annotation;)?)>
+<!ATTLIST %selector;
+          xpath %XPathExpr; #REQUIRED
+          id    ID          #IMPLIED
+          %selectorAttrs;>
+<!ELEMENT %field; ((%annotation;)?)>
+<!ATTLIST %field;
+          xpath %XPathExpr; #REQUIRED
+          id    ID          #IMPLIED
+          %fieldAttrs;>
+
+<!-- Schema combination mechanisms -->
+<!ELEMENT %include; (%annotation;)?>
+<!ATTLIST %include;
+          schemaLocation %URIref; #REQUIRED
+          id             ID       #IMPLIED
+          %includeAttrs;>
+
+<!ELEMENT %import; (%annotation;)?>
+<!ATTLIST %import;
+          namespace      %URIref; #IMPLIED
+          schemaLocation %URIref; #IMPLIED
+          id             ID       #IMPLIED
+          %importAttrs;>
+
+<!ELEMENT %redefine; (%annotation; | %simpleType; | %complexType; |
+                      %attributeGroup; | %group;)*>
+<!ATTLIST %redefine;
+          schemaLocation %URIref; #REQUIRED
+          id             ID       #IMPLIED
+          %redefineAttrs;>
+
+<!ELEMENT %notation; (%annotation;)?>
+<!ATTLIST %notation;
+	  name        %NCName;    #REQUIRED
+	  id          ID          #IMPLIED
+	  public      CDATA       #REQUIRED
+	  system      %URIref;    #IMPLIED
+	  %notationAttrs;>
+
+<!-- Annotation is either application information or documentation -->
+<!-- By having these here they are available for datatypes as well
+     as all the structures elements -->
+
+<!ELEMENT %annotation; (%appinfo; | %documentation;)*>
+<!ATTLIST %annotation; %annotationAttrs;>
+
+<!-- User must define annotation elements in internal subset for this
+     to work -->
+<!ELEMENT %appinfo; ANY>   <!-- too restrictive -->
+<!ATTLIST %appinfo;
+          source     %URIref;      #IMPLIED
+          id         ID         #IMPLIED
+          %appinfoAttrs;>
+<!ELEMENT %documentation; ANY>   <!-- too restrictive -->
+<!ATTLIST %documentation;
+          source     %URIref;   #IMPLIED
+          id         ID         #IMPLIED
+          xml:lang   CDATA      #IMPLIED
+          %documentationAttrs;>
+
+<!NOTATION XMLSchemaStructures PUBLIC
+           'structures' 'http://www.w3.org/2001/XMLSchema.xsd' >
+<!NOTATION XML PUBLIC
+           'REC-xml-1998-0210' 'http://www.w3.org/TR/1998/REC-xml-19980210' >



---------------------------------------------------------------------
To unsubscribe, e-mail: woden-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: woden-dev-help@ws.apache.org