You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by js...@apache.org on 2002/12/19 15:46:00 UTC

cvs commit: jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/tags/xml ParseTagSupport.java

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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>