diff options
author | edwardsmj <edwardsmj@13f79535-47bb-0310-9956-ffa450edef68> | 2010-05-18 09:33:19 +0000 |
---|---|---|
committer | edwardsmj <edwardsmj@13f79535-47bb-0310-9956-ffa450edef68> | 2010-05-18 09:33:19 +0000 |
commit | 39ebe72060715bc657cc59459d81cea5c94d437a (patch) | |
tree | 01ba8fe740684461ce772b79b141154ffd326c23 /sca-java-2.x/trunk | |
parent | 7b1646205eb1e5c0f817c37b2ce2349f6b296d11 (diff) |
Updating createXMLStreamReader(URL) to use a StreamSource in its implementation, so that the scanning of external files such as DTDs is possible, as described in TUSCANY-3559
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@945557 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r-- | sca-java-2.x/trunk/modules/common-xml/META-INF/MANIFEST.MF | 3 | ||||
-rw-r--r-- | sca-java-2.x/trunk/modules/common-xml/src/main/java/org/apache/tuscany/sca/common/xml/stax/StAXHelper.java | 6 |
2 files changed, 7 insertions, 2 deletions
diff --git a/sca-java-2.x/trunk/modules/common-xml/META-INF/MANIFEST.MF b/sca-java-2.x/trunk/modules/common-xml/META-INF/MANIFEST.MF index 53c9415364..0025ccea7d 100644 --- a/sca-java-2.x/trunk/modules/common-xml/META-INF/MANIFEST.MF +++ b/sca-java-2.x/trunk/modules/common-xml/META-INF/MANIFEST.MF @@ -29,7 +29,8 @@ Import-Package: javax.xml.datatype, org.xml.sax.helpers
Bundle-SymbolicName: org.apache.tuscany.sca.common.xml
Bundle-DocURL: http://www.apache.org/
-Export-Package: org.apache.tuscany.sca.common.xml;version="2.0.0";uses:="org.xml.sax",
+Export-Package: org.apache.tuscany.sca.common.xml;version="2.0.0";
+ uses:="org.xml.sax",
org.apache.tuscany.sca.common.xml.dom;version="2.0.0";
uses:="org.xml.sax.ext,
javax.xml.transform,
diff --git a/sca-java-2.x/trunk/modules/common-xml/src/main/java/org/apache/tuscany/sca/common/xml/stax/StAXHelper.java b/sca-java-2.x/trunk/modules/common-xml/src/main/java/org/apache/tuscany/sca/common/xml/stax/StAXHelper.java index df25cf1d1d..d7c85f01b5 100644 --- a/sca-java-2.x/trunk/modules/common-xml/src/main/java/org/apache/tuscany/sca/common/xml/stax/StAXHelper.java +++ b/sca-java-2.x/trunk/modules/common-xml/src/main/java/org/apache/tuscany/sca/common/xml/stax/StAXHelper.java @@ -44,6 +44,7 @@ import javax.xml.stream.XMLStreamReader; import javax.xml.stream.XMLStreamWriter; import javax.xml.transform.Result; import javax.xml.transform.Source; +import javax.xml.transform.stream.StreamSource; import org.apache.tuscany.sca.common.xml.dom.DOMHelper; import org.apache.tuscany.sca.common.xml.stax.impl.StAX2SAXAdapter; @@ -134,7 +135,10 @@ public class StAXHelper { public XMLStreamReader createXMLStreamReader(URL url) throws XMLStreamException { try { - return createXMLStreamReader(openStream(url)); + // Set up a StreamSource from the url, since this has an associated URL that + // can be used by the parser to find references to other files such as DTDs + StreamSource scdlSource = new StreamSource( openStream(url), url.toString() ); + return inputFactory.createXMLStreamReader(scdlSource); } catch (IOException e) { throw new XMLStreamException(e); } |