[jdom-interest] JDOMTransformer

Elliotte Rusty Harold elharo at metalab.unc.edu
Mon May 5 04:01:44 PDT 2003


At 12:12 AM -0700 5/5/03, Jason Hunter wrote:

>Rusty, in your class examples what percentage of transformations don't
>return a document?

Quite a few. Whether or not a stylesheet creates a complete output 
Document can depend on the input document. The same stylesheet can 
create both Documents and lists of nodes depending on what you feed 
it. And I've got a number of stylesheets that only produce text as 
output, not markup at all.

In some sense, 100% of XSLT transforms produce lists of odes. If you 
look at the spec, nothing in an XSLT transform allows you to create a 
document node. You *always* get a result tree out. If this result 
tree happens to include exactly one element node and no top-level 
text nodes, then it is possible to serialize the result as a 
document. However, technically the transform itself never creates a 
document.
-- 

   Elliotte Rusty Harold
   elharo at metalab.unc.edu
   Processing XML with Java (Addison-Wesley, 2002)
   http://www.cafeconleche.org/books/xmljava
   http://www.amazon.com/exec/obidos/ISBN%3D0201771861/cafeaulaitA



More information about the jdom-interest mailing list