|
S-PLUS Connect/Java v1.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.insightful.splus.util.XMLTransformUtilities
Nested Class Summary | |
protected static class |
XMLTransformUtilities.SplusConverterOption
Utility Class used by JFor transformation to ensure that the desired SAX implementation classes are used. |
Field Summary | |
static int |
LOG_LEVEL_DEBUG
|
static int |
LOG_LEVEL_DISABLED
|
static int |
LOG_LEVEL_ERROR
|
static int |
LOG_LEVEL_FATAL
|
static int |
LOG_LEVEL_INFO
|
static int |
LOG_LEVEL_WARN
|
static int |
XSL_FO_PDF
|
static int |
XSL_FO_PS
|
static int |
XSL_FO_RTF
|
static int |
XSL_HTML
|
static int |
XSL_XML
|
Method Summary | |
static String |
convertStringToXML(String s)
Create an XML-compatible string by removing any control characters from the input string. |
static void |
createReport(String xml,
String xsl,
String report,
int type)
Create a formatted report in HTML, RTF, PDF, or Postscript based on content in an XML file and formatting information in an XSL file. |
static void |
createReport(String xml,
String xsl,
String report,
int type,
int loggingLevel)
Create a formatted report in HTML, RTF, PDF, or Postscript based on content in an XML file and formatting information in an XSL file. |
static Transformer |
createTransformer(String xsl)
Utilty method used to create a Transformer based on an XSL file. |
static XMLReader |
createXmlReader()
Utility method used to create an XMLReader from a SAX Parser. |
static SAXSource |
createXmlSource(String xml)
Utility method used to create a SAXSource from a given XML file path. |
static DocumentBuilder |
getBuilder()
Utility method used to create a singleton DocumentBuilder that will work properly when a computer is disconnected from the network. |
static String |
getEncoding()
Get the type of encoding used in subsequent XML document creation. |
static EntityResolver |
getEntityResolver()
Utility method used to create a singleton EntityResolver that will work properly when a computer is disconnected from the network. |
static Node |
readFrdomFile(InputStream ins)
IS THIS BEING USED ANYMORE? |
static void |
serializeXML(Node node,
OutputStream out)
IS THIS BEING USED ANYMORE? |
static void |
setEncoding(String encoding)
Set the type of encoding used in subsequent XML document creation. |
static void |
setParserProperties()
Set System property hints for java xml implementation classes. |
static void |
transformWithFOP(Source src,
String xsl,
OutputStream out)
Utility method used to transform a given XML file, using a given XSL:FO transformation. |
static void |
transformWithJFOR(Source xml,
String xsl,
Writer out,
int log)
Utility method used to transform a given XML file, using a given XSL:FO transformation. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int XSL_HTML
public static final int XSL_XML
public static final int XSL_FO_PDF
public static final int XSL_FO_PS
public static final int XSL_FO_RTF
public static final int LOG_LEVEL_DEBUG
public static final int LOG_LEVEL_INFO
public static final int LOG_LEVEL_WARN
public static final int LOG_LEVEL_ERROR
public static final int LOG_LEVEL_FATAL
public static final int LOG_LEVEL_DISABLED
Method Detail |
public static void setEncoding(String encoding)
encoding
- Type of XML document encoding to be used when creating new
documents.public static String getEncoding()
public static void createReport(String xml, String xsl, String report, int type, int loggingLevel) throws Exception
The HTML or XML transform uses an XSLT file. The PDF, PS, and RTF transforms use an XSL:FO transform.
The loggingLevel code indicates how much logging information to print to stdout. It is used by the PDF, PS, and RTF transforms.
Currently the HTML and XML transforms use classes in java's transform utility, the RTF transform uses classes in org.jfor, and the PDF and PS transforms use classes in org.apache.fop. The transform classes are standard JFC classes provided with JDK1.5, the org.jfor classes are available from www.jfor.org, and the org.apache.fop classes are available from www.apache.org. This implementation may change in the future as improved transformation tools become available.
xml
- Name of XML file containing content of reportxsl
- Name of XSLT or XSL:FO file containing formatting informationreport
- Name of output filetype
- Type of transformation such as XSL_HTMLloggingLevel
- Code indicating how much logging information to print
this uses the org.apache.avalon.framework.logger.ConsoleLogger for
PDF and PS, and org.jfor.jfor.converter.ConverterLogChannel for RTF.
This may be deprecated at some point if the implementation changes
to use tools that do not use these logging systems.
Exception
public static void createReport(String xml, String xsl, String report, int type) throws Exception
The HTML or XML transform uses an XSLT file. The PDF, PS, and RTF transforms use an XSL:FO transform.
The transformations will log warnings and errors to stdout.
Currently the HTML and XML transforms use classes in java's transform utility, the RTF transform uses classes in org.jfor, and the PDF and PS transforms use classes in org.apache.fop. The transform classes are standard JFC classes provided with JDK1.5, the org.jfor classes are available from www.jfor.org, and the org.apache.fop classes are available from www.apache.org. This implementation may change in the future as improved transformation tools become available.
xml
- Name of XML file containing content of reportxsl
- Name of XSLT or XSL:FO file containing formatting informationreport
- Name of output filetype
- Type of transformation such as XSL_HTML
Exception
public static void setParserProperties()
use.xalan
is
T, then the Xalan implementations will be used. Otherwise, the standard JDK 1.5 implementation
will be used.
public static XMLReader createXmlReader() throws Exception
Exception
public static SAXSource createXmlSource(String xml) throws Exception
xml
- string containing path to an XML file
Exception
public static Transformer createTransformer(String xsl) throws Exception
xsl
- string containing path to an XSL file
Exception
public static void transformWithFOP(Source src, String xsl, OutputStream out) throws Exception
src
- Source containing a given XML stream (to be transformed)xsl
- string containing path to a given XSL file (used to transform)out
- OutputStream pointing to a given output stream for PDF report
Exception
public static void transformWithJFOR(Source xml, String xsl, Writer out, int log) throws Exception
xml
- Source containing stream of a given XML file (to be transformed)xsl
- string containing path to a given XSL file (used to transform)out
- Writer containing output stream for generated reportlog
- Code indicating how much logging information to print
this uses the org.apache.avalon.framework.logger.ConsoleLogger for
PDF and PS, and org.jfor.jfor.converter.ConverterLogChannel for RTF.
This may be deprecated at some point if the implementation changes
to use tools that do not use these logging systems.
Exception
public static String convertStringToXML(String s)
s
- String to be converted into XMLpublic static EntityResolver getEntityResolver()
public static DocumentBuilder getBuilder()
public static Node readFrdomFile(InputStream ins) throws Exception
Exception
public static void serializeXML(Node node, OutputStream out)
|
S-PLUS Connect/Java v1.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |