[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

SAX and stuff ...

  • From: Tony Pelton <tony.pelton@s...>
  • To: "Xml-Dev (E-mail)" <xml-dev@l...>
  • Date: Tue, 25 Jul 2000 10:44:10 -0700

doing sax

All,

I may not have done enough reading and research on this subject ... but ...

Using SAX and issues of performance.

I have now done a handful of "extends HandlerBase" implementations to parse
some XML messages in our messaging system ... and have found myself in this
pattern of writing code like this ...

startElement(String name, AttributeList atts)
{
	if(name.equals("SOMETAGIAMINTERESTEDIN"))
	{
		doSomething(attributes);
		return;
	}
	<... repeat for next tag ...>
	<... and so on ...>
}

... so first question ...

1. Is this a practical, reasonable and expected approach to doing SAX
parsing for a handful of fairly simple but potentially large XML messages
that we have brewed "in-house" and have not developed DTD's for ?

The reason that I ask is that on some of the messages ... I might have 10+
elements that I am looking for events on ... so that I can "do stuff".

I then find myself thinking about the number of "if's" my code is performing
on every startElement() ... and then I find myself putting the "if's" that I
expect to get more of ... before the one's I expect less of ...

Then I get worried that I am being "kludgy" ...

2. Assuming that I am not egregiously off on how I am implementing my SAX
code ...

Using the SAX parser from Xerces (which I guess is Dave Megginson's ? are
there others ?) is it a safe assumption that the SAX parser does _not_ do
String intern()ing ... and if so ... for performance ... I would assume that
doing my own "up front" String interning of all of my expected element names
on JVM startup ... would behoove me ?

Thanks for any insight and shared experience ...
Tony

PS. I have watched with great interest the 'ebb and flow' conversation
regarding the issue of academic versus pragmatic design and development of
XML and other such'isms ... as it strikes dear to my heart ... I am a simple
guy ... who wants to design and build great software using "smart"
technology that I can research, learn about, and implement in a time frame
that makes sense given the pace of the domain I am in.

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.