Hi Mark,
*1* TransformRepresentation doesn't seem to have a way to inject xslt
parameters. Am I missing it? Is there someone having a patch or opinion on
how to do it? (ideas welcomed both on implementation and usage level)
This is done with the JAXP convention on the resulting
javax.xml.transform.Transformer object. Because the TransformRepresentation
class invokes lazy initialization on the actual Transformer object, all I
did was create a wrapper to the Transformer.setParameter/getParameter
methods. This is a common use case and I've mentioned before it should be
included. JAXP is still only XSLT1.0 compliant. Eventually there will be
support for starting the transform on a named template. Saxon already
provides this but there is no JAXP equivalent yet. Also, getting a
stylesheet from an xml pre-processing directive should be supported.
public void setParameter(String key, Object value){
this.getTransformer().setParameter(key,value);
}
*2* Sax-readyness:
- TransformRepresentation should be able to send output to sax.
- Equally it should be ready to get xml and xsl input from sax
- And finally the provided context-resolver should be (configurable?)
providing SAXSources rather then the current StreamSources
Could you maybe provide a code example. If sax is important then why not
DOM. Where does it end.
I think the goal should be to expose as few operations as possible that
still cover the bulk of common use cases. I rarely use SAX so I have little
exposure to this particular case. As I mentioned before, if we can keep the
user from having to pull out JAXP code for anything but fringe scenarios AND
still not bloat the class with JAXP wrapper code, that is best.
Maybe someone could explain the backward compatability issues of this class,
because frankly, it was broken, badly, so who has been using it? Also, is
there more on this RIPA protocol?
Joe.