[XOM-interest] XSLTransform class API

Dmitry Katsubo dma_k at mail.ru
Thu Sep 16 15:01:51 EDT 2010


Dear XOM developers!

I've come across few questions concerning nu.xom.xslt.XSLTransform. I
will be very pleased, if someone can provide any feedback / opinion. All
below is just my opinion, which may differ from majority's:

* Having XSLTransform(Source source) constructor private is too
restrictive. One may wish to pass XSLT template as InputStream without
pre-building it as XOM document model. I don't see any good reason, why
there is only nu.xom.Document constructor.

* It looks like XSLTransform class itself has only one added value:
handling of exceptions. More over in this very example XOM is throwing
checked exception while in the rest of the library unchecked are preferred.

* Having XOMResult/XOMSource classes public adds flexibility to XOM, as
one can use them separately from XSLTransform.

* Returning Nodes as result of transformation is a bit odd (I took
extract from tutorial [1]):

Nodes output = transform.transform(input);
Document result = XSLTransform.toDocument(output);

I fully agree that result should be a list of nodes, but I think
returning DocumentFragment better matches the return result type. Maybe
it wouldn't be simple then...

Thank you for any comments in advance!

[1] http://www.xom.nu/tutorial.xhtml#d0e1875
[2] http://lists.ibiblio.org/pipermail/xom-interest/2005-May/002272.html

-- 
With best regards,
Dmitry



More information about the XOM-interest mailing list