This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Page breaks for text-only (not HTML) output?



>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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]