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

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?

4 Comments

Original Poster

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

Original Poster

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

DragonChris;8108959

I have a feeling my third line might require some parameters, but if … 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.

Original Poster

dxx;8109122

Type "java /?" to see what the command line parameters are, and craft … 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 thisprocessname.exe /file:whichever.xml /outputfile:wherever.htm /action:dowhatever /options:silentmodeBy 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
Avatar
@
    Text
    Top Discussions
    1. Sad news about Barcelona1524
    2. ❅☁☁❅ I want☼to talk☼about the☔WEATHER☔no politics☃no religion❅☁☁❅18846098
    3. Pink Balls37
    4. I banned myself from HUKD for 3m, I saved so much money!1415

    See more discussions