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 Wed, 09 Jan 2002 14:48:18 GMT
dims        02/01/09 06:48:18

  Modified:    java/src/org/apache/axis/message MessageElement.java
               java/src/org/apache/axis/utils XMLUtils.java
  Log:
  - Fallback to SerializationContext(writer) if context is null
  - Helper methods for streaming Elements's not just Document's.
  
  Revision  Changes    Path
  1.68      +9 -3      xml-axis/java/src/org/apache/axis/message/MessageElement.java
  
  Index: MessageElement.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/MessageElement.java,v
  retrieving revision 1.67
  retrieving revision 1.68
  diff -u -r1.67 -r1.68
  --- MessageElement.java	2 Jan 2002 13:27:19 -0000	1.67
  +++ MessageElement.java	9 Jan 2002 14:48:18 -0000	1.68
  @@ -388,10 +388,16 @@
   
       public Element getAsDOM() throws Exception
       {
  -        MessageContext msgContext = context.getMessageContext();
  -
  +        SerializationContext serializeContext = null;
           StringWriter writer = new StringWriter();
  -        output(new SerializationContext(writer, msgContext));
  +        if(context != null)
  +        {
  +            MessageContext msgContext = context.getMessageContext();
  +            serializeContext = new SerializationContext(writer, msgContext);
  +        } else {
  +            serializeContext = new SerializationContext(writer);
  +        }
  +        output(serializeContext);
           writer.close();
   
           Reader reader = new StringReader(writer.getBuffer().toString());
  
  
  
  1.41      +14 -0     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.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- XMLUtils.java	2 Jan 2002 20:30:03 -0000	1.40
  +++ XMLUtils.java	9 Jan 2002 14:48:18 -0000	1.41
  @@ -248,8 +248,22 @@
           DOM2Writer.serializeAsXML(element, writer, omitXMLDecl, pretty);
       }
   
  +    public static void ElementToStream(Element element, OutputStream out) {
  +        Writer writer = new OutputStreamWriter(out);
  +        privateElementToWriter(element, writer, true, false);
  +    }
  +
  +    public static void PrettyElementToStream(Element element, OutputStream out) {
  +        Writer writer = new OutputStreamWriter(out);
  +        privateElementToWriter(element, writer, true, true);
  +    }
  +
       public static void ElementToWriter(Element element, Writer writer) {
           privateElementToWriter(element, writer, true, false);
  +    }
  +
  +    public static void PrettyElementToWriter(Element element, Writer writer) {
  +        privateElementToWriter(element, writer, true, true);
       }
   
       public static void DocumentToStream(Document doc, OutputStream out) {
  
  
  

Mime
View raw message