Hi all, Can AxKit apply different styles towards the end of a long pipeline?
My processing model is:
AxKit generates XML with AxHandleDirs
-> Half a dozen stylesheets run to munge this XML
-> 2html.xsl gets run to convert the result to HTML
The stylesheets are all specified with AxAddRootProcessor:
AxAddRootProcessor text/xsl foo.xsl \
{http://axkit.org/2002/filelist}filelist
AxAddRootProcessor text/xsl bar.xsl \
{http://axkit.org/2002/filelist}filelist
# ... repeat with different stylesheets
AxAddRootProcessor text/xsl 2html.xsl \
{http://axkit.org/2002/filelist}filelist
This much works fine.
Now I've started experimenting with RSS, and figure it would be nice to
automatically generate a RSS output. A natural way of doing this (to
me) is with a parameter on the end of the URL to specify the format.
Which is exactly what Apache::AxKit::StyleChooser::QueryString is
supposed to do.
So I changed the config file, and added:
AxAddPlugin Apache::AxKit::StyleChooser::QueryString
Then I removed the final AxAddRootProcessor line, and replaced it with:
<AxStyleName "#default">
AxAddRootProcessor text/xsl 2html.xsl \
{http://axkit.org/2002/filelist}filelist
</AxStyleName>
<AxStyleName "rss">
AxAddRootProcessor text/xsl 2rss.xsl \
{http://axkit.org/2002/filelist}filelist
</AxStyleName>
On restarting the server, requests without the '?style=rss' parameter
worked fine. Since the 2html.xsl stylesheet doesn't operate on
<filelist> elements (it relies on the preceeding stylesheets to have
completely changed the structure of the document) this would seem to
indicate that the #default entry is being run as the last thing in the
processing chain.
However, requests with the '?style=rss' parameter failed to generate
sensible output. After digging around, I put the identity transform in
to 2rss.xsl, to see what the XML it was being sent looked like, and
discovered that it was getting the original XML generated by
AxHandleDirs, and *not* the result of the transformations that the other
stylesheets were doing.
I'm using Axkit 1.61. Bug, or user error on my part?
N
--
Internet connection, $19.95 a month. Computer, $799.95. Modem, $149.95.
Telephone line, $24.95 a month. Software, free. USENET transmission,
hundreds if not thousands of dollars. Thinking before posting, priceless.
Somethings in life you can't buy. For everything else, there's MasterCard.
-- Graham Reed, in the Scary Devil Monastery
pgp00000.pgp
Description: PGP signature
