Anyone well versed in writing batch files? [I know you're out there!] - HotUKDeals
We use cookie files to improve site functionality and personalisation. By continuing to use HotUKDeals, you accept our cookie and privacy policy.
Get the HotUKDeals app free at Google Play

Search Error

An error occurred when searching, please try again!

Login / Sign UpSubmit

Anyone well versed in writing batch files? [I know you're out there!]

£0.00 @
Time to see if the shopping forums' regulars can assist with their technical knowledge. Basically, I'm trying to write a batch file to run a series of commands in cmd, so I don't have to, but will … Read More
DragonChris Avatar
7y, 4m agoPosted 7 years, 4 months ago
Time to see if the shopping forums' regulars can assist with their technical knowledge.

Basically, I'm trying to write a batch file to run a series of commands in cmd, so I don't have to, but will then allow me to use it within another batch. The second one is fine, but it's the first one I'm having difficulty with as I actually don't know what I'm doing.

I'm trying to run the Xalan processor to convert xml files into html, using an xsl stylesheet.

It works fine in cmd, but I want the batch to run xalan, then the following batches will input the files to be processed.

The command line prompts I want to input into this batch are as follows: (See first post, the opening removed my backslash)

That's it. Anyone know how to write that in a batch?
DragonChris Avatar
7y, 4m agoPosted 7 years, 4 months ago
Options

All Comments

(4) Jump to unreadPost a comment
Comments/page:
#1
set classpath="C:\Documents and Settings\Chris\Desktop\XML_v8\process\xalan-j_2_7_0\xalan.jar"

cd C:\Documents and Settings\Chris\Desktop\XML_v8

java org.apache.xalan.xslt.Process
#2
I have a feeling my third line might require some parameters, but if someone can get me started, would be much appreciated! Spent hours working on this and gotten no where :(
#3
DragonChris
I have a feeling my third line might require some parameters, but if someone can get me started, would be much appreciated! Spent hours working on this and gotten no where :(


Type "java /?" to see what the command line parameters are, and craft your command accordingly. I don't know how the java EXE works, but the general rule is that a command should work like this

processname.exe /file:whichever.xml /outputfile:wherever.htm /action:dowhatever /options:silentmode

By the looks of it, you're just executing a Java process that hosts the converter program, but not actually telling the program what to do when it's loaded. You're not telling it what data to load, what data to output, or how actually to process the data, so unless all that stuff is already known to xalan, it probably won't be able to do anything.

Unfortunately, I can't give you any more solid answers, but I hope that gives you something to go on.
#4
dxx
Type "java /?" to see what the command line parameters are, and craft your command accordingly. I don't know how the java EXE works, but the general rule is that a command should work like this

processname.exe /file:whichever.xml /outputfile:wherever.htm /action:dowhatever /options:silentmode

By the looks of it, you're just executing a Java process that hosts the converter program, but not actually telling the program what to do when it's loaded. You're not telling it what data to load, what data to output, or how actually to process the data, so unless all that stuff is already known to xalan, it probably won't be able to do anything.

Unfortunately, I can't give you any more solid answers, but I hope that gives you something to go on.


Yeah, basically it's executing the xalan.jar, then I input the files for transformation. Here's an example:

java org.apache.xalan.xslt.Process -in myPage.xml -xsl XMLtoHTML.xsl -out myPage.html

Post a Comment

You don't need an account to leave a comment. Just enter your email address. We'll keep it private.

...OR log in with your social account

...OR comment using your social account

Thanks for your comment! Keep it up!
We just need to have a quick look and it will be live soon.
The community is happy to hear your opinion! Keep contributing!