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/util TagXMLDoclet.java XMLDoclet.java
Date Mon, 15 Jul 2002 15:47:35 GMT
jstrachan    2002/07/15 08:47:35

  Modified:    jelly/src/java/org/apache/commons/jelly/util
                        TagXMLDoclet.java XMLDoclet.java
  Log:
  hacked the doclets a tad so that they output nicer XML with XML headers
  
  Revision  Changes    Path
  1.2       +9 -6      jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/util/TagXMLDoclet.java
  
  Index: TagXMLDoclet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/util/TagXMLDoclet.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TagXMLDoclet.java	21 Jun 2002 16:57:17 -0000	1.1
  +++ TagXMLDoclet.java	15 Jul 2002 15:47:35 -0000	1.2
  @@ -92,15 +92,18 @@
       private Attributes emptyAtts = new AttributesImpl();
   
       public TagXMLDoclet (RootDoc root) throws Exception {
  -        FileWriter writer = new FileWriter(targetFileName);
  +        FileOutputStream writer = new FileOutputStream(targetFileName);
  +        OutputFormat format = OutputFormat.createPrettyPrint();
  +        XMLWriter xmlWriter = new XMLWriter(writer, format);
           try {
  -            OutputFormat format = OutputFormat.createPrettyPrint();
  -            XMLWriter xmlWriter = new XMLWriter(writer, format);
               cm = xmlWriter;
  +            cm.startDocument();
               javadocXML(root);
  -            writer.close();
  -        } catch (IOException e) {
  -            writer.close();
  +            cm.endDocument();
  +            xmlWriter.close();
  +        } 
  +        catch (IOException e) {
  +            xmlWriter.close();
               throw e;
           }
       }
  
  
  
  1.5       +9 -16     jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/util/XMLDoclet.java
  
  Index: XMLDoclet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/src/java/org/apache/commons/jelly/util/XMLDoclet.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- XMLDoclet.java	18 Jun 2002 08:37:02 -0000	1.4
  +++ XMLDoclet.java	15 Jul 2002 15:47:35 -0000	1.5
  @@ -89,25 +89,18 @@
       private Attributes emptyAtts = new AttributesImpl();
   
       public XMLDoclet (RootDoc root) throws Exception {
  -        FileWriter writer = new FileWriter(targetFileName);
  +        FileOutputStream writer = new FileOutputStream(targetFileName);
  +        OutputFormat format = OutputFormat.createPrettyPrint();
  +        XMLWriter xmlWriter = new XMLWriter(writer, format);
           try {
  -            OutputFormat format = OutputFormat.createPrettyPrint();
  -/*            
  -            OutputFormat format = new OutputFormat();
  -            format.setEncoding(encodingFormat);
  -            format.setIndentSize(4);
  -            format.setIndenting(true);
  -            format.setLineWidth(4);
  -            format.setDoctype("-//APACHE//DTD JavaDoc V0.4//EN", "javadoc-v04draft.dtd");
  -            XMLSerializer serializer = new XMLSerializer(writer, format);
  -            cm = serializer.asContentHandler();
  -*/            
  -            XMLWriter xmlWriter = new XMLWriter(writer, format);
               cm = xmlWriter;
  +            cm.startDocument();
               javadocXML(root);
  -            writer.close();
  -        } catch (IOException e) {
  -            writer.close();
  +            cm.endDocument();
  +            xmlWriter.close();
  +        } 
  +        catch (IOException e) {
  +            xmlWriter.close();
               throw e;
           }
       }
  
  
  

--
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