|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjd.xml.xslt.Transformation
jd.xml.xslt.AbstractStylesheet
jd.xml.xslt.Stylesheet
Stylesheet represents a XSL stylesheet. To transform a xml file you have to
Stylesheet stylesheet = new Stylesheet(); stylesheet.setup(new XmlSource("transform.xsl")); XmlSource xmlIn = new XmlSource("in.xml"); XsltResult xmlOut = new XsltResult("out.xml"); stylesheet.transform(xmlIn, xmlOut);The various constructors of XmlSource and XsltResult allow you to specify different sources or destinations of the transformation (files, inputstreams, urls, DOM documents).
XmlSource
,
XsltResult
,
AbstractStylesheet.transform(jd.xml.util.XmlSource, jd.xml.xslt.XsltResult, int)
Nested Class Summary | |
static class |
Stylesheet.CmdLine
|
Field Summary | |
static String |
VERSION
The jd.xslt version. |
Fields inherited from class jd.xml.xslt.AbstractStylesheet |
decimalFormatSymbols_, keys_, messageListener_, nodeNamePool_, outputFormat_, securityManager_, verboseLog_, warningLevel_ |
Constructor Summary | |
Stylesheet()
|
Method Summary | |
void |
clearParameters()
Clear the values of a all top-level parameters. |
protected boolean |
isSetup()
Test if the stylesheet has been initialized. |
static void |
main(String[] args)
Command line interface. |
void |
setEntityResolver(EntityResolver entityResolver)
Set the EntityResolver. |
protected boolean |
setParameterInternal(String name,
XObject value)
Set the value of an global parameter. |
void |
setTrace(boolean trace)
Set if transformations should be traced. |
void |
setup(StylesheetData data)
Setup the stylesheet from the given stylesheet data. |
void |
setup(XmlSource xslSource)
Setup the stylesheet from the given stylesheet document. |
void |
setUriResolver(UriResolver uriResolver)
Set a UriResolver. |
void |
setValidate(boolean validate)
Set if xml documents should be validated. |
protected void |
transformInternal(XmlSource source,
XsltResult result,
int repeat)
Transform the source to the result. |
Methods inherited from class jd.xml.xslt.AbstractStylesheet |
getNodeNamePool, getOutputFormat, setMessageListener, setParameter, setParameter, setSecurityManager, setVerboseLog, setWarningLevel, transform |
Methods inherited from class jd.xml.xslt.Transformation |
setVerbose, transform |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String VERSION
Constructor Detail |
public Stylesheet()
Method Detail |
public void setup(XmlSource xslSource) throws IOException, SAXException, XsltParseException
IOException
- thrown if the stylesheet document cannot be read
SAXException
- thrown if the stylesheet document cannot be parsed
jd.xml.xslt.XsltParseException
- thrown if the stylesheet contains syntax errors
XsltParseException
public void setup(StylesheetData data)
protected boolean isSetup()
isSetup
in class AbstractStylesheet
setup(jd.xml.util.XmlSource)
protected boolean setParameterInternal(String name, XObject value)
AbstractStylesheet
setParameterInternal
in class AbstractStylesheet
public void clearParameters()
clearParameters
in class Transformation
public void setUriResolver(UriResolver uriResolver)
setUriResolver
in class Transformation
public void setValidate(boolean validate)
setValidate
in class Transformation
public void setTrace(boolean trace)
setTrace
in class Transformation
public void setEntityResolver(EntityResolver entityResolver)
setEntityResolver
in class Transformation
protected void transformInternal(XmlSource source, XsltResult result, int repeat) throws Exception
transformInternal
in class AbstractStylesheet
source
- the transformation sourceresult
- the transformation resultrepeat
- repeat the transformation n times. A repeat value greater
IOException
- if an I/O error occurrs
SAXException
- if the source document cannot be parsed
XsltException
- if a transformation error occurrs
Exception
public static void main(String[] args)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |