You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Corneanu Dan <cd...@savatech.ro> on 2000/12/20 08:18:15 UTC

help XLT+FO+TOMCAT

Hi,

I have a small problem, I use fop for transforming XML to PDF from
within a JSP bean that runs in Tomcat. No, the problem is with the XSLT
file that is composed from two subfiles, like this:

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
       xmlns:fo="http://www.w3.org/1999/XSL/Format">
 <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>

 <!-- ================================= -->
 <!--        PARAMETERS                                   -->
 <!-- ================================= -->
 <xsl:param name="baseDir" select="'./'"/>
  ..................................

<xsl:template  ...... >
  <!-- ======================================= -->
  <!--           Auction
description                                         -->
  <!-- ======================================= -->
  <xsl:apply-templates select="{$baseDir}/auction-description"/>

  <!-- ======================================= -->
  <!--           Auction
status                                                 -->
  <!-- ======================================= -->
  <xsl:apply-templates select="{$baseDir}/auction-status"/>
</xsl:template>

When I want to apply the XSLT it says that it cannot find the file
{$baseDir}/auction-status. Why the substitution of {$baseDir} is not
made?
I want {$baseDir} to be the directory where all my XSLT files are
placed. Is there any way to solve this problem? I cant put a relative
path because  it wont be relative to the main XSLT file.

Thanks, Dan.


Re: AW: help XLT+FO+TOMCAT

Posted by Corneanu Dan <cd...@savatech.ro>.
My mistake, so much for copy-paste. The file was:
<xsl:template ...>
<xsl:param name="baseDir" select="'./'"/>
......
<xsl:include href="{$baseDir}/descriptionToPDF.xslt"/>
<xsl:include href="{$baseDir}/statusToPDF.xslt"/>
......
</xsl:template>

Sorry for this. The problem is that I can't include those two files.

"Volker.Reichel" wrote:

> Hi Dan,
>
> it looks as if you are mixing up file access and node processing.
> Your template
>   <xsl:apply-templates select="{$baseDir}/auction-description"/>
>
> won't select a file in any of your directories because the syntax
> you are using is intended to traverse a tree of nodes.
>
> When you want to read a file you should do something like:
>   <xsl:apply-templates
> select="document(concat($baseDir,auction-description))"/>
> this will read the auction-description file from $baseDir.
>
> Hope this helps
>
> Volker
>
> > -----Ursprungliche Nachricht-----
> > Von: Corneanu Dan [mailto:cdan@savatech.ro]
> > Gesendet: Mittwoch, 20. Dezember 2000 08:18
> > An: fop-dev@xml.apache.org
> > Betreff: help XLT+FO+TOMCAT
> >
> >
> > Hi,
> >
> > I have a small problem, I use fop for transforming XML to PDF from
> > within a JSP bean that runs in Tomcat. No, the problem is with the XSLT
> > file that is composed from two subfiles, like this:
> >
> > <xsl:stylesheet version="1.0"
> > xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> >        xmlns:fo="http://www.w3.org/1999/XSL/Format">
> >  <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
> >
> >  <!-- ================================= -->
> >  <!--        PARAMETERS                                   -->
> >  <!-- ================================= -->
> >  <xsl:param name="baseDir" select="'./'"/>
> >   ..................................
> >
> > <xsl:template  ...... >
> >   <!-- ======================================= -->
> >   <!--           Auction
> > description                                         -->
> >   <!-- ======================================= -->
> >   <xsl:apply-templates select="{$baseDir}/auction-description"/>
> >
> >   <!-- ======================================= -->
> >   <!--           Auction
> > status                                                 -->
> >   <!-- ======================================= -->
> >   <xsl:apply-templates select="{$baseDir}/auction-status"/>
> > </xsl:template>
> >
> > When I want to apply the XSLT it says that it cannot find the file
> > {$baseDir}/auction-status. Why the substitution of {$baseDir} is not
> > made?
> > I want {$baseDir} to be the directory where all my XSLT files are
> > placed. Is there any way to solve this problem? I cant put a relative
> > path because  it wont be relative to the main XSLT file.
> >
> > Thanks, Dan.
> >
> >


AW: help XLT+FO+TOMCAT

Posted by "Volker.Reichel" <Vo...@freenet.de>.
Hi Dan,

it looks as if you are mixing up file access and node processing.
Your template
  <xsl:apply-templates select="{$baseDir}/auction-description"/>

won't select a file in any of your directories because the syntax
you are using is intended to traverse a tree of nodes.

When you want to read a file you should do something like:
  <xsl:apply-templates
select="document(concat($baseDir,auction-description))"/>
this will read the auction-description file from $baseDir.

Hope this helps

Volker

> -----Ursprungliche Nachricht-----
> Von: Corneanu Dan [mailto:cdan@savatech.ro]
> Gesendet: Mittwoch, 20. Dezember 2000 08:18
> An: fop-dev@xml.apache.org
> Betreff: help XLT+FO+TOMCAT
>
>
> Hi,
>
> I have a small problem, I use fop for transforming XML to PDF from
> within a JSP bean that runs in Tomcat. No, the problem is with the XSLT
> file that is composed from two subfiles, like this:
>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>        xmlns:fo="http://www.w3.org/1999/XSL/Format">
>  <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
>
>  <!-- ================================= -->
>  <!--        PARAMETERS                                   -->
>  <!-- ================================= -->
>  <xsl:param name="baseDir" select="'./'"/>
>   ..................................
>
> <xsl:template  ...... >
>   <!-- ======================================= -->
>   <!--           Auction
> description                                         -->
>   <!-- ======================================= -->
>   <xsl:apply-templates select="{$baseDir}/auction-description"/>
>
>   <!-- ======================================= -->
>   <!--           Auction
> status                                                 -->
>   <!-- ======================================= -->
>   <xsl:apply-templates select="{$baseDir}/auction-status"/>
> </xsl:template>
>
> When I want to apply the XSLT it says that it cannot find the file
> {$baseDir}/auction-status. Why the substitution of {$baseDir} is not
> made?
> I want {$baseDir} to be the directory where all my XSLT files are
> placed. Is there any way to solve this problem? I cant put a relative
> path because  it wont be relative to the main XSLT file.
>
> Thanks, Dan.
>
>