[Xml-compile] Using the DOM built by the toolkit

Mark Overmeer mark at overmeer.net
Mon Feb 20 11:31:55 GMT 2012


* Michael Ludwig (m.ludwig at epages.com) [120220 11:01]:
> > Von: Mark Overmeer
> > If you can convince me that this DOM-tree has a use, I could add that
> > to the ::Trace object.  It will only delay the moment of destruction
> > of the tree, so is not a performance hit... but probably there is a
> > better way to satisfy your real need.
> 
> Well, the need is to get an HTML report of the data I receive via the
> web service. The best way to produce one from XML is to apply an XSL
> transformation. This is done using libxslt, the companion library to
> libxml2. The Perl interface is XML::LibXSLT, and it works very well.
> You need to supply a libxml2 DOM as input to the transformation.

SOAP is an interface, both client and server should use an abstraction
layer for presentation to be able to change the interface without
changing/breaking the core client application/ user experience.
XML::Compile contributes to the abstraction layer providing a HASH which
contains the message data.  Then, you can use a template to display
it to the user.  What I read in you explanation, it that you only want
to use the transport mechanism, because XSLT provides the abstraction.

It's a bit odd to put queries in Perl, and process the answers directly
with XSLT.  As first idea, it may work... but when thinking about
character-sets, error handling, validation... arggghhh, frightens me
a lot.  Of course, it is your choice (and burden)

> And what about adding an accessor for the DOM?
>   $obj->dom         # new!

Of course.   $trace->responseDOM

I do not believe your solution is sound on the long run, but it does
add something useful to the trace without measurable expense.  I'll
send you an intermediate version of the module, to test.
-- 
Regards,

               MarkOv

------------------------------------------------------------------------
       Mark Overmeer MSc                                MARKOV Solutions
       Mark at Overmeer.net                          solutions at overmeer.net
http://Mark.Overmeer.net                   http://solutions.overmeer.net




More information about the Xml-compile mailing list