Individual command lines run; do not as batch
Added by Anonymous almost 14 years ago
Legacy ID: #9068817 Legacy Poster: Chas Mosaur (chasmosaur)
I perform some occasional XSLT work, and for years, I used Instant Saxon on my Windows machine. Recently switching to a Mac, I decided to use the Java platform of Saxon-HE 9.2. I have included all files in the same subdirectory of my project. When I use the terminal to run individual command lines, it works perfectly. However, collecting the individual commands into a batch-file (with the proper chmod), I get successive errors that the xslt files don't exist. The only time I do not see this error is when it processes the final command - then, it will run the XSLT correctly (with the standing XML, not the updated data set I wanted extracted) and without error. (Yes, I know this isn't elegant, I'm hoping to use XSLT 2.0 to streamline my programming.) EXAMPLES: So here are the individual command lines: java -jar ./saxon9he.jar -o sessions.xml wbc.xml sessions_step.xslt java -jar ./saxon9he.jar -o sessions_1.inc sessions.xml sessions_1_inc.xslt java -jar ./saxon9he.jar -o sessions_2.inc sessions.xml sessions_2_inc.xslt And here's the error messages I receive: does not exist sessions_step.xslt does not exist sessions_1_inc.xslt So I don't get fresh sessions.xml or sessions_1.inc, but I do get a fresh sessions_2.inc Being new to Mac and the more robust version of Saxon, is this a Mac error or a Saxon error? My husband - who is far more experienced in Mac, command lines, Java and programming in general - walked me through some basic and obvious fixes (i.e. - more fully expressing the file locations), but nothing worked. Since he's working on his PhD and doesn't have time to debug my stuff, I'm hoping someone here can help me :) Thanks in advance for any assistance someone can provide. This is only one of a few batches I run for this project (a non-profit with lots of data but really cheap hosting) - I have some that are several times longer, so it would be royally irritating to continually type in commands to get the correct output.
Replies (3)
Please register to reply
RE: Individual command lines run; do not as batch - Added by Anonymous almost 14 years ago
Legacy ID: #9068901 Legacy Poster: Michael Kay (mhkay)
The error message is coming from the command line processor (or possibly from Java) - not from Saxon. I'm afraid I'm not familiar with the batch command processor on Mac, so I don't recognize the problem. I'd suggest trying with this form of the command: [code]java -cp saxon9he.jar net.sf.saxon.Transform -t -s:wbc.xml -xsl:sessions_step.xslt -o:sessions.xml[/code] At the very least you might get a different error message which might give some clue as to why the command processor is confused.
RE: Individual command lines run; do not as batch - Added by Anonymous almost 14 years ago
Legacy ID: #9069078 Legacy Poster: Chas Mosaur (chasmosaur)
Thanks so much. I had a suspicion it was more of a Mac issue, but I had to start somewhere. I'll try that command line, and if it doesn't work, I'll try posting on some Mac boards. It's great to see that a decade on (I posted questions years ago to the Mulberry XSLT mailing list), you're still enormously helpful :D
RE: Individual command lines run; do not as batch - Added by Anonymous almost 14 years ago
Legacy ID: #9069339 Legacy Poster: Chas Mosaur (chasmosaur)
As an FYI - my husband recommended I create a shell script in vi instead of a basic batch file - that worked like a charm. He thinks that perhaps even the basic text editor was throwing in some characters that may have been causing the error message. Thanks again, and hopefully, this topic will help someone else in my situation.
Please register to reply