You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ruairi <ru...@rutlands.com> on 2001/07/05 12:47:51 UTC

Xalan Redirect for multiple output from Web Page

Hi,

I need to generate a few html files from one request.  I have tried
xt:document with little success, so  I am now trying Xalan's Redirect.  I
run the following XSL through Cocoon and get no error messages.  However no
extra files are generated on the server.

Is this a directory permissions issue?


BTW, Is this a question for the users list, or the developers list?

Thanks in advance.
-Ruairi

XSL File:

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

    		xmlns:lxslt="http://xml.apache.org/xslt"
    		xmlns:redirect="org.apache.xalan.xslt.extensions.Redirect"
    		extension-element-prefixes="redirect"

                xmlns:xlink="http://www.w3.org/1999/xlink"
                exclude-result-prefixes="xlink">

  <xsl:output method="html"/>

  <xsl:template match="*[@xlink:type = 'simple' and @xlink:href]">
   <li><a href="{@xlink:href}"
onmouseover=""><xsl:apply-templates/></a></li>
  </xsl:template>

  <xsl:template match="course">
   <html><body>
    <h2>Exercise Links</h2>

    <xsl:for-each select="solutions|originals">
       <h3><a href="{@file}">Exercise <xsl:value-of select="."/></a></h3>

    	<redirect:write file="ccrap.html">

          <html>
          <title><xsl:value-of select="."/></title>
          <body>
             <h2>Exercise <xsl:value-of select="."/></h2>
             <ul>

               <xsl:apply-templates select="*"/>


             </ul>

             <a href="xlink.xml">Case Study - Home</a>
          </body></html>
        </redirect:write>
    </xsl:for-each>

    Course by <a href="{author/@xlink:href}"><xsl:value-of
select="author"/></a>
   </body></html>
  </xsl:template>

</xsl:stylesheet>

XML file:
<?xml version="1.0"?>
<?xml-stylesheet href="ex52b.xsl" type="text/xsl"?>
<?cocoon-process type="xslt"?>

<course xmlns:xlink="http://www.w3.org/1999/xlink">
  <author xlink:href="http:/www.rutlands.com"
          xlink:type="simple">Ruairi O'Donnell</author>
  <solutions file="soultions.html" tpye="html">
    <exercise xlink:href="http:/localhost/solutions/ex11/"
                xlink:type="simple"
xlink:title="Ex1.1">Description</exercise>
    <exercise xlink:href="http:/localhost/solutions/ex12/"
                xlink:type="simple"
xlink:title="Ex1.2">Description</exercise>
  </solutions>
  <originals file="originals.html" tpye="html">
      <exercise xlink:href="http:/localhost/start/ex11/"
                  xlink:type="simple"
xlink:title="Ex1.1">Description</exercise>
      <exercise xlink:href="http:/localhost/start/ex12/"
                  xlink:type="simple"
xlink:title="Ex1.2">Description</exercise>
  </originals>
</course>


Regards,
-Ruairi
********************************************************************


Re: Xalan Redirect for multiple output from Web Page

Posted by Robert Koberg <ro...@koberg.com>.
>        <h3><a href="{@file}">Exercise <xsl:value-of select="."/></a></h3>
>
>     <redirect:write file="ccrap.html">


I think you might want (I assume the @file is a relative path, otherwise
provide the full system path):

<h3><a href="{@file}">Exercise <xsl:value-of select="."/></a></h3>

 <redirect:write select="@file">

but, there is an XSL list which I believe is at mullberrytech.com



----- Original Message -----
From: "Ruairi" <ru...@rutlands.com>
To: <to...@jakarta.apache.org>
Sent: Thursday, July 05, 2001 3:47 AM
Subject: Xalan Redirect for multiple output from Web Page


> Hi,
>
> I need to generate a few html files from one request.  I have tried
> xt:document with little success, so  I am now trying Xalan's Redirect.  I
> run the following XSL through Cocoon and get no error messages.  However
no
> extra files are generated on the server.
>
> Is this a directory permissions issue?
>
>
> BTW, Is this a question for the users list, or the developers list?
>
> Thanks in advance.
> -Ruairi
>
> XSL File:
>
> <?xml version="1.0"?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>
>     xmlns:lxslt="http://xml.apache.org/xslt"
>     xmlns:redirect="org.apache.xalan.xslt.extensions.Redirect"
>     extension-element-prefixes="redirect"
>
>                 xmlns:xlink="http://www.w3.org/1999/xlink"
>                 exclude-result-prefixes="xlink">
>
>   <xsl:output method="html"/>
>
>   <xsl:template match="*[@xlink:type = 'simple' and @xlink:href]">
>    <li><a href="{@xlink:href}"
> onmouseover=""><xsl:apply-templates/></a></li>
>   </xsl:template>
>
>   <xsl:template match="course">
>    <html><body>
>     <h2>Exercise Links</h2>
>
>     <xsl:for-each select="solutions|originals">
>        <h3><a href="{@file}">Exercise <xsl:value-of select="."/></a></h3>
>
>     <redirect:write file="ccrap.html">
>
>           <html>
>           <title><xsl:value-of select="."/></title>
>           <body>
>              <h2>Exercise <xsl:value-of select="."/></h2>
>              <ul>
>
>                <xsl:apply-templates select="*"/>
>
>
>              </ul>
>
>              <a href="xlink.xml">Case Study - Home</a>
>           </body></html>
>         </redirect:write>
>     </xsl:for-each>
>
>     Course by <a href="{author/@xlink:href}"><xsl:value-of
> select="author"/></a>
>    </body></html>
>   </xsl:template>
>
> </xsl:stylesheet>
>
> XML file:
> <?xml version="1.0"?>
> <?xml-stylesheet href="ex52b.xsl" type="text/xsl"?>
> <?cocoon-process type="xslt"?>
>
> <course xmlns:xlink="http://www.w3.org/1999/xlink">
>   <author xlink:href="http:/www.rutlands.com"
>           xlink:type="simple">Ruairi O'Donnell</author>
>   <solutions file="soultions.html" tpye="html">
>     <exercise xlink:href="http:/localhost/solutions/ex11/"
>                 xlink:type="simple"
> xlink:title="Ex1.1">Description</exercise>
>     <exercise xlink:href="http:/localhost/solutions/ex12/"
>                 xlink:type="simple"
> xlink:title="Ex1.2">Description</exercise>
>   </solutions>
>   <originals file="originals.html" tpye="html">
>       <exercise xlink:href="http:/localhost/start/ex11/"
>                   xlink:type="simple"
> xlink:title="Ex1.1">Description</exercise>
>       <exercise xlink:href="http:/localhost/start/ex12/"
>                   xlink:type="simple"
> xlink:title="Ex1.2">Description</exercise>
>   </originals>
> </course>
>
>
> Regards,
> -Ruairi
> ********************************************************************
>