|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.vishia.xml.Xslt
public class Xslt
vishia XSLT Translator.
This translator calls the java-standard XSLT-engine defined with
javax.xml.transform.TransformerFactory. The cmdLine-option -xslt:TRANSFORMER
determines, which Transformer is used. The default-value is net.sf.saxon.TransformerFactoryImpl,
therefore this Transformer is recommended to use. It should be provided by the adequate jar-File
specified in the java's-CLASSPATH.
The vishia-XSLT prepares some inputs before calling the outside given Transformer:
Multiple inputs:
More as one XML-Inputfile is able to use as input. All input file-contents are disposed after a
internal created < root> root-Element. It means, the translation file have to be regard
this additional < root> root-Element. Write:
< xsl:apply-templates match="/root" >
....
instead the often used
< xsl:apply-templates match="/" >
....
XmlExtensions contains
a static method org.vishia.xml.XmlExtensions.readXmlFileTrimWhiteSpace(File) which is used here
if an input is designated with the cmdLine option -j:FILE.
WikistyleTextToSimpleXml
is implemented instead in the ZBNF2Xml-conversion (class ZbnfXmlOutput
and in the class CorrectHref for documentation generation.
It was contained here in the past. It isn't supported yet, because the conversion routine
is changed using the XmlNode, which is not directly compatible with JDOM.
An adaption is existing in the XmlNodeJdom, but it isn't used here yet.
org.vishia.xml.XmlExtensions.writeXmlBeautificatedTextFile(Element, File, Charset)}.
This writer uses JDOM as input. This is the older implementation.
A newer implementation of this feature is present in SimpleXmlOutputter.
| Nested Class Summary | |
|---|---|
(package private) class |
Xslt.CmdLine
The inner class CmdLine helps to evaluate the command line arguments and show help messages on command line. |
protected class |
Xslt.Parameter
|
| Field Summary | |
|---|---|
protected boolean |
bWikiFormat
Set on command line option. |
(package private) MainCmd_ifc |
console
Aggregation to the Console implementation class. |
protected java.util.List<Xslt.Parameter> |
params
|
protected java.lang.String |
sFileOut
Cmdline-argument, set on -y option. |
protected java.lang.String |
sFileXslp
CmdLine-argument set on -p option: XSLT-File pre-converted with Xsltpre. |
protected java.lang.String |
sFileXslt
CmdLine-argument set on -t option: XSLT-File for Transformer. |
protected java.lang.String |
sTransformer
Class which is used by the javax.xml.transform.TransformerFactory It is set with System.setProperty("javax.xml.transform.TransformerFactory", |
protected XmlMReader |
xmlMReader
Instance to process input files. |
| Constructor Summary | |
|---|---|
Xslt()
|
|
| Method Summary | |
|---|---|
private void |
execute()
Executes the task of this class. |
private java.io.File |
genXslFromXslp()
Converts the Xslt-file using Xsltpre |
static void |
main(java.lang.String[] args)
main started from java. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.String sFileOut
protected java.lang.String sFileXslt
sFileXslp is given, it is the name of the output file.
protected java.lang.String sFileXslp
Xsltpre.
If it is null, the is used as input. .
NOTE: If the XSLT-File given in sFileXslt-
element is newer as this given file, the first one will not overwritten by this given file. This feature
may be able to use for fine adjustments of content while debugging a script.
protected java.util.List<Xslt.Parameter> params
protected java.lang.String sTransformer
protected boolean bWikiFormat
protected final XmlMReader xmlMReader
MainCmd_ifc console
| Constructor Detail |
|---|
public Xslt()
| Method Detail |
|---|
public static void main(java.lang.String[] args)
"invoke { -[i|j|k]:INPUT } [-t:XSLT] [-p:XSLP] -y:OUTPUT [-xslt:TRANSFORMER]");
"-i:INPUT-XML-file");
"-j:INPUT-XML-file, Whitespaces will replaced with 1 space");
"-t:XSLT: xsl-script XML2-compatible, it is output if -p:XSLP is given");
"-p:XSLP: Script pretranslated with Xsltpre, than -t:XSLT will be created if older.");
" If no option -t:XSLT is given, XSLT will be created parallel with .xsl as extension.");
"-y:OUTPUT-file");
"-xslt:TRANSFORMER Set the class for Transformer-Implementation. Default is " + sTransformer);
private void execute()
throws javax.xml.parsers.ParserConfigurationException,
java.io.FileNotFoundException,
org.xml.sax.SAXException,
java.io.IOException,
javax.xml.transform.TransformerException,
XmlException
javax.xml.parsers.ParserConfigurationException
java.io.IOException
org.xml.sax.SAXException
java.io.FileNotFoundException
javax.xml.transform.TransformerException
XmlExceptionprivate java.io.File genXslFromXslp()
Xsltpre
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||