Skip to Content.
Sympa Menu

xom-interest - [XOM-interest] Upcoming changes in nu.xom.xslt

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: [XOM-interest] Upcoming changes in nu.xom.xslt
  • Date: Wed, 27 Aug 2003 11:01:21 -0400

I'm looking at the nu.xom.xslt package and considering a few changes. Proposed for your comment:

1. XSLTransform is currently a subclass of XMLException and thus a runtime exception. I am reserving XMLException for core exceptions (namespace exceptions, well-formedness exceptions,. etc.). Furthermore, this exception normally indicates a semantic error in a stylesheet that's read in from a source external to the program, so this should probably be a checked exception like ParseException rather than a runtime exception. Thus this is going to become a subclass of Exception rather than XMLException.

2. What should happen when a stylesheet includes <xsl:output method="text"/>? The XSLT spec states, "An XSLT processor may output the result tree as a sequence of bytes, although it is not required to be able to do so (see [17 Conformance]). The xsl:output element allows stylesheet authors to specify how they wish the result tree to be output." Since the transform method does not output a stream of bytes, arguably the xsl:output method simply should not apply here. I can override it from inside the API and always produce a list of nodes.

What makes this urgent is that JAXP does not specify the behavior here, and XOM may be getting different results out of different XSLT processors. At least one processor, Xalan, is currently producing *no* output when method="text". I think producing a XOM NodeList would be a better option here.

Another thing I've considered is producing a list containing only text nodes. That's a little trickier, but should be doable.

Same question for method="html". Here the NodeList seems a more plausible output.

And for unrecognized custom methods? Should XOM just produce the XML tree output as a NodeList, or should it throw an exception?
--

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



  • [XOM-interest] Upcoming changes in nu.xom.xslt, Elliotte Rusty Harold, 08/27/2003

Archive powered by MHonArc 2.6.24.

Top of Page