| 1 |
#!/bin/sh |
| 2 |
# ----------------------------------------------------------------------------- |
| 3 |
# |
| 4 |
# Licensed to the Apache Software Foundation (ASF) under one or more |
| 5 |
# contributor license agreements. See the NOTICE file distributed with |
| 6 |
# this work for additional information regarding copyright ownership. |
| 7 |
# The ASF licenses this file to You under the Apache License, Version 2.0 |
| 8 |
# (the "License"); you may not use this file except in compliance with |
| 9 |
# the License. You may obtain a copy of the License at |
| 10 |
# |
| 11 |
# http://www.apache.org/licenses/LICENSE-2.0 |
| 12 |
# |
| 13 |
# Unless required by applicable law or agreed to in writing, software |
| 14 |
# distributed under the License is distributed on an "AS IS" BASIS, |
| 15 |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 |
# See the License for the specific language governing permissions and |
| 17 |
# limitations under the License. |
| 18 |
# |
| 19 |
# $Id$ |
| 20 |
# ---------------------------------------------------------------------------- |
| 21 |
|
| 22 |
if [ "$1" = "" ] ; then |
| 23 |
echo |
| 24 |
echo "Usage : ./convert.sh xml-filename xslt-stylesheet" |
| 25 |
echo |
| 26 |
echo "Example: ./convert.sh data bar" |
| 27 |
echo " Will convert file xml/data.xml with stylesheet xsl/bar.xsl into out/data-bar.svg" |
| 28 |
exit 1 |
| 29 |
fi |
| 30 |
|
| 31 |
if [ "$JAVA_HOME" = "" ] ; then |
| 32 |
echo "ERROR: JAVA_HOME not found in your environment." |
| 33 |
echo |
| 34 |
echo "Please, set the JAVA_HOME variable in your environment to match the" |
| 35 |
echo "location of the Java Virtual Machine you want to use." |
| 36 |
exit 1 |
| 37 |
fi |
| 38 |
|
| 39 |
LOCALCLASSPATH=. |
| 40 |
for i in ../../lib/build/xalan*.jar ; do |
| 41 |
LOCALCLASSPATH=${LOCALCLASSPATH}:$i |
| 42 |
done |
| 43 |
for i in ../../lib/build/xerces*.jar ; do |
| 44 |
LOCALCLASSPATH=${LOCALCLASSPATH}:$i |
| 45 |
done |
| 46 |
|
| 47 |
echo "Using classpath: $LOCALCLASSPATH" |
| 48 |
|
| 49 |
echo "$JAVA_HOME/bin/java -classpath $LOCALCLASSPATH -Djavax.xml.transform.TransformerFactory=org.apache.xalan.processor.TransformerFactoryImpl -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl org.apache.xalan.xslt.Process -IN xml/$1.xml -XSL xsl/$2.xsl -OUT out/$1-$2.svg -EDUMP" |
| 50 |
$JAVA_HOME/bin/java -classpath $LOCALCLASSPATH -Djavax.xml.transform.TransformerFactory=org.apache.xalan.processor.TransformerFactoryImpl -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl org.apache.xalan.xslt.Process -IN xml/$1.xml -XSL xsl/$2.xsl -OUT out/$1-$2.svg -EDUMP |
| 51 |
|
| 52 |
echo |
| 53 |
echo "have a nice day ;-)" |