xsl-list
[Top] [All Lists]

Determining the extension of the output file?

2003-03-05 07:38:40
Hello all,

I am doing a very simple example that transforms an XML file into and HTML file after applying and XSL using libxml2 and libxslt.
I use the xmlSaveFile() function to save to disk the output HTML file.
For that I put in my code:
...
res = xsltApplyStylesheet(cur, doc, params)
xmlSaveFile("output.html", res);
...

But my problem is that sometimes I am going to use an XSL that shall transform the XML to HTML and sometimes I shall use other XSL that shall transform the XML to another different XML... and I would like to call my output file output.html or output.xml depending on the type of XSL I apply.

So I have thought that when I am parsing my XSL with the function xsltParseStylesheetFile() I should try to determine if there is an <html...> tag in the XSL or and <xml...>. I have been looking for a function in the libxslt API that can di this for mi but I haven´t found any :( ...

Does anybody knows if there is a function in the libxslt API that can do that?
Should I look in the libxml2 API instead?

Thanks in advance!

esther

--

Esther Parrilla Endrino
Ground Segment Systems Division
DEIMOS SPACE S.L.
e-mail: esther(_dot_)parrilla(_at_)deimos-space(_dot_)com
tel:    00 34 91 806 34 57

~ Code matters more than comercials ~

--



XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>