diff options
author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-01-09 19:58:05 +0000 |
---|---|---|
committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-01-09 19:58:05 +0000 |
commit | 65bf3316cf384588453604be6b4f0ed3751a8b0f (patch) | |
tree | 996a5f57d4a68c53473382e45cb22f574cb3e4db /libjava/classpath/gnu/xml/transform/XSLURIResolver.java | |
parent | 8fc56618a84446beccd45b80381cdfe0e94050df (diff) | |
download | gcc-65bf3316cf384588453604be6b4f0ed3751a8b0f.tar.gz |
Merged gcj-eclipse branch to trunk.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@120621 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/classpath/gnu/xml/transform/XSLURIResolver.java')
-rw-r--r-- | libjava/classpath/gnu/xml/transform/XSLURIResolver.java | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/libjava/classpath/gnu/xml/transform/XSLURIResolver.java b/libjava/classpath/gnu/xml/transform/XSLURIResolver.java index 6a49caab458..8d7e3fcb485 100644 --- a/libjava/classpath/gnu/xml/transform/XSLURIResolver.java +++ b/libjava/classpath/gnu/xml/transform/XSLURIResolver.java @@ -53,6 +53,7 @@ import javax.xml.transform.Source; import javax.xml.transform.TransformerException; import javax.xml.transform.URIResolver; import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.sax.SAXSource; import javax.xml.transform.stream.StreamSource; import org.w3c.dom.Node; import org.xml.sax.InputSource; @@ -118,10 +119,9 @@ class XSLURIResolver try { - URL url = resolveURL(systemId, base, href); Node node = null; InputStream in = null; - if (source instanceof StreamSource) + if (source != null && source instanceof StreamSource) { StreamSource ss = (StreamSource) source; in = ss.getInputStream(); @@ -134,8 +134,25 @@ class XSLURIResolver } } } + else if (source != null && source instanceof SAXSource) + { + SAXSource ss = (SAXSource) source; + if (ss.getInputSource() != null) + { + in = ss.getInputSource().getByteStream(); + if (in == null) + { + Reader reader = ss.getInputSource().getCharacterStream(); + if (reader != null) + { + in = new ReaderInputStream(reader); + } + } + } + } if (in == null) { + URL url = resolveURL(systemId, base, href); if (url != null) { systemId = url.toString(); |