From 65bf3316cf384588453604be6b4f0ed3751a8b0f Mon Sep 17 00:00:00 2001 From: tromey Date: Tue, 9 Jan 2007 19:58:05 +0000 Subject: Merged gcj-eclipse branch to trunk. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@120621 138bc75d-0d04-0410-961f-82ee72b054a4 --- .../classpath/gnu/xml/transform/XSLURIResolver.java | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'libjava/classpath/gnu/xml/transform/XSLURIResolver.java') 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(); -- cgit v1.2.1