[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: xsl:param and replace.xsl

Subject: RE: xsl:param and replace.xsl
From: "Chris Bayes" <chris@xxxxxxxxxxx>
Date: Fri, 14 Dec 2001 10:12:34 -0000
xml replace
Mike,
This is a dos question
If you do this

saxon authors.xml replace.xsl > newfile.xml

Of course authors.xml remains untouched because the result is in
newfile.xml.
You cant do this

saxon authors.xml replace.xsl > authors.xml

Because dos opens authors.xml for redirecting to before saxon opens it
so it will be empty and saxon will give you an error on the input file.

Error
  java.io.EOFException: no more input
Transformation failed: run-time errors were reported

But you can do this

Saxon -o authors.xml authors.xml replace.xsl

Which will replace authors.xml with the result of the transform.
But as people have said it isn't usualy a good idea to do it but saxon
will not overwrite the output file if there is an error in the transform
;-)

Ciao Chris

XML/XSL Portal
http://www.bayes.co.uk/xml


> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of 
> Mike Ferrando
> Sent: 13 December 2001 17:58
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  xsl:param and replace.xsl
> 
> 
> Friends,
> I am trying to process some xml xsl documents from Michael 
> Kay's book on page 518 (authors.xml replace.xsl).
> 
> My objective is to use the xsl stylesheet to replace text in 
> a xml document without creating a new document. But I am 
> getting an error when I type the command at the dos prompt 
> for saxon. The command line is given in the book.
> 
> saxon source.xml replace.xsl replace=author by=***
> 
> The error I get is "Source file source.xml does not exist."
> 
> So, I typed in "authors.xml" for "source.xml" and I get the 
> output in the dos window. I can create a file with it by 
> ">newfile.xml", but the authors.xml file is untouched.
> 
> Anybody know what I am doing wrong?
> 
> Mike F.
> 
> __________________________________________________
> Do You Yahoo!?
> Check out Yahoo! Shopping and Yahoo! Auctions for all of
> your unique holiday gifts! Buy at http://shopping.yahoo.com
> or bid at http://auctions.yahoo.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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.