[SoapRMI] XPP3

Andrew Keidel strazys_at_hotmail.com
Tue, 07 May 2002 23:35:42 -0700


Hi,

I like your xpp product a lot, but am having an odd problem using it.  The 
parsing works fine when I give it an input string, but fails to work 
properly when I use it on an InputStream from a File.

Here is the code I'm using:

File f = new File("C:\\\\test\\sample.xml");
FileInputStream fis = new FileInputStream(f);
XmlTestCreator xmlTestCreator = new XmlTestCreator();
xmlTestCreator.setInput(new InputStreamReader(new 
NoBufferingInputStream(fis)));
test = xmlTestCreator.processDocument();
xmlTestCreator.setInput(null);

---------------

In the above code, XmlTestCreator is a class that uses your parsing code; 
NoBufferingInputStream is the class you suggest here: 
http://www.extreme.indiana.edu/xgws/xsoap/xpp/download/PullParser2/doc/faq.html

I've tried *several* approaches for reading from a file into the parser, but 
the only one that works is when I do something like the following:

xmlTestCreator.setInput(new StringReader(myString));

where myString is a string containing the entire xml text.  The problem with 
this approach is that it will perform poorly when the xml document is huge 
(which will require myString to be an enormous string).

I haven't tried using sockets yet... I believe that part will work.  But I 
want to be able to read xml from a file.

Suggestions?

Thanks,
Andy


_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com