xsl-list
[Top] [All Lists]

xsl:document, file formats

2003-01-27 04:27:41
Hi

I using Saxon to generate a .bat file.

<t:transform
  version="1.1"
[...]
  <t:template name="validation_batch_file">
    <t:document
      href="validation_generated.bat"
      method="text">
      <t:text>@echo off&#xA;</t:text>
      <t:text>call _validate ../index.xml&#xA;</t:text>
      <t:for-each select="//chapter">
        <t:text>call _validate ../</t:text>
        <t:call-template name="clean">
          <t:with-param name="input" select="title"/>
        </t:call-template>
        <t:value-of select="concat('.', $filename_suffix, '&#xA;')"/>
      </t:for-each>
    </t:document>
  </t:template>
[...]

The .bat doesn't work; it seems to be related to line-endings.

(using Vim commands:)

  :set ff?
brings
  fileformat=unix

Doing

  :set ff=dos
  :w

helps; the .bat then runs OK.

I could run the generated .bat through a tiny script, but I'd prefer to not to.
How could I set the fileformat to DOS in the t:document's attributes?
Or should I use a different line-break instead of '&#xA;'?
( & # x A ; )

Tobi

--
http://www.pinkjuice.com/


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



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