|
|
 |
| XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the XSLT section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
|
 |

May 15th, 2009, 01:10 AM
|
|
Authorized User
|
|
Join Date: Apr 2009
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Need Saxon help!!!!
Hi all,
i'm using the xslt processor is "saxon9". How to automate to run the saxon in the command prompt due to avoid manually run... I need to convert myxml file name and outputxml file name in the same name. or convert *.xml input file.
example code:
Code:
java -jar saxon9.jar -t -s:*.xml -xsl:Sample.xsl -o:Output.xml
The above code is not working... Any one please help passing any xml file in to saxon....????
Thanks,
Nagaraj
|

May 15th, 2009, 02:31 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2008
Location: Pondicherry, India
Posts: 205
Thanks: 9
Thanked 22 Times in 22 Posts
|
|
If you want to run a single xml file then use
java -jar saxon9.jar -t 1.xml 1.xsl > 1.html
else if you want to run a batch of files then create a batch file like 1.bat, in which add multiple lines like;
java -jar saxon9.jar -t 1.xml 1.xsl > 1.html
java -jar saxon9.jar -t 2.xml 1.xsl > 2.html
And then run that 1.bat in command line.
__________________
Rummy
|

May 15th, 2009, 04:22 AM
|
|
Authorized User
|
|
Join Date: Apr 2009
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi rummy,
You suggest:
I give the list of files to be processing, that file names has to be given in the bat script. -- we avoid manual process???
Is there any other easy way to run all the xml files in that particular directory using saxon xslt processor.
Help me anybodies......
Thanks
Nagaraj
|

May 15th, 2009, 04:37 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 2,922
Thanks: 0
Thanked 13 Times in 12 Posts
|
|
You can re-write your transformation to use the collection function to bring in the XML files that need processing. This allows you to specify just files that have the .xml extension. There are examples of this in the documentation.
Alternatively use the Saxon API, either from Java or .NET.
Finally Kernow is a GUI over Saxon, It allows processing of entire folders but I'm not sure how far you can automate it.
__________________
--
Joe
|

May 15th, 2009, 05:51 AM
|
 |
Wrox Author
Points: 12,735, Level: 48 |
|
|
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 3,923
Thanks: 0
Thanked 82 Times in 80 Posts
|
|
Firstly, questions specific to a product are best asked on the help forum for that product. Saxon has a saxon-help forum and a saxon-help mailing both accessible via the SourceForge page for the saxon project.
There are several ways you could tackle this.
(a) The Saxon command line has an option to process all files in a directory. Just specify the directory name in the -s argument (and a directory for the output in -o).
(b) Learn how to use shell programming to locate all the files in a directory and process them iteratively
(c) Write a single XSLT transformation that accesses all the files in a directory using the collection() function
(d) Write a Java application as a shell around the XSLT transformation
(e) Use Kernow, which has the ability to process multiple source files with the same stylesheet.
Note that invoking Saxon repeatedly from the command line is very inefficient: not only does it recompile the stylesheet each time, it also incurs heavy overheads in initializing the Java VM. But this may not matter to you.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |