axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject cvs commit: xml-axis/java/src/org/apache/axis/utils XMLUtils.java
Date Sat, 07 Apr 2001 00:58:06 GMT
dug         01/04/06 17:58:06

  Modified:    java/src/org/apache/axis/utils XMLUtils.java
  Log:
  Make the XMLserializer preserve spaces.
  Thanks to David Melgar (dmelgar@us.ibm.com) for finding/fixing this one!
  
  Revision  Changes    Path
  1.3       +7 -3      xml-axis/java/src/org/apache/axis/utils/XMLUtils.java
  
  Index: XMLUtils.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/utils/XMLUtils.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XMLUtils.java	2001/04/05 00:31:43	1.2
  +++ XMLUtils.java	2001/04/07 00:58:05	1.3
  @@ -115,8 +115,10 @@
   
     public static String DocumentToString(Document doc) {
       try {
  -      StringWriter sw = new StringWriter();
  -      XMLSerializer  xs = new XMLSerializer( sw, new OutputFormat() );
  +      StringWriter sw     = new StringWriter();
  +      OutputFormat format = new OutputFormat();
  +      format.setPreserveSpace(true);
  +      XMLSerializer  xs = new XMLSerializer( sw, format );
         xs.serialize( (Document) doc );
         sw.close();
         return(sw.toString() );
  @@ -129,7 +131,9 @@
   
     public static void DocumentToStream(Document doc, OutputStream out) {
       try {
  -      XMLSerializer  xs = new XMLSerializer( out, new OutputFormat() );
  +      OutputFormat format = new OutputFormat();
  +      format.setPreserveSpace(true);
  +      XMLSerializer  xs = new XMLSerializer( out, format );
         xs.serialize( (Document) doc );
       }
       catch( Exception e ) {
  
  
  

Mime
View raw message