cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Max Larsson" <max.lars...@gmservice.de>
Subject RE: [C2.0rc1] SLIGHTLY OFF TOPIC: Has anyone used Xalan extensions in Cocoon?
Date Fri, 19 Oct 2001 08:36:50 GMT
Hi

as long as i knwo you forgotten to define that the
namespace xalan is an extension namespace. How to do
that you have to read the Xalan documentation.

Max

-----Original Message-----
From: Adrian Geissel [mailto:ageissel@zenark.com]
Sent: Freitag, 19. Oktober 2001 10:34
To: cocoon-users@xml.apache.org
Subject: [C2.0rc1] SLIGHTLY OFF TOPIC: Has anyone used Xalan extensions
in Cocoon?


Hi,

I appologise in advance for posting to this mailing list, but I also think
that the answer maybe of interest to the Cocoon community.

What I am trying to do is to build a generic form within C2 that is defined
in an XSP which is aggregated with another path that will contain the data
which is to be plugged into the form, thereby allowing for improved form
(UI) reuse across scenarios. In trying to do this, I need the ability to
perform run-time XPath evaluation, rather than at programming time.

I have found a Xalan extension function (luckily before I wanted to write my
own :) that appears to do the trick. Its called "xalan:evaluate()" and takes
an XPath expression as a parameter, which in turn contains an XPath
expression, which is then evaluated and returned.

I've read the docs, but can't get it to work. The docs say to use the
namespace   xmlns:xalan="http://xml.apache.org/xalan". I'm calling the
extension function in my xml2html transformation stylesheet as follows:

<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:xalan="http://xml.apache.org/xalan"
  xmlns:zdam="zenark.com/zdam"
  exclude-result-prefixes="xalan"
>

<xsl:template ...>

...
        <xsl:choose>
          <xsl:when test="@bind-to">
            <xsl:attribute name="value"><xsl:value-of
select="xalan:evaluate(@bind-to)"/></xsl:attribute>
            </xsl:when>
          <xsl:otherwise><xsl:attribute name="value"><xsl:value-of
select="normalize-space()"/></xsl:attribute></xsl:otherwise>
        </xsl:choose>
...

</xsl:template>

</xsl:stylesheet>

The problem is that evaluate() returns '', rather than the expected real
value. The returned XPath expression (in @bind-to) is correct.

Any thoughts or experiences?
Thanks in advance,
Adrian



---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail: <cocoon-users-help@xml.apache.org>



---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail: <cocoon-users-help@xml.apache.org>


Mime
View raw message