Wrox Programmer Forums
|
BOOK: Beginning XML, 5th edition
This is the forum to discuss the Wrox book Beginning XML 5th Edition by Joe Fawcett, Danny Ayers, Liam R. E. Quin; ISBN: 978-1-1181-6213-2
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning XML, 5th edition section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 27th, 2014, 12:24 PM
Chi Chi is offline
Registered User
 
Join Date: Jul 2013
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default SaxParser code error

In SaxParser3.java, SaxParser4.java, SaxParser5.java in Chapter 11,

Code:
	public void endElement(String namespaceURI,
			String localName,
			String qName ) throws SAXException {
		System.out.print( "SAX Event: CHARACTERS[ " );
		System.out.println(buffer.toString());
		System.out.println( " ]" );    
		System.out.println( "SAX Event: END ELEMENT[ " + localName + " ]" );
	}
buffer should be reset as follows, so that no extra characters are printed:

Code:
	public void endElement(String namespaceURI,
			String localName,
			String qName ) throws SAXException {
		System.out.print( "SAX Event: CHARACTERS[ " );
		System.out.print(buffer.toString());
		buffer.setLength(0);
		System.out.println( " ]" );       
		System.out.println( "SAX Event: END ELEMENT[ " + localName + " ]" );
	}





Similar Threads
Thread Thread Starter Forum Replies Last Post
Error in code nightfox BOOK: Beginning PHP 6, Apache, MySQL 6 Web Development ISBN: 9780470391143 1 January 28th, 2010 04:10 AM
Code error reverand Excel VBA 1 November 15th, 2006 02:08 AM
Error In Code Tegwin BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 5 March 9th, 2006 07:43 PM
Code error!?!? Brian Campbell BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 3 November 26th, 2004 07:47 PM
Error displayed with error trap code stoneman Access 4 February 28th, 2004 02:53 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.