xml spy
Previous  Top  Next

StyleVisionBatch Examples


The examples below are organized according to output.

 

XSLT stylesheets

XSLT stylesheets can be generated from the SPS files. The only input required is the SPS file.

 

The XSLT-for-HTML file is generated from the SPS.

StyleVisionBatch -v Test.sps -OutXSLT=Test.xslt

 

The XSLT-for-RTF file is generated from the SPS.

StyleVisionBatch -v Test.sps -OutXSLRTF=Test.xslt

 

The XSLT-for-FO file is generated from the SPS.

StyleVisionBatch -v Test.sps -OutXSLFO=Test.xslt

 

The XSLT-for-Word 2007 file is generated from the SPS.

StyleVisionBatch -v Test.sps -OutXSLWord2007=Test.xslt

 

 

HTML output

HTML output is obtained by transforming an XML file with an XSLT stylesheet. The XML file may be the Working XML File assigned in the SPS or may be specified on the command line. The XSLT file may be that generated from the SPS or may be specified on the command line.

 

Working XML file in SPS transformed with XSLT stylesheet generated from SPS.

StyleVisionBatch -v Test.sps -OutHTML=Test.html

 

Specified XML file transformed with XSLT stylesheet generated from SPS.

StyleVisionBatch -v Test.sps -InpXML=External.xml -OutHTML=Test.html

 

Working XML file in SPS transformed with specified XSLT stylesheet.

StyleVisionBatch -v Test.sps -InpXSLT=External.xslt -OutHTML=Test.html

 

Specified XML file transformed with specified XSLT stylesheet.

StyleVisionBatch -v -InpXML=External.xml  -InpXSLT=External.xslt -OutHTML=Test.html

StyleVisionBatch -v Test.sps -InpXML=External.xml  -InpXSLT=External.xslt -OutHTML=Test.html

 

RTF output

RTF output is obtained by transforming an XML file with an XSLT stylesheet. The XML file may be the Working XML File assigned in the SPS or may be specified on the command line. The XSLT file may be that generated from the SPS or may be specified on the command line.

 

Working XML file in SPS transformed with XSLT stylesheet generated from SPS.

StyleVisionBatch -v Test.sps -OutRTF=Test.rtf

 

Specified XML file transformed with XSLT stylesheet generated from SPS.

StyleVisionBatch -v Test.sps -InpXML=External.xml -OutRTF=Test.rtf

 

Working XML file in SPS transformed with specified XSLT stylesheet.

StyleVisionBatch -v Test.sps -InpXSLRTF=External.xslt -OutRTF=Test.rtf

 

Specified XML file transformed with specified XSLT stylesheet.

StyleVisionBatch -v -InpXML=External.xml  -InpXSLT=External.xslt -OutRTF=Test.rtf

StyleVisionBatch -v Test.sps -InpXML=External.xml  -InpXSLT=External.xslt -OutRTF=Test.rtf

 

 

FO and PDF output (single source document)

FO and PDF output are obtained as follows: An XML file is transformed with an XSLT stylesheet to produce an FO document. The FO document is processed with an FO processor to to generate the PDF. The XML file may be the Working XML File assigned in the SPS or may be specified on the command line. The XSLT file may be that generated from the SPS or may be specified on the command line.

 

FO from: Working XML file in SPS transformed with XSLT stylesheet generated from SPS.

StyleVisionBatch -v Test.sps -OutFO=Test.fo

 

FO from: specified XML file transformed with XSLT stylesheet generated from SPS.

StyleVisionBatch -v Test.sps -InpXML=External.xml -OutFO=Test.fo

 

FO from: Working XML file in SPS transformed with specified XSLT stylesheet.

StyleVisionBatch -v Test.sps -InpXSLFO=External.xslt -OutFO=Test.fo

 

FO from: specified XML file transformed with specified XSLT stylesheet.

StyleVisionBatch -v -InpXML=External.xml  -InpXSLFO=External.xslt -OutFO=Test.fo

StyleVisionBatch -v Test.sps -InpXML=External.xml  -InpXSLFO=External.xslt -OutFO=Test.fo

 

PDF from: Working XML file in SPS transformed with XSLT stylesheet generated from SPS.

StyleVisionBatch -v Test.sps -OutPDF=Test.pdf -FOPBatFile="c:\Program Files\Altova\FOP\fop.bat"

 

PDF from: specified XML file transformed with XSLT stylesheet generated from SPS.

StyleVisionBatch -v Test.sps -InpXML=External.xml -OutPDF=Test.pdf -FOPBatFile="c:\Program Files\Altova\FOP\fop.bat"

 

PDF from: Working XML file in SPS transformed with specified XSLT stylesheet.

StyleVisionBatch -v Test.sps -InpXSLFO=External.xslt -OutPDF=Test.pdf -FOPBatFile="c:\Program Files\Altova\FOP\fop.bat"

 

PDF from: specified XML file transformed with specified XSLT stylesheet.

StyleVisionBatch -v -InpXML=External.xml  -InpXSLFO=External.xslt -OutPDF=Test.pdf -FOPBatFile="c:\Program Files\Altova\FOP\fop.bat"

StyleVisionBatch -v Test.sps -InpXML=External.xml  -InpXSLFO=External.xslt -OutPDF=Test.pdf -FOPBatFile="c:\Program Files\Altova\FOP\fop.bat"

 

FO and PDF from: Working XML file in SPS transformed with XSLT stylesheet generated from SPS.

StyleVisionBatch -v Test.sps -OutFO=Test.fo -OutPDF=Test.pdf -FOPBatFile="c:\Program Files\Altova\FOP\fop.bat"

 

Note:To process an FO file with an FO processor to produce PDF, use the command line of the FO processor.

 

 

Word 2007 output

Word 2007 output is obtained by transforming an XML file with an XSLT stylesheet. The XML file may be the Working XML File assigned in the SPS or may be specified on the command line. The XSLT file may be that generated from the SPS or may be specified on the command line.

 

Working XML file in SPS transformed with XSLT stylesheet generated from SPS.

StyleVisionBatch -v Test.sps -OutWord2007=Test.docx

 

Specified XML file transformed with XSLT stylesheet generated from SPS.

StyleVisionBatch -v Test.sps -InpXML=External.xml -OutWord2007=Test.docx

 

Working XML file in SPS transformed with specified XSLT stylesheet.

StyleVisionBatch -v Test.sps -InpXSLWord2007=External.xslt -OutWord2007=Test.docx

 

Specified XML file transformed with specified XSLT stylesheet.

StyleVisionBatch -v -InpXML=External.xml  -InpXSLT=External.xslt -OutWord2007=Test.docx

StyleVisionBatch -v Test.sps -InpXML=External.xml  -InpXSLT=External.xslt -OutWord2007=Test.docx

 

 

 

DB data

XML, XML Schema, XSLT, and output files can be generated from a DB-based SPS. The appropriate switches must be set for the respective outputs.

 

XML Schema file from DB-based SPS.

StyleVisionBatch -v DB.sps -OutDBSchema=DB.xsd

 

XML data file from DB-based SPS.

StyleVisionBatch -v DB.sps -OutDBXML=DB.xml

 

XSLT-for-HTML file from DB-based SPS.

StyleVisionBatch -v DB.sps -OutXSLT=DB.xslt

 

HTML file from DB-based SPS.

StyleVisionBatch -v DB.sps -OutHTML=DB.html

 

Combinations of DB data output on a single command line.

StyleVisionBatch -v DB.sps -OutDBSchema=DB.xsd -OutXSLT=DB.xslt

StyleVisionBatch -v DB.sps -OutDBXML=DB.xml -OutXSLT=DB.xslt -OutHTML=DB.html

 

In the case of XML DBs, two situations should be distinguished: when the schema source of the DB cell is: (i) the main schema of the SPS, or (ii) a secondary schema of the SPS. Consider the following example command:

 

StyleVisionBatch DBCellTest.sps OutHTML=Out.html
-DBWhere:$DBXMLFIELD="NHE_TEST_PK < 4"

 

The parameter $DBXMLFIELD identifies the source schema and also the table and column containing the XML data cell since this information is implicit in the DB cell schema.
The SQL WHERE clause "NHE_TEST_PK < 4" specifies the first three rows of the column NHE_TEST_PK.
If the schema identified by $DBXMLFIELD is the main schema of DBCellTest.sps, then the -outHTML command is processed thrice, once for each of the first three rows (cells), and three output files are created, named, respectively, Out.html, Out(2).html, and Out(3).html. If on the other hand the schema identified by $DBXMLFIELD is a secondary schema of DBCellTest.sps, then only the first row (cell) is output to the file Out.html.

 

 

Parameter Usage

For the XSLT transformation, parameters can be passed to the XSLT stylesheet from the command line.

 

Parameters passed to XSLT stylesheet generated from the SPS.

StyleVisionBatch -v Test.sps -OutHTML=Test.html $myparam=MyText

StyleVisionBatch -v Test.sps -inpXML=External.xml -OutHTML=Test.html $myparam="My Text"

StyleVisionBatch -v Test.sps -OutHTML=Test.html -OutFO=Test.fo $myparam="MyText"

StyleVisionBatch -v Test.sps -OutHTML=Test.html $myparam=2006

StyleVisionBatch -v Test.sps -OutHTML=Test.html $myparam="2006"

 

Parameters passed to specified XSLT stylesheet.

StyleVisionBatch -v Test.sps -inpXSLT=External.xslt -OutHTML=Test.html $myparam=MyText

StyleVisionBatch -v Test.sps -inpXSLT=External.xslt -OutHTML=Test.html $myparam="My Text"

 

 

Multiple outputs

If multiple outputs are required from the same source/s, the outputs can be generated with a single command. Note that PDF- and Word 2007-relatede outputs are available only in the Enterprise edition.

 

XSLT stylesheets from HTML, RTF, and FO generated from the SPS.

StyleVisionBatch -v Test.sps -OutXSLT=Test.xslt -OutXSLRTF=Test.xslt -OutXSLFO=Test.xslt

 

HTML, RTF, FO, and PDF output generated  from the SPS.

StyleVisionBatch -v Test.sps -OutHTML=Test.html -OutRTF=Test.rtf -OutFO=Test.fo -OutPDF=Test.pdf -FOPBatFile="FOP\fop.bat"

StyleVisionBatch -v Test.sps -OutHTML=Test.html -OutRTF=Test.rtf -OutFO=Test.fo -OutPDF=Test.pdf -FOPBatFile="FOP\fop.bat" $myparam="My Text"

 

HTML, RTF, and FO output from specified XML file and XSLT generated  from the SPS.

StyleVisionBatch -v Test.sps -inpXML=External.xml -OutHTML=Test.html -OutRTF=Test.rtf -OutFO=Test.fo

 

HTML, RTF, and FO output with Working XML File in SPS and specified XSLT file.

StyleVisionBatch -v Test.sps -inpXSLT=ExtHTML.xslt -OutHTML=Test.html -inpXSLRTF=ExtRTF.xslt -OutRTF=Test.rtf -inpXSLFO=ExtFO.xslt -OutFO=Test.fo

 

 


See also:

 

 


 

 

 


Previous  Top  Next

© 2008 Altova