xsl-list
[Top] [All Lists]

RE: Multiple output files

2003-03-05 16:07:21
Hi again!

I've been poking through the various permutations I've been trying today, and finally found the one which seems to have worked. When I set up the template to write the separate output file, I deleted the call-templates that put the material into my main output file. Wrong. I guess that meant that the "wmeta" stuff was never called at all, and hence no separate file was created. I put that call-templates back in, and the file is now being produced. It does seem to be coming out in the input directory, not the output directory, so I've put in a relative path to the output directory in the stylesheet and it's now showing up
where I wanted it to be. Thank you all for your help!


At 04:18 PM 3/5/03, you wrote:
Thank you both for your help. I'm sure you must be right, because when I went
back in and poked around some more, I did find an about-dak.html file in my
input directory -- I thought sure I had already looked there, but apparently not.

However, now that I try to repeat the behavior, I again don't seem to be producing the file, at least not in the place where I found it before or in the directory I actually hope to put it in (or in my home directory, the directory where the xslt files are, the directory where xalan.jar is located, etc.). I'd like to put it in the same directory as my main output file, and that seems to be the default, if I'm reading the following correctly from http://xml.apache.org/xalan-j/apidocs/org/apache/xalan/lib/Redirect.html :

"Calls can take a 'file' attribute and/or a 'select' attribute in order to get the filename. If a select attribute is encountered, it will evaluate that expression for a string that indicates the filename. If the string evaluates to empty, it will attempt to use the 'file' attribute as a default. Filenames can be relative or absolute. If they are relative, the base directory will be the same as the base directory for the output document. This is obtained by calling getOutputTarget() on the TransformerImpl. You can set this base directory by calling TransformerImpl.setOutputTarget() or it is automatically set when using the two argument form of transform() or transformNode(). "

I'm reading this to say that the file should be placed in the same directory as the file I specify with the "-out" switch, which is where I want it to be anyway. The file I found was placed in the directory I specified with the "-in" switch instead, but that doesn't seem to be happening again either. One of my experiments must have done something,
but I seem to be off-track again. Does any of this information help?

Thanks!

At 03:01 PM 3/5/03, you wrote:
My guess is that the about-dak.html file is being written, but not where
you expect. I'm not sure what Xalan's rules for this are.

Michael Kay
Software AG
home: Michael(_dot_)H(_dot_)Kay(_at_)ntlworld(_dot_)com
work: Michael(_dot_)Kay(_at_)softwareag(_dot_)com

> -----Original Message-----
> From: owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
> [mailto:owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com] On Behalf Of
> Chris Loschen
> Sent: 05 March 2003 18:22
> To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
> Subject: [xsl] Multiple output files
>
>
> Hi again!
>
> I'm sure this must be a FAQ, but I don't seem to be finding
> anything anywhere.
>
> I'm trying to use <xalan:write> to redirect part of my XSLT
> output to a
> separate file.
> The stylesheet (in part) looks like this:
>
> <?xml version="1.0" ?>
> <xsl:stylesheet version="1.0"
>          xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
> ...
>          xmlns:xalan="org.apache.xalan.xslt.extensions.Redirect"
>          extension-element-prefixes="xalan" ...>
>
> <xsl:template match="wmeta">
>          <xalan:write file="about-dak.html">
>                  <div class="copyrights">
>                          <h1
> class="logo"><b><xsl:text>AUTHOR</xsl:text></b></h1>
>                          <h3
> class="logo"><xsl:text>TITLE</xsl:text></h3>
>                          <b><xsl:apply-templates select="tle"
> /></b><br />
>                  <xsl:apply-templates select="ack" /><br />
>                  <hr class="half" /><a id="about"></a>
>                  <xsl:apply-templates select="about" /><br />
>                  <hr class="half" />
>                  <i><xsl:text>MS Reader for DAK ISBN
> </xsl:text><xsl:apply-templates select="isbn" /></i><br />
>                  <xsl:apply-templates select="cpy" /><br />
>                  <xsl:apply-templates select="pubhistory" /><br />
>                  <hr class="half" />
>                  </div>
>          </xalan:write>
> </xsl:template>
>
> The wmeta material is no longer appearing in my main output
> file, which is
> good, but I'm not seeing any
> "about-dak.html" file being created at all. My guess from
> perusing the
> xalan site is that it's supposed
> to show up in my output directory, but it's not there, nor do
> I seem to be
> able to find it anywhere else.
> I thought I was following the example from Michael Kay's invaluable
> resource (2nd ed., p. 818) pretty
> exactly, but something isn't flying. Does anyone have a
> suggestion? Thank
> you so much!
>
>
> --Chris
>
> --------------------------------------------------------------
> --------------------------
> Texterity ~ XML and PDF ePublishing Services
> --------------------------------------------------------------
> --------------------------
> Chris Loschen, XML Developer
> Texterity, Inc.
> 144 Turnpike Road
> Southborough, MA 01772 USA
> tel: +1.508.804.3033
> fax: +1.508.804.3110
> email: loschen(_at_)texterity(_dot_)com
> http://www.texterity.com/
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

--Chris

----------------------------------------------------------------------------------------
Texterity ~ XML and PDF ePublishing Services
----------------------------------------------------------------------------------------
Chris Loschen, XML Developer
Texterity, Inc.
144 Turnpike Road
Southborough, MA 01772 USA
tel: +1.508.804.3033
fax: +1.508.804.3110
email: loschen(_at_)texterity(_dot_)com
http://www.texterity.com/

XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

--Chris

----------------------------------------------------------------------------------------
Texterity ~ XML and PDF ePublishing Services
----------------------------------------------------------------------------------------
Chris Loschen, XML Developer
Texterity, Inc.
144 Turnpike Road
Southborough, MA 01772 USA
tel: +1.508.804.3033
fax: +1.508.804.3110
email: loschen(_at_)texterity(_dot_)com
http://www.texterity.com/

XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>