[jdom-interest] JDOMResult Reuse

Elliotte Rusty Harold elharo at metalab.unc.edu
Thu Oct 24 07:09:22 PDT 2002


At 3:55 PM +0200 10/24/02, Laurent Bihanic wrote:


>I assumed startDocument is always called as defined by the 
>ContentHandler contract. So far it seems the XSLT processors I tried 
>follow this assumption. Have found a test case that makes this wrong?


I think it will be if the XSLT processor is generating a complete 
document. I'm not sure what will happen though if the XSLT processor 
produces only a fragment.

The Javadoc documentation for startDocument states:

The SAX parser will invoke this method only once, before any other 
event callbacks (except for setDocumentLocator).

However, that's clearly wrong since in normal, non-XSLT use, you 
would expect startDocument to be called multiple times. It should 
state "The SAX parser will invoke this method only once per 
document". I'll report the bug on SAX.

However, this still leaves the question open of whether we can rely 
on startDocument being called for each transformation result that 
does not generate a complete document.
-- 

+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo at metalab.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+
|          XML in a  Nutshell, 2nd Edition (O'Reilly, 2002)          |
|              http://www.cafeconleche.org/books/xian2/              |
|  http://www.amazon.com/exec/obidos/ISBN%3D0596002920/cafeaulaitA/  |
+----------------------------------+---------------------------------+
|  Read Cafe au Lait for Java News:  http://www.cafeaulait.org/      |
|  Read Cafe con Leche for XML News: http://www.cafeconleche.org/    |
+----------------------------------+---------------------------------+



More information about the jdom-interest mailing list