Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] XSLTransform setParameter

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Elliotte Harold <elharo AT metalab.unc.edu>
  • To: Michael Kay <mike AT saxonica.com>
  • Cc: 'xom-interest' <xom-interest AT lists.ibiblio.org>
  • Subject: Re: [XOM-interest] XSLTransform setParameter
  • Date: Thu, 10 Feb 2005 09:54:33 -0500

Michael Kay wrote:


JAXP chose to pass a namespaced parameter name as a single string in Clark
notation. Since namespaced parameter names are rather unusual in practice,
that has the benefit that it adds less clutter to the API. It's not clear
that you are doing anyone a favour by making a different decision here.

I've always found {http://www.example.org/}name to be an ugly hack that's hard to understand, and requires extra work on the part of the programmer to construct. Not a lot of extra work, of course; just enough to be annoying. Perhaps if this format were part of the namespace specification, and baked into things like SAX and XSLT, it would be a little more plausible; but since it isn't, I see no reason to use it here. Someone coming to XOM should just be able to say "Here's the namespace URI, here's the name; here's the value; set this parameter" without having to learn about some extra, funky, arbitrary convention. Breaking this out as separate arguments means all the programmer has to know is the method signature.

As precedent for an API breaking with this convention (that's really only a convention in TrAX, not anywhere else) I point to the org.apache.xalan.xsltc.trax.TransformerImpl and org.apache.xalan.transformer.TransformerImpl classes:

http://xml.apache.org/xalan-j/apidocs/org/apache/xalan/xsltc/trax/TransformerImpl.html
http://xml.apache.org/xalan-j/apidocs/org/apache/xalan/transformer/TransformerImpl.html


--
Elliotte Rusty Harold elharo AT metalab.unc.edu
XML in a Nutshell 3rd Edition Just Published!
http://www.cafeconleche.org/books/xian3/
http://www.amazon.com/exec/obidos/ISBN=0596007647/cafeaulaitA/ref=nosim




Archive powered by MHonArc 2.6.24.

Top of Page