axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 23196] - Whitespace in serialized DOM Documents
Date Mon, 24 Nov 2003 16:09:55 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23196>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23196

Whitespace in serialized DOM Documents





------- Additional Comments From michel@informatik.uni-marburg.de  2003-11-24 16:09 -------
Its long ago.....let me see....

on the server side:
    a simple method that returns a DOM document, that contains some data...

        public org.w3c.dom.Document testIt() {
            
            Document doc = ......; //new Document
            ....
            //     insert some data
            ...
            return doc;
       }

and on client side a connection to that server that calls this method

    Service service = new Service();
    Call call = service.createCall();
    ....
    Document doc = (Document) call.invoke(new Object[]{});

The received document contains whitespace, that has been generated (however) 
during
serialization / deserialization. Its bad, when you run through the document to 
collect
informations and you know that the firstChild of an element X contains this 
data and
there is no data, just a text node with whitespace.

I dont know if the bug occurs in every document you send / receive, but in my
implementation it happens every time.
I think it has something todo with serialization of Documents. That 
serialization is 
based on serialization of dom elements (if i remember me correcct). Somewhere i
found in this serialization code an instruction that sets pretty printing to 
true.
I think the deserializer isn't able to delete this "pretty" trash.
I m not sure, as i mentioned its some month ago..........
please take a look at the class org.apache.axis.message.SOAPEnvelope....
there is a method outputImpl(..), it should have the line number 475 (axis 1.1)
there is the instruction setpretty. I think, that when the document deserializer
want to get the soap envelope as a element/document, the soap envelope
will be written into a simple String (or Stream) with this outputImpl method,
and there is this curious " context.setPretty(true); " instruction. The 
Deserializer takes
this String (that now contains the whitespace) and uses the standard parser to
get the dom document from it. Sorry, but i have currently not the time to 
analyze, what method depends of which other
method.

If you are (and i know you are :-) ) interested in java programming,
please take a look at http://www.mathematik.uni-marburg.de/DBS/xxl .
There you find a flexible and extensible library for data processing,
that offers arbitrary database functionality. 
Its open source, 100% java and well documented.
It offers buffers, buffered-containers, index-strutures, a storage-manger,
a natic xml storage system (for free!) that implements the DOM interfaces,
cursor (iterator) data processing conzept. Arbitrary relational algebra 
operators,
query optimization and new: XML processing and active data streams....



Bests,

Sebastian 

__

Department of Computer Science
University of Marburg, Germany
Database Research Group, Prof. Bernhard Seeger

Mime
View raw message