Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Problem parsing XML with SAX in WSAD - Please help!

Reply
Thread Tools

Problem parsing XML with SAX in WSAD - Please help!

 
 
Jonathan
Guest
Posts: n/a
 
      10-28-2003
I have written a SAX parser to read a simple XML file using this code
:

SAXParserFactory factory = SAXParserFactory.newInstance();

javax.xml.parsers.SAXParser saxParser = factory.newSAXParser();

saxParser.parse(new File(filePath),new PurgeHandler());

For some reason, when the code enters the characters(char[] buf, int
offset, int len) method of my handler, the 'len' is not correct
sometimes, so the String returned by the code
new String(buf,offset,len)
is just part of the content of my element.

Any help please?

Thanks!!
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Python parsing XML file problem with SAX Stefan Behnel Python 5 08-24-2010 03:37 PM
Different results parsing a XML file with XML::Simple (XML::Sax vs. XML::Parser) Erik Wasser Perl Misc 5 03-05-2006 10:09 PM
Sequential XML parsing with xml.sax peter@hardy.dropbear.id.au Python 2 08-24-2005 01:29 AM
Print XML parsing to JspWriter (out) Class org.xml.sax.helpers.NewInstance can not access a member of class javax.xml.parsers.SAXParser with modifiers "protected" Per Magnus L?vold Java 0 11-15-2004 02:27 PM
SAX Parsing - Weird results when parsing content between tags. Naren XML 0 05-11-2004 07:25 PM



Advertisments