cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Ball <ba...@webslingerZ.com>
Subject XSP taglib question
Date Tue, 13 Jun 2000 18:58:23 GMT
Hi guys. I was going back and revising one of my older cocoon sites. In
this site, I'm using my high-level namespace trick to hide complexity in
the pages. I start with this:

<news:headlines area="homepage"/>

do an XSLT pass to turn it into this:

<sql:execute-query>
 <sql:driver>...</sql:driver> 
 ...
</sql:execute-query>

then an XSP pass to do the logic, then a final XSLT pass to turn it into
HTML.

It occured to me that I should be able to accomodate the first step inside
XSP itself by treating the first XSLT stylesheet as a taglib. So I tried
rewriting the page that way, but it doesn't work as expected. Instead of
ending up with java code that calls the SQL library, I end up with java
code that writes out elements in the SQL namespace - e.g.

    xspParentNode = xspCurrentNode;
    xspNodeStack.push(xspParentNode);
    xspCurrentNode =
      document.createElement("sql:execute-query");
    xspParentNode.appendChild(xspCurrentNode);

Here's the header from my taglib stylesheet:

<xsl:stylesheet
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:news="http://www.webslingerZ.com/XML/News"
  xmlns:sql="http://www.apache.org/1999/SQL"
  version="1.0"
>

and here's the header from a data file:

<?xml version="1.0"?>
<?xml-stylesheet href="index.xsl" type="text/xsl"?>
<?cocoon-process type="xsp"?>
<?cocoon-process type="xslt"?>

<xsp:page 
        language="java"
        xmlns:xsp="http://www.apache.org/1999/XSP/Core"
        xmlns:unclaw="http://www.webslingerZ.com/XML/News"
        xmlns:sql="http://www.apache.org/1999/SQL"
>

Am I doing something wrong or is this simply not possible in XSP itself?

- donald


Mime
View raw message