This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Page breaks for text-only (not HTML) output?
- To: <xsl-list at mulberrytech dot com>
- Subject: RE: Page breaks for text-only (not HTML) output?
- From: "Chris Bayes" <Chris at Bayes dot co dot uk>
- Date: Wed, 13 Sep 2000 23:43:16 +0100
- Reply-To: xsl-list at mulberrytech dot com
>ok output a <FF> tag where you want the page break then post process the
>.txt file to change <FF> to x0C. You could do it in 3 lines of perl or 6 or
>so lines of javascript and it wouldn't take too long.
>
something like this off the top of my head
perl
C:> xalan source.xml transform.xsl sansff.txt
C:> type sansff.txt | perl convert.pl > withff.txt
convert.pl----------------------
#!perl
binmode;
my $slurp = join('', <>);
$slurp =~ s/<FF>/\x0C/gs;
print $slurp;
JavaScript
C:> xalan source.xml transform.xsl sansff.txt
C:> cscript convert.js sansff.txt withff.txt
convert.js----------------------
var fso = new ActiveXObject("Scripting.FileSystemObject");
var file = fso.OpenTextFile(WScript.Arguments(0), 1);
var fileStr = file.ReadAll();
fileStr = fileStr.replace(/<FF>/g , String.fromCharCode(12)); // or ""
pasted ff char
var outFile = fso.CreateTextFile(WScript.Arguments(1), true);
outFile.Write(fileStr);
Ciao Chris
>XML/XSL Portal
>http://www.bayes.co.uk/xml
>
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list