[SlugBug] a perl/xslt question. potentially inappropriate.

Chris J cej at nightwolf.org.uk
Fri Apr 1 09:51:04 BST 2005


[[ apologies to Mike who'll see this twice, forgot the list in the first
	response ]]

[[ replies inline ]]

> Context: I'm trying to set up a documentation wiki for an open-source
> program called Scilab, which is a sort-of alternative to Matlab. I'm an
> Engineering PhD student at the University. I'm doing this because...
> ermm... I don't know why I'm doing this. It's not part of my studies.

I vaugely remember scilab; looked at it once many many years ago...

...[deletia]...

>
> Problem (low-level): I'm using the Perl module XML::XSLT to try and do
> the conversion and, to make sure everything's hunky-dory, I'm using the
> XSLT stylesheet that already does the conversion between the XML and
> Scilab's existing (and bad) HTML online help. Nothing's hunky-dory,
> errors occur i think, within the module when I try and do the
> transform. I can't make the thing work.
>
> Question 0: Is this an appropriate forum to discuss Perl and stuff like
> this? If not, can anyone give me any pointers to an appropriate (and
> local if poss) forum?

It's been done before. I'm sure someone'll shout if it strays too much
off topic :-)

>
> Question 1: Is my Potential Solution viable, or is there a better way?
> For ages I was trying to do screen-scraping stuff and only recently
> found out about XSLT. There is probably other solutions that I could be
> using that I've not heard about.

XSLT's fantastic for converting from XML to something else - XML, HTML or
plain text; I've used it widely for XML to XML/XHTML conversion both at work
and play, and I run a setlist database[1] purely on XSLT. It should be
perfectly viable to use XSLT.

What format are the WIKI entries in?


> Question 2: Is there a different tool with which I can perform the
> transform, either a perl module or some other thing that I can call
> from within a perl script...?

For [1], I use my own CGI[2] written on top of Sablotron[3] - I don't know
if there's a perl hook for it, but it does come with a standalone parser,
sabcmd, which you could call from Perl.  I've never used XML::XSLT, but
if you've worked out how to perform a transform using that, I can't see
why it is any better or worse than any other XSLT/Perl solution.

IIRC, Sablotron is also the XSLT parser used by PHP. Technically it shouldn't
matter what parser is used though if the software authors have implemented
XSLT 1.0 correctly :-)

There's also xmlgawk[4], i.e., Awk with extensions to parse XML. I've
never used it, but intend to investigate it as it looks quite useful for
simple queries.

Chris...

[1] http://cej.nightwolf.org.uk/batfink/
[2] http://cej.nightwolf.org.uk/linux/xslt-cgi.tar.gz
[3] http://www.gingerall.com/charlie/ga/xml/p_sab.xml
[4] http://home.vrweb.de/~juergen.kahrs/gawk/XML/

-- 
\ Chris Johnson           \
 \ cej at nightwolf.org.uk    ~-----,   
  \ http://cej.nightwolf.org.uk/  ~-----------------------------------, 
   \ Redclaw chat - http://redclaw.org.uk - telnet redclaw.org.uk 2000 \____


More information about the SlugBug mailing list