Well, it IS possible to do recursive application of templates, basically
you just have to use document() to suck in the node set you want, and
then call <xsl:apply-templates/> on it.
Something like:
<xsl:template match='include'>
<xsl:variable name='newdoc'
select='common:node-set(document(@docurl))'/>
<xsl:apply-templates select='$newdoc'/>
</xsl:template>
should basically do the trick. I think IIRC you will need to use the
exslt node-set function. Perhaps I'm misremembering though when the
variable is built using document()... Anyway I'm sure you can work it out.
Scott Penrose wrote:
Well I have answered my own question... mostly
Here is a simple stylesheet to do expansion via document() with one
problem...
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>
<xsl:output
method = "xml"
indent = "yes"
/>
<xsl:template match="object">
<xsl:if test="@href">
<xsl:apply-templates select="document(@href)"/>
</xsl:if>
</xsl:template>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
This works perfectly for including other XML documents, however these
documents are not themselves executed through their own templates first.
Let us say that we have our first XML file being an index page, the
embedded (object) second page is a RSS news feed, well that would
need to go through "rss2htmlfragment.xsl" first.
Now you go directly to news.rss and it has
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="rss2htmlfragment.xsl" ?>
correctly being executed and outputing the format I want.
But now I call it with the document() call in the above style sheet
it just grabs the original XML.
Is there some way in XSL or AxKit that I can get it to go back
through Apache rather than a local xml file - ala document.
The reason of course is that I might ask for, instead of XML, a URL
that implements AxKit::Provider::RDBMS or other content generation
provider.
Now it occurs to me that all I really have to do is write a simple
Taglib which implements object, calling back into apache - thus any
URL will do, it could even be a non-AxKit document producing the XML.
Although this is technically not very hard I am concerned that it
might be slow and not really the right thing to do.
Any advice from the experts on the list :-)
BTW. Is this a development question or a user question. I get the
impression that the dev list is for development of AxKit itself,
where as I am simply using AxKit.
Thanks
Scott
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]