[Gllug] XML & XSL problems (formerly off topic)

Pete Ryland pdr at pdr.cx
Wed Sep 10 16:12:29 UTC 2003


On Tue, Aug 12, 2003 at 09:26:03AM +0100, Tethys wrote:
> Dragging things vaguely back on topic... I have an application that
> spits out logs in xml format. There is an accompanying xsl file. In
> theory, Mozilla should be able to view xml/xsl directly. However,
> in practice, it just says:
> 
> 	This XML file does not appear to have any style information
> 	associated with it. The document tree is shown below.

This is probably because the xml file doesn't include an 

<?xml-stylesheet type="text/xsl" href="log.xsl" ?>

processing instruction in it.  Add that to the top of the xml (after the xml
declaration) and it might just work.

> Armed with some information gleaned from Peter Ryland's talk at the
> UKUUG conference, 

I'm glad there was some useful info in the talk. :-)

> I tried to manually convert it to HTML, but with little success:
> 
> 	mammoth:~% xsltproc --verbose --debug log.xsl log20030806_091815.xml 
> 	Added namespace: xsl mapped to http://www.w3.org/TR/WD-xsl
> 	xsltPrecomputeStylesheet: removing ignorable blank node
> 	compilation error: file log.xsl line 2 element stylesheet
> 	xsltParseStylesheetProcess : document is not a stylesheet
> 
> Any ideas? I've attached the log.xsl file in the hopes that it
> means something to someone :-) I freely admit I'm blundering around
> in the dark here. It's a subject that I know very little about. The
> application itself can produce HTML logs as well as the raw XML, but
> only by going into it, clicking a few buttons and requesting it to
> send the formatted logs via email. For a start, that's a very clumsy
> and time consuming process, and secondly, when the application is
> down, you need to be able to just look at the logs on disk...

The XSL document you've got looks like it's pretty old (as xsl documents go)
and AFAIK script/eval is not supported by libxslt although similar is
provided with exlt extensions (http://www.exslt.org/).

I was able to get the xsl to compile with the attached file, but note that
the script and eval bits are commented out and have been re-written with
actual xsl.  Whether this works with your log file is another story. ;-)

Pete
-------------- next part --------------
A non-text attachment was scrubbed...
Name: new_log.xsl
Type: text/xml
Size: 3066 bytes
Desc: not available
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20030910/1d2ce8e6/attachment.xml>
-------------- next part --------------
-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug


More information about the GLLUG mailing list