ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant XmlLogger.java
Date Sat, 23 Mar 2002 19:52:09 GMT
stevel      02/03/23 11:52:09

  Modified:    src/main/org/apache/tools/ant XmlLogger.java
  Log:
  style sheet control; you can point to anyhting or turn it off completely.
  
  nb, can we make this a logger and not a listener?
  
  Revision  Changes    Path
  1.25      +8 -2      jakarta-ant/src/main/org/apache/tools/ant/XmlLogger.java
  
  Index: XmlLogger.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/XmlLogger.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- XmlLogger.java	3 Mar 2002 10:06:30 -0000	1.24
  +++ XmlLogger.java	23 Mar 2002 19:52:09 -0000	1.25
  @@ -185,10 +185,14 @@
               buildElement.element.appendChild(stacktrace);
           }
   
  -       String outFilename = event.getProject().getProperty("XmlLogger.file");
  +        String outFilename = event.getProject().getProperty("XmlLogger.file");
           if (outFilename == null) {
               outFilename = "log.xml";
           }
  +        String xslUri=event.getProject().getProperty("ant.XmlLogger.stylesheet.uri");
  +        if(xslUri==null) {
  +            xslUri="log.xsl";
  +        }
           Writer out = null;
           try {
               // specify output in UTF8 otherwise accented characters will blow
  @@ -196,7 +200,9 @@
               FileOutputStream fos = new FileOutputStream(outFilename);
               out = new OutputStreamWriter(fos, "UTF8");
               out.write("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n");
  -            out.write("<?xml-stylesheet type=\"text/xsl\" href=\"log.xsl\"?>\n\n");
  +            if(xslUri.length()>0) {
  +                out.write("<?xml-stylesheet type=\"text/xsl\" href=\""+xslUri+"\"?>\n\n");
  +            }
               (new DOMElementWriter()).write(buildElement.element, out, 0, "\t");
               out.flush();
           } catch(IOException exc) {
  
  
  

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


Mime
View raw message