commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject cvs commit: jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/xml ParseTagSupport.java
Date Thu, 19 Dec 2002 14:46:00 GMT
jstrachan    2002/12/19 06:46:00

  Modified:    jelly/src/java/org/apache/commons/jelly/tags/xml
                        ParseTagSupport.java
  Log:
  Minor patch to the parse tag so that parsing URI relative XML documents will preserve the
real URL where the document lives in case of any relative schemas or DTDs
  
  Revision  Changes    Path
  1.4       +5 -5      jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/xml/ParseTagSupport.java
  
  Index: ParseTagSupport.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/xml/ParseTagSupport.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ParseTagSupport.java	11 Dec 2002 12:40:56 -0000	1.3
  +++ ParseTagSupport.java	19 Dec 2002 14:46:00 -0000	1.4
  @@ -164,17 +164,17 @@
           
           if (source instanceof String) {
               String uri = (String) source;
  -            InputStream in = context.getResourceAsStream(uri);
  -            return getSAXReader().read(in, uri);
  +            source = context.getResource(uri);
  +        }
  +        
  +        if (source instanceof URL) {
  +            return getSAXReader().read((URL) source);
           }
           else if (source instanceof Reader) {
               return getSAXReader().read((Reader) source);
           }
           else if (source instanceof InputStream) {
               return getSAXReader().read((InputStream) source);
  -        }
  -        else if (source instanceof URL) {
  -            return getSAXReader().read((URL) source);
           }
           else {
               throw new IllegalArgumentException(
  
  
  

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message