On Wed, 2008-12-17 at 11:25 +0100, Frode Danielsen wrote:
On Dec 17, 2008, at 11:03 AM, Anders Steinlein wrote:
[snip]
It's definitely unnecessary to jump between DOMDocument -> XML string
-> DOMDocument to use the output of XmlGenerator in XslTransformer.
Since they're both core utility classes I'd suggest XslTransformer
supports working directly with XmlGenerator (ie. using getDom())?
I don't think XslTransformer should have any dependency on
XmlGenerator,
in order to allow it to be used with any plain DOMDocument from other
potential sources. Sending the result of getDom() to the transformer
instead of the generator instance itself seems good to me.
Another "weirdness" in XslTransformer as it stands now is that the
addXml() method really should be called setXml() considering how it
works right now. You can't incrementally add XML strings to
XslTransformer as it will just overwrite the previous XML. I guess
some improvement on this could be done as well, using the internal
DOMDocument more properly.
I don't really see the need to append/add several XML sources to the
transformer, but I agree that set is not the best of names. I suggest
loadXml() and loadDom().