Index: src/test/java/org/codehaus/mojo/xml/test/TransformMojoTest.java
===================================================================
--- src/test/java/org/codehaus/mojo/xml/test/TransformMojoTest.java	(revision 10707)
+++ src/test/java/org/codehaus/mojo/xml/test/TransformMojoTest.java	(working copy)
@@ -1,12 +1,12 @@
 /*
  * Copyright 2006 The 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.
@@ -198,9 +198,19 @@
         final String dir = "src/test/it8";
         runTest( dir );
         Document doc1 = parse( new File( dir, "target/generated-resources/xml/xslt/doc1.xml" ) );
-        
+
         assertEquals("SAXON 8.7 from Saxonica", eval( doc1, "/root/vendor" ) );
         assertEquals("http://www.saxonica.com/", eval( doc1, "/root/vendor-url" ) );
         assertEquals("2.0", eval( doc1, "/root/version" ) );
     }
+
+    /**
+     * Builds the it6 test project.
+     */
+    public void testIt10()
+        throws Exception
+    {
+        TransformMojo mojo = (TransformMojo) newMojo( "src/test/it10" );
+        mojo.execute();
+    }
 }
Index: src/test/java/org/codehaus/mojo/xml/test/ValidateMojoTest.java
===================================================================
--- src/test/java/org/codehaus/mojo/xml/test/ValidateMojoTest.java	(revision 10707)
+++ src/test/java/org/codehaus/mojo/xml/test/ValidateMojoTest.java	(working copy)
@@ -2,13 +2,13 @@
 
 /*
  * Copyright 2006 The 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.
@@ -76,4 +76,13 @@
     {
         runTest( "src/test/it9" );
     }
+
+   /**
+    * Builds the it11 test project.
+    */
+   public void testIt11()
+       throws Exception
+   {
+       runTest( "src/test/it11" );
+   }
 }

Property changes on: src/test/it10
___________________________________________________________________
Added: svn:ignore
   + target


Index: src/test/it10/xml/doc1.xml
===================================================================
--- src/test/it10/xml/doc1.xml	(revision 0)
+++ src/test/it10/xml/doc1.xml	(revision 0)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE DOC PUBLIC "-COUNTER-" "http://www.example.com/sample.dtd">
+<!--
+
+   Copyright 2006 The 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.
+
+-->
+<DOC><HEADER>A sample document.</HEADER></DOC>

Property changes on: src/test/it10/xml/doc1.xml
___________________________________________________________________
Added: svn:eol-style
   + native

Index: src/test/it10/it10.xsl
===================================================================
--- src/test/it10/it10.xsl	(revision 0)
+++ src/test/it10/it10.xsl	(revision 0)
@@ -0,0 +1,26 @@
+<!--
+
+   Copyright 2006 The 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.
+
+-->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+	<xsl:template match="/">
+		<root>
+			<vendor><xsl:value-of select="system-property('xsl:vendor')"/></vendor>
+			<vendor-url><xsl:value-of select="system-property('xsl:vendor-url')"/></vendor-url>
+			<version><xsl:value-of select="system-property('xsl:version')"/></version>
+		</root>
+	</xsl:template>
+</xsl:stylesheet>

Property changes on: src/test/it10/it10.xsl
___________________________________________________________________
Added: svn:eol-style
   + native

Index: src/test/it10/catalog.xml
===================================================================
--- src/test/it10/catalog.xml	(revision 0)
+++ src/test/it10/catalog.xml	(revision 0)
@@ -0,0 +1,20 @@
+<!--
+
+   Copyright 2006 The 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.
+
+-->
+<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
+  <public publicId="-COUNTER-" uri="sample.dtd" />
+</catalog>

Property changes on: src/test/it10/catalog.xml
___________________________________________________________________
Added: svn:eol-style
   + native

Index: src/test/it10/pom.xml
===================================================================
--- src/test/it10/pom.xml	(revision 0)
+++ src/test/it10/pom.xml	(revision 0)
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+   Copyright 2006 The 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.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.codehaus.mojo.xml</groupId>
+  <artifactId>it10</artifactId>
+  <version>0.1</version>
+  <name>Maven XML Plugin IT 10</name>
+  <description>Integration Test 10 for the Maven XML Plugin</description>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>xml-maven-plugin</artifactId>
+        <version>1.0-beta-2-SNAPSHOT</version>
+        <executions>
+          <execution>
+            <goals>
+              <goal>transform</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <transformationSets>
+            <transformationSet>
+              <dir>xml</dir>
+              <stylesheet>it10.xsl</stylesheet>
+            </transformationSet>
+          </transformationSets>
+          <catalogs>
+            <catalog>catalog.xml</catalog>
+          </catalogs>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Property changes on: src/test/it10/pom.xml
___________________________________________________________________
Added: svn:eol-style
   + native

Index: src/test/it10/sample.dtd
===================================================================
--- src/test/it10/sample.dtd	(revision 0)
+++ src/test/it10/sample.dtd	(revision 0)
@@ -0,0 +1,2 @@
+<!ELEMENT DOC (HEADER)>
+<!ELEMENT HEADER (#PCDATA)>

Property changes on: src/test/it10/sample.dtd
___________________________________________________________________
Added: svn:eol-style
   + native

Index: src/test/it11/xml/doc1.xml
===================================================================
--- src/test/it11/xml/doc1.xml	(revision 0)
+++ src/test/it11/xml/doc1.xml	(revision 0)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE DOC PUBLIC "-COUNTER-DTD-" "http://www.example.com/sample.dtd">
+<!--
+
+   Copyright 2006 The 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.
+
+-->
+<DOC xmlns="xyz0"><HEADER>A sample document.</HEADER></DOC>

Property changes on: src/test/it11/xml/doc1.xml
___________________________________________________________________
Added: svn:eol-style
   + native

Index: src/test/it11/catalog.xml
===================================================================
--- src/test/it11/catalog.xml	(revision 0)
+++ src/test/it11/catalog.xml	(revision 0)
@@ -0,0 +1,21 @@
+<!--
+
+   Copyright 2006 The 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.
+
+-->
+<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
+    <public publicId="-COUNTER-DTD-" uri="sample.dtd" />
+    <public publicId="--COUNTER--" uri="schema.xsd"/>
+</catalog>

Property changes on: src/test/it11/catalog.xml
___________________________________________________________________
Added: svn:eol-style
   + native

Index: src/test/it11/pom.xml
===================================================================
--- src/test/it11/pom.xml	(revision 0)
+++ src/test/it11/pom.xml	(revision 0)
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+   Copyright 2006 The 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.
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.codehaus.mojo.xml</groupId>
+  <artifactId>it11</artifactId>
+  <version>0.1</version>
+  <name>Maven XML Plugin IT 10</name>
+  <description>Integration Test 11 for the Maven XML Plugin</description>
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>xml-maven-plugin</artifactId>
+        <version>1.0-beta-2-SNAPSHOT</version>
+        <executions>
+          <execution>
+            <goals>
+              <goal>validate</goal>
+            </goals>
+          </execution>
+        </executions>
+        <configuration>
+          <validationSets>
+            <validationSet>
+              <dir>xml</dir>
+              <publicId>--COUNTER--</publicId>
+            </validationSet>
+          </validationSets>
+          <catalogs>
+            <catalog>catalog.xml</catalog>
+          </catalogs>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Property changes on: src/test/it11/pom.xml
___________________________________________________________________
Added: svn:eol-style
   + native

Index: src/test/it11/sample.dtd
===================================================================
--- src/test/it11/sample.dtd	(revision 0)
+++ src/test/it11/sample.dtd	(revision 0)
@@ -0,0 +1,2 @@
+<!ELEMENT DOC (HEADER)>
+<!ELEMENT HEADER (#PCDATA)>

Property changes on: src/test/it11/sample.dtd
___________________________________________________________________
Added: svn:eol-style
   + native

Index: src/test/it11/schema.xsd
===================================================================
--- src/test/it11/schema.xsd	(revision 0)
+++ src/test/it11/schema.xsd	(revision 0)
@@ -0,0 +1,28 @@
+<!--
+
+   Copyright 2006 The 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.
+
+-->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+    elementFormDefault="qualified" attributeFormDefault="unqualified"
+    targetNamespace="xyz0">
+  <xs:element name="DOC">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element name="HEADER" minOccurs="1" maxOccurs="1" type="xs:string"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+</xs:schema>

Property changes on: src/test/it11/schema.xsd
___________________________________________________________________
Added: svn:eol-style
   + native

Index: src/main/java/org/codehaus/mojo/xml/Resolver.java
===================================================================
--- src/main/java/org/codehaus/mojo/xml/Resolver.java	(revision 10707)
+++ src/main/java/org/codehaus/mojo/xml/Resolver.java	(working copy)
@@ -79,7 +79,7 @@
                                                   + pFiles[i].getPath() + ": "
                                                   + e.getMessage(), e );
             }
-        }        
+        }
     }
 
     /**
@@ -114,12 +114,20 @@
         {
             try
             {
-                return new SAXSource( asInputSource( url ) );
+                return asSaxSource( asInputSource( url ) );
             }
             catch ( IOException e )
             {
                 throw new TransformerException( e );
             }
+            catch (SAXException e)
+            {
+            	throw new TransformerException( e );
+			}
+            catch (ParserConfigurationException e)
+            {
+				throw new TransformerException( e );
+			}
         }
         Source source = resolver.resolve( pHref, pBase );
         if ( source == null )
@@ -131,27 +139,29 @@
         {
             return source;
         }
-        XMLReader xmlReader;
         try
         {
-            SAXParserFactory spf = SAXParserFactory.newInstance();
-            spf.setValidating( validating );
-            spf.setNamespaceAware( true );
-            xmlReader = spf.newSAXParser().getXMLReader();
-            xmlReader.setEntityResolver( this );
-            return new SAXSource( xmlReader, isource );
-        }
-        catch ( ParserConfigurationException e )
-        {
-            throw new TransformerException( e.getMessage(), e );
-        }
-        catch ( SAXException e )
-        {
-            throw new TransformerException( e.getMessage(), e );
-        }
-        
+			return asSaxSource(isource);
+		}
+        catch (SAXException e) {
+			throw new TransformerException( e );
+		}
+        catch (ParserConfigurationException e)
+        {
+			throw new TransformerException( e );
+		}
+
     }
 
+	private Source asSaxSource(InputSource isource) throws SAXException, ParserConfigurationException {
+        SAXParserFactory spf = SAXParserFactory.newInstance();
+        spf.setValidating( validating );
+        spf.setNamespaceAware( true );
+        XMLReader xmlReader = spf.newSAXParser().getXMLReader();
+        xmlReader.setEntityResolver( this );
+        return new SAXSource( xmlReader, isource );
+	}
+
     /**
      * Implementation of {@link LSResourceResolver#resolveResource(String, String, String, String, String)}.
      */
Index: src/main/java/org/codehaus/mojo/xml/ValidateMojo.java
===================================================================
--- src/main/java/org/codehaus/mojo/xml/ValidateMojo.java	(revision 10707)
+++ src/main/java/org/codehaus/mojo/xml/ValidateMojo.java	(working copy)
@@ -146,7 +146,7 @@
                 {
                     validator.setResourceResolver( pResolver );
                 }
-                pSchema.newValidator().validate( new StreamSource( pFile ) );
+                validator.validate( new StreamSource( pFile ) );
             }
         }
         catch ( SAXParseException e )
@@ -299,8 +299,8 @@
         throws MojoExecutionException, MojoFailureException
     {
         final Schema schema = getSchema( pResolver, pValidationSet );
-        final File[] files = getFiles( pValidationSet.getDir(), 
-                                       pValidationSet.getIncludes(), 
+        final File[] files = getFiles( pValidationSet.getDir(),
+                                       pValidationSet.getIncludes(),
                                        getExcludes( pValidationSet.getExcludes(),
                                                     pValidationSet.isSkipDefaultExcludes() ) );
         if ( files.length == 0 )

