|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.caucho.xsl.Xsl
Public facade for creating XSL stylesheets.
Xsl supports two related stylesheet languages. XSLT and
'XSLT-lite'. Strict XSLT stylesheets are created by parsing the XML
externally, then generating the stylesheet:
Document xsl = Xml.parse(Pwd.lookup("test.xsl"));
Stylesheet style = Xsl.parse(xsl, null);
Document src = Xml.parse(Pwd.lookup("test.xml");
Document dst = style.transform(src);
WriteStream os = Pwd.lookup("test.out").openRead();
XmlPrinter.printXml(os, dst);
os.close();
XSLT-lite stylesheets are parsed directly by Xsl, because they are
not valid XML documents.
ReadStream is = Pwd.lookup("test.xsl").openRead();
Stylesheet style = Xsl.parse(is, null);
is.close();
Document src = Xml.parse(Pwd.lookup("test.xml");
Document dst = style.transform(src);
ReadStream os = Pwd.lookup("test.out").openRead();
XmlPrinter.printXml(os, dst);
os.close();
Method Summary | |
static Path |
findXslPath(java.lang.String xsl,
Path[] stylePath,
java.lang.ClassLoader loader)
|
static Stylesheet |
getLooseStylesheet(java.lang.String xsl,
Path[] stylePath,
java.lang.ClassLoader loader,
Path[] scriptPath)
|
static Stylesheet |
getStylesheet(java.lang.String xsl,
Path[] stylePath,
java.lang.ClassLoader loader,
Path[] scriptPath)
|
static void |
main(java.lang.String[] args)
|
static Stylesheet |
parse(Document xsl,
Path path,
Path[] stylePath,
Path[] scriptPath,
java.lang.ClassLoader loader,
java.lang.String className)
Creates a strict XSLT stylesheet based on the XML document. |
static Stylesheet |
parse(Path path,
Path[] stylePath,
Path[] scriptPath)
Convenience class for the XSLT-lite parser. |
static Stylesheet |
parse(ReadStream is,
Path[] stylePath,
Path[] scriptPath,
java.lang.ClassLoader loader,
java.lang.String className)
Creates an 'XSLT-lite' stylesheet from a stream. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Method Detail |
public static Stylesheet parse(ReadStream is, Path[] stylePath, Path[] scriptPath, java.lang.ClassLoader loader, java.lang.String className) throws java.lang.Exception
More importantly, tags outside the xsl: namespace are treated as raw text and entities are not expanded.
The parser will load precompiled stylesheets if you specify the className. Obviously, className must be unique for different stylesheets.
is
- stream containing the stylesheetstylePath
- path to lookup imported stylesheets.scriptPath
- path for the scripting language importsloader
- the class loader for loading the new stylesheetclassName
- the class name of the generated stylesheet. This
must be specified for precompiled servlets.public static Stylesheet parse(Path path, Path[] stylePath, Path[] scriptPath) throws java.lang.Exception
public static Stylesheet parse(Document xsl, Path path, Path[] stylePath, Path[] scriptPath, java.lang.ClassLoader loader, java.lang.String className) throws java.lang.Exception
The parser will load precompiled stylesheets if you specify the className. Obviously, className must be unique for different stylesheets.
xsl
- The XML parsed document for the stylesheetpath
- The pwd of the parsed documentstylePath
- search path for imported stylesheetsscriptPath
- search path for imported scriptsloader
- the class loader for loading the new stylesheetclassName
- the class name of the generated stylesheet. This
must be specified for precompiled servlets.public static Stylesheet getStylesheet(java.lang.String xsl, Path[] stylePath, java.lang.ClassLoader loader, Path[] scriptPath) throws java.io.IOException
public static Stylesheet getLooseStylesheet(java.lang.String xsl, Path[] stylePath, java.lang.ClassLoader loader, Path[] scriptPath) throws java.io.IOException
public static Path findXslPath(java.lang.String xsl, Path[] stylePath, java.lang.ClassLoader loader)
public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |