I added two instance methods to XSLT::Stylesheet to output the
result of a xslt transformation to a string or an io object.
libxslt provides output functions that take the declaration into
account in xsltutils.c.
I added two instance methods to XSLT::Stylesheet to output the
result of a xslt transformation to a string or an io object.
In case of the string output I left a remark, that the string should
be flagged with the used encoding for ruby 1.9 (I don't know how to
do that and it does not seem to be done in case of XML::Document.to_s,
but when ruby-libxml/libxslt is used with ruby 1.9 it should be relevant)
The patch contains further changes depending on the parse options
patch for libxml-ruby (#23351).
This affects a few helper functions I added to XSLT::Stylesheet in
lib/libxslt/stylesheet.rb
I don't know what your policy on this kind of methods is.
They seem helpful to me (the stylesheet creator functions make sure that
apropriate parse options are used) and hide intermediary objects (one
rarely needs the document tree of a stylesheet itself).
But if you prefer to restrict ruby-libxslt to a pure interface to the
C functions, feel free to remove these methods. They are pretty trivial
anyway.
Besides this, the part of tests added rely on the parse options
as they show the problems when not settings options apropriately.
|