Wolfgang,

Sablotron uses a tree internally (as do all of the existing processors,
as far as I know). The access to the tree is not quite DOM-compliant.
But even if it were, you could hardly expect to be able to just pass on
the pointer to your in-memory tree to sablotron. 

What you could do is pass the tree to sablotron using SAX - walk through
the tree, triggering callbacks the way expat does. This makes the
serialization into flat text unnecessary.

Now sablotron's able to construct a tree in this way; what's missing is
the interface that would let an outside user call the SAX callbacks. I
assume it wouldn't be hard to fill this in; if you'd like to try writing
this part (which may be quicker than waiting for us) we'll be happy to
give you more information. The file to look at is parser.cpp.

HTH,
Tom

"Ponikwar, Wolfgang" wrote:
> 
> Hi all,
> 
> I have a question about Sablotron's internals (I must admit, I am not very
> familiar with them).
> 
> Does Sablotron use a DOM-compliant tree to perform XSLT processing, or does
> it use a SAX-based processing internally?
> 
> The reason for my question is the following:
> I intend using Sablotron inside a larger framework for XML processing. Due
> to the nature of the framework, it is very likely that I will already have a
> DOM-level-1-compliant tree in memory when wanting to apply XSLT
> transformation. Currently I would have to convert that tree back to a flat
> string to feed it into Sablotron, which in turn parses the string to buid a
> memory representation to apply the transformation to it. Quite inefficient,
> insn't it?
> Is there a way of inserting an already parsed document into Sablotron in
> some place and in which form, if it is possible?
> I couldn't find anything in the Perl documentation, is there a way using
> C++?
> 
> Does anybody else have (successfully???) tried something similar?
> 
> Thanks in advance!
> 
> Wolfgang

Reply via email to