bugreport kXML-RPC

"Heiko Milke" <[email protected]> Tue, 28 Oct 2003 14:03:50 +0100
Newsgroups gmane.comp.java.enhydra.general
Organization cosmoblonde GmbH
Message-ID <000201c39d53$ef3525f0$7e02a8c0@COSMOHEIKO>
Hello once more,

i continued evaluating kXML-RPC and found out that the parsing of responses
containing arrays would not work but will throw  parsing exceptions.

So I had a look into the sourcecode. Obviously the "data" element of the
array is not parsed:

<array><data><value>.</value></data></array>.

So I added 4 lines to the parseArray function that consumes the data start
and end elements and skips all whitespaces.

The function now looks like the following :

==

	Vector parseArray() throws IOException {
		Vector v = new Vector();
		parser.skip();

		//BUGFIX hm// we have to consume the data element before we
can access the value elements
		parser.read(Xml.START_TAG, "", "data");
		parser.skip();

		while (parser.peek().getType() != Xml.END_TAG) {
			v.addElement(parseValue()); // parse this element
value
			parser.skip();
		} //end while( parser.peek().getType() != Xml.END_TAG )
		//BUGFIX hm // we have to eat the closing element of the
data tag before we can proceed
		parser.read(Xml.END_TAG, "", "data");
		parser.skip();
		
		return v;
	} //end parseArray()

==

I suggest including those changes into the next release.

Best Regards
Heiko Milke!