You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Michael Wechner <mi...@wyona.org> on 2002/08/12 15:48:35 UTC
XPath selector or XPath matcher
Hi
Is anybody working on a XPath selector or XPath matcher?
I have situations where I would like to select the pipeline or
at least the XSLT depending on the value of an attribute within the
generated XML.
Thanks
Michael
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
Re: XPath selector or XPath matcher
Posted by Joerg Heinicke <jo...@gmx.de>.
Michael Wechner wrote:
> Hi
>
> Is anybody working on a XPath selector or XPath matcher?
>
> I have situations where I would like to select the pipeline or
> at least the XSLT depending on the value of an attribute within the
> generated XML.
>
> Thanks
>
> Michael
Why don't you use pure XSLT?
An example:
<data media="printer">
<table>
<bla/>
</table>
</data>
XSLT:
<xsl:stylesheet>
<xsl:import href="printer.xsl"/>
<xsl:import href="pc-browser.xsl"/>
<xsl:import href="pda-browser.xsl"/>
</xsl:stylesheet>
printer.xsl:
<xsl:stylesheet>
<xsl:template match="data[@media='printer']">
</xsl:template>
<xsl:stylesheet>
pc-browser.xsl:
<xsl:stylesheet>
<xsl:template match="data[@media='pc']">
</xsl:template>
<xsl:stylesheet>
and so on. The rest stays the same.
Regards,
Joerg
--
System Development
VIRBUS AG
Fon +49(0)341-979-7419
Fax +49(0)341-979-7409
joerg.heinicke@virbus.de
www.virbus.de
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
RE: XPath selector or XPath matcher
Posted by Artur Bialecki <ar...@digitalfairway.com>.
If you want to do it with the current system you
can:
1 - create an action that processes you XSP and stores
it as DOM on the request, similar to ServerPagesAction
2 - create an action that given XPath will find the
node/attribute in a stored DOM and return it's value
as a sitemap parameter.
3 - use the sitemap parameter for your logic.
4 - have a generator that serializes the stored DOM
into sax events, similar to SessionAttributeGenerator.
Artur...
> -----Original Message-----
> From: Michael Wechner [mailto:michael.wechner@wyona.org]
> Sent: Monday, August 12, 2002 9:49 AM
> To: cocoon-users@xml.apache.org
> Subject: XPath selector or XPath matcher
>
>
> Hi
>
> Is anybody working on a XPath selector or XPath matcher?
>
> I have situations where I would like to select the pipeline or
> at least the XSLT depending on the value of an attribute within the
> generated XML.
>
> Thanks
>
> Michael
>
>
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
>
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>