Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] XSLTransform constructors are flawed

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Elliotte Rusty Harold <elharo AT metalab.unc.edu>
  • To: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] XSLTransform constructors are flawed
  • Date: Sat, 4 Sep 2004 07:07:14 -0400

At 5:02 PM -0400 9/1/04, Elliotte Rusty Harold wrote:
There are currently five overloaded constructors in XSLTransform:

public XSLTransform(Document stylesheet)
public XSLTransform(File stylesheet)
public XSLTransform(String stylesheetURL)
public XSLTransform(InputStream stylesheet)
public XSLTransform(Reader stylesheet)


Last night I realized another reason to deprecate and eliminate the last four of these constructors. Each one of them creates anew Builder object. This is potentially quite an expensive operation. Whether it's expensive relative to compiling the stylesheet and running the transform depends on local circumstances, but in at least some circumstances it makes a lot more sense to reuse a builder if possible, rather than creating a new underlying XMLReader for each separate document.
--

Elliotte Rusty Harold
elharo AT metalab.unc.edu
Effective XML (Addison-Wesley, 2003)
http://www.cafeconleche.org/books/effectivexml
http://www.amazon.com/exec/obidos/ISBN%3D0321150406/ref%3Dnosim/cafeaulaitA




Archive powered by MHonArc 2.6.24.

Top of Page