|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] More than one parameter for stylesheet
Hello,
I have XML about 10000 books in 39 categories. I have 39 stylesheets and
each extracts exactly books for one of those categories. I did this solution
some time ago and it worked. However, now I need to make some modification
in that script and, as you can imagine, it needs to be done in all 39
scripts. That is very boring and I don't like repetitive work. Also, in case
the scrpt changes again, I will need to do it again for 39 times and so
on... I guess you see the problem by now...
The stylesheet is here:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<bookshelf>
<xsl:apply-templates select="//category[@categoryid='CAT1']"/>
</bookshelf>
</xsl:template>
<xsl:template match="category[@categoryid='FTUKSDIV3']">
<xsl:copy-of select="../../*"/>
</xsl:template>
</xsl:stylesheet>
Currently I execute the script with the following command line (in total 39
runs with 39 scripts):
java org.apache.xalan.xslt.Process -IN ..\10000books.xml -XSL
extractByCategory_CAT1.xslt >CAT1.xml
Looking at that, you can see that I use the input XML file in the command
line. I don't want to change that since I want to keep the flexibility to
apply the script to different XML files, if necessary. Now, I am wondering
if I can also put the category id (which is currently hardcoded in each of
the 39 stylesheets) as a parameter as well and feed that in via commandline.
Is this possible? If yes, how?
How would the command line look like? Something like that... (?)
java org.apache.xalan.xslt.Process -IN ..\10000books.xml CAT1 -XSL
extractByCategory.xslt >CAT1.xml
I immagine the result in a way that I would only need to change ONE
stylesheet and the batch file in case of another change.
Kind Regards,
Karl
--
5 GB Mailbox, 50 FreeSMS http://www.gmx.net/de/go/promail
+++ GMX - die erste Adresse fo?=r Mail, Message, More +++
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








