cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Per Kreipke" <...@onclave.com>
Subject RE: ESQL in stylesheet question
Date Wed, 18 Oct 2000 01:06:40 GMT
Seems to me that you're trying to make a taglib of your own that then calls
the esql taglib.

E.g. the user specifies this XML 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:request="http://www.apache.org/1999/XSP/Request"
> >>     xmlns:myss="http://someurl.com/myss"
> >>  >
> >>
> >>  <data>
> >>     <myss:query/>
> >>  </data>
> >>
> >>  </xsp:page>

You're trying to convert the <myss:query> tag to the proper <esql:...> tags
and have those execute.

This is very similar to the clean-page example.

The trick is to use processing instructions to build the proper chain of
files.

Try something like this:

index.xml ------------------------------------

<?xml version="1.0"?>
<!-- transform your custom tags to XSP -->
<?cocoon-process type="xslt"?>
<?xml-stylesheet href="index.xsl" type="text/xsl"?>
<page>
	<myss:query>
</page>

index.xsl ------------------------------------

<?xml version="1.0"?>

<xsl:stylesheet version="1.0"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns:xsp="http://www.apache.org/1999/XSP/Core"
   xmlns:esql="
>
  <xsl:template match="page">
    <!-- set up the next processing. E.g. after the transform, call XSP,
then output the page as HTML -->
    <xsl:processing-instruction
name="cocoon-process">type="xsp"</xsl:processing-instruction>
    <xsl:processing-instruction
name="cocoon-process">type="xslt"</xsl:processing-instruction>
    <xsl:processing-instruction name="xml-stylesheet">href="output.xsl"
type="text/xsl"</xsl:processing-instruction>
      <!-- Build the XSP file here -->
      <xsp:page language="java" 
		xmlns:xsp="http://www.apache.org/1999/XSP/Core"
		xmlns:esql="http://apache.org/cocoon/SQL/v2">
        <db_table>
          <esql:query-results>
		....
          </esql:query-results>
        </db_table>
     </xsp:page>
  </xsl:template>
</xsl:stylesheet>

output.xsl ---------------------------------------

<?xml version="1.0"?>

<xsl:stylesheet version="1.0">
   <xsl:template match="db_table">
    do your worst....
   </xsl:template>
</xsl:stylesheet>



Per

Mime
View raw message