servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r429279 - in /incubator/servicemix/trunk/servicemix-components/src: main/java/org/apache/servicemix/components/validation/ test/resources/org/apache/servicemix/components/validation/ test/resources/org/apache/servicemix/components/validatio...
Date Mon, 07 Aug 2006 08:48:51 GMT
Author: gnodet
Date: Mon Aug  7 01:48:49 2006
New Revision: 429279

URL: http://svn.apache.org/viewvc?rev=429279&view=rev
Log:
SM-514: ValidateComponent does not create StreamSource with a SystemId which breaks schema
includes and imports
Patch provided by Grant McDonald, thx !

Added:
    incubator/servicemix/trunk/servicemix-components/src/test/resources/org/apache/servicemix/components/validation/address/
    incubator/servicemix/trunk/servicemix-components/src/test/resources/org/apache/servicemix/components/validation/address/address.xsd
Modified:
    incubator/servicemix/trunk/servicemix-components/src/main/java/org/apache/servicemix/components/validation/ValidateComponent.java
    incubator/servicemix/trunk/servicemix-components/src/test/resources/org/apache/servicemix/components/validation/schema.xsd

Modified: incubator/servicemix/trunk/servicemix-components/src/main/java/org/apache/servicemix/components/validation/ValidateComponent.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-components/src/main/java/org/apache/servicemix/components/validation/ValidateComponent.java?rev=429279&r1=429278&r2=429279&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-components/src/main/java/org/apache/servicemix/components/validation/ValidateComponent.java
(original)
+++ incubator/servicemix/trunk/servicemix-components/src/main/java/org/apache/servicemix/components/validation/ValidateComponent.java
Mon Aug  7 01:48:49 2006
@@ -94,7 +94,8 @@
                     if (schemaResource == null) {
                         throw new JBIException("You must specify a schema, schemaSource or
schemaResource property");
                     }
-                    schemaSource = new StreamSource(schemaResource.getInputStream());
+                    schemaSource = new StreamSource(schemaResource.getInputStream(),
+                                                    schemaResource.getURL().toExternalForm());
                 }
                 schema = factory.newSchema(schemaSource);
             }

Added: incubator/servicemix/trunk/servicemix-components/src/test/resources/org/apache/servicemix/components/validation/address/address.xsd
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-components/src/test/resources/org/apache/servicemix/components/validation/address/address.xsd?rev=429279&view=auto
==============================================================================
--- incubator/servicemix/trunk/servicemix-components/src/test/resources/org/apache/servicemix/components/validation/address/address.xsd
(added)
+++ incubator/servicemix/trunk/servicemix-components/src/test/resources/org/apache/servicemix/components/validation/address/address.xsd
Mon Aug  7 01:48:49 2006
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+
+  <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:schema>

Modified: incubator/servicemix/trunk/servicemix-components/src/test/resources/org/apache/servicemix/components/validation/schema.xsd
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/servicemix-components/src/test/resources/org/apache/servicemix/components/validation/schema.xsd?rev=429279&r1=429278&r2=429279&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-components/src/test/resources/org/apache/servicemix/components/validation/schema.xsd
(original)
+++ incubator/servicemix/trunk/servicemix-components/src/test/resources/org/apache/servicemix/components/validation/schema.xsd
Mon Aug  7 01:48:49 2006
@@ -8,6 +8,8 @@
     </xsd:documentation>
   </xsd:annotation>
 
+  <xsd:include schemaLocation="address/address.xsd"/>
+
   <xsd:element name="purchaseOrder" type="PurchaseOrderType"/>
 
   <xsd:element name="comment" type="xsd:string"/>
@@ -20,17 +22,6 @@
       <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">



Mime
View raw message