[xslt] libxslt and merge.xslt parameters



Hi All,
I'm trying to merge 2 or more XML's to form a single XML
using "merge.xslt", from the foll. link,
  http://www2.informatik.hu-berlin.de/~obecker/XSLT/#merge

I'm doing this using libxslt. I need to specify the static file names as,
merge.xml ---->
 <merge xmlns="http://informatik.hu-berlin.de/merge">
     <file1>file1.xml</file1>
     <file2>file2.xml</file2>
  </merge>

Suppose if I have the DOM tree of those files in memory, how
should I need to use merge.xslt to merge the trees in memory??
 
Actually in merge.xslt, the files specified are accessed as,
 <xslt:call-template name="m:merge">
     <xslt:with-param name="nodes1"
 select="document($file1,/*) /node()" />
     <xslt:with-param name="nodes2"
 select="document($file2,/*)/node()" />  </xslt:call-template>
 
Using libxslt api's the stylesheet is applied on the xml as,
       cur = xsltParseStylesheetFile((const xmlChar *)"merge.xslt");
       doc = xmlParseFile("merge.xml");
       res = xsltApplyStylesheet(cur, doc, params);

So, how can I pass the two input DOMs to the sylesheet as parameters and
replace the calls on document() by references to the parameters using LIBXSLT.
 
Thanks
Senthil


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]