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

RE: efficient xml programming technique

  • From: Leigh Dodds <ldodds@i...>
  • To: gharesh@v..., Xml-Dev <xml-dev@l...>
  • Date: Wed, 26 Sep 2001 17:23:19 +0100

programming technique


> -----Original Message-----
> From: Haresh Gujarathi [mailto:gharesh@v...]
> Sent: 26 September 2001 17:15
> To: Xml-Dev
> Subject:  efficient xml programming technique
>
>
[...]
> a.
> I am little concerned since for each request the DOMParser object
> is created and DOM processing is done.
> (Well certain cases I can use SAX. But for time being let's assume, that I
> must use DOM)

Are you sure that creating the DOMParser is really eating up much
resources/slow to do? I'd suspect most of the resource allocation is
going into the DOM tree which you'll probably end up throwing away
anyway even if you do cache parsers.

In a previous application I did reuse parsers between requests (xml4j)
but found that the parser didn't recover properly from parse
exceptions (led to some interesting errors), so I ended up re-creating the
parser each request. Didn't seem to add much overhead.

> b. In the same application I have another scenario;
> In the JSP files I use xalan transformer object to perform XSL
> transformation on certain xml data.  Now this happens for each
> JSP request.
>
> Is this a normal practice?
>
> how can this be made efficient/less memory foot print/less runtime memory
> usage ?

Cache the transforms, and where possible the XML data. e.g. JAXP
Templates.

Basically reduce the amount of parsing you have to do for each request,
be that for a stylesheet, or the data you're transforming.

HtH,

L.


--
Leigh Dodds, Research Group, ingenta | "Pluralitas non est ponenda
http://weblogs.userland.com/eclectic |    sine necessitate"
http://www.xml.com/pub/xmldeviant    |     -- William of Ockham


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.