Re: [xsl] merging xml's using XSLT, merge.xslt

Subject: Re: [xsl] merging xml's using XSLT, merge.xslt
From: "Senthil Nathan" <rsennat@xxxxxxxxx>
Date: Wed, 26 Sep 2007 12:56:09 +0530
Hi,
I'm sorry for posting the message several times. I got mailer-daemon's
whenever I post it. something wrong with my message content type
earlier.

On 9/25/07, Abel Braaksma <abel.online@xxxxxxxxx> wrote:
> Hi Senthil,
>
> [Why did you send this message four times (probably I received it four
> times because you also send it to my personal account)? And why did you
> send it my personal account? Just to the list would be enough, I'm
> there. And unless for compelling reasons, please don't address me
> personally but use the public list. I'll read it, really.]
>
>
> Anyway, I looked up the history, and I am not sure what the problem is.
> It seemed that, in defiance of the subject line and your comments, you
> want to give the dom tree, or, a dom document from the command line,
> which I showed you how. Here's the latest we talked about (which you
> didn't answer, btw):
>
> >> But I wanted to know more about "passing parameters to XSLT". I'm
> >> merging 2 or more XML's and for which I specify the static file
> >> names. Instead I wanted to give the DOM tree as input to the XSLT.
> >>
> >
> > well, you can trick it the easy way like I suggested, because in
> > libxslt every param is an xpatch. If you pass it in a parameter that
> > looks like a correct document('') call you are in fact passing in a
> > DOM tree. That was why I suggested it.
> and...

----> Sorry. I dont want to use the command line.

>
> > The harder way is by using the API. I don't know in what context you
> > are using libxslt, but when you want to extend the system, you can
> > simply use the API. Probably not so simple, depends on how handy you
> > are with Java or c++. some info can be found here:
> > http://xmlsoft.org/XSLT/html/libxslt-xsltInternals.html and some other
> > info can be found here:
> > http://xmlsoft.org/XSLT/tutorial/libxslttutorial.html#parameters
> >
> > But from what I read here, it does in code about the same as you can
> > do on the commandline. Depending on how much you want to invest in it,
> > I suggest you take this very specific question to the libxslt list.
> >
> > In short: a DOM node can only be given to libxslt with an XPath and
> > all possibilities you have there, or you'll have to program the
> > interfaces.

-----> I'm now writing a cpp program using libxslt api's over libxml
api's. I have the pointer to the dom tree for "merge.xslt" and another
dom tree for "merge.xml". Using these api's I could apply the xslt on
the xml.

But the content of the merge.xml is, which merge.xslt needs, is the 2
files which needs to be merged.

Instead, I would like to pass the DOM trees for these 2 files for
applying merge.xslt on it.

>
> In other words: I have no idea why you are having troubles. The
> most-used pattern for processing multiple input documents (i.e., for
> merging, sorting or whatever) is to use a catalog file, which any XSLT
> can read. Then, from this catalog file, which should be in XML, you can
> read the document URIs which you can process further using the
> document() function.

---> so, otherwise how do I merge several xml files using the xslt
library api's in cpp.
And is there any examples can you send me, which would read the
document URI's and use it for merging xml's.

Thanks for helping this far and trying to understand my problem.
Thanks a lot.

>
> If you use PHP or whatever other language, consider creating a Java
> bridge to call into Saxon's Java interface. This would be easier in
> Python or in Ruby, if I remember correctly. How to use the API of Saxon
> and how to pass on nodes as arguments is extensively described in the
> Saxon manual
>
> HTH,
>
> Cheers,
> -- Abel Braaksma
>
>
> Senthil Nathan wrote:
> > Hi Abel,
> > I'm coming back to this thread after sometime, during which I couldn't
> > find a solution in libxslt forums. They said its not possible. But you
> > were saying about using that.
> >
> > Basically, I have several XML files and I would like to merge using
> > "merge.xslt" and using the libxslt API's from my code. Actually I can
> > specify only two files there, which needs to be merged.
> >
> > So, I thought if I can pass on the DOM tree to merge.xslt, I can merge
> > any number of xml files. Please let me know, if you have any idea on
> > using libxslt in this case.
> >
> > Otherwise, is it possible to use saxon (its api) over libxml2 for
> > merging DOM trees using "merge.xslt". Please give me the pointers to
> > do that.
> >
> > Thanks
> > Senthil Nathan R

Current Thread