public final class XSLDocument extends Object implements XSL
XSL.
Objects of this class are immutable and thread-safe.
| Modifier and Type | Field and Description |
|---|---|
static XSL |
STRIP
Strips spaces of whitespace-only text nodes.
|
| Constructor and Description |
|---|
XSLDocument(File file)
Public ctor, from file.
|
XSLDocument(InputStream stream)
Public ctor, from XSL as an input stream.
|
XSLDocument(InputStream stream,
String base)
Public ctor, from XSL as an input stream.
|
XSLDocument(Path file)
Public ctor, from file.
|
XSLDocument(String src)
Public ctor, from XSL as a string.
|
XSLDocument(String src,
Sources srcs)
Public ctor, from XSL as a string.
|
XSLDocument(String src,
Sources srcs,
Map<String,Object> map)
Public ctor, from XSL as a string.
|
XSLDocument(String src,
Sources srcs,
Map<String,Object> map,
String base)
Public ctor, from XSL as a string.
|
XSLDocument(String src,
Sources srcs,
String base)
Public ctor, from XSL as a string.
|
XSLDocument(String src,
String base)
Public ctor, from XSL as a string.
|
XSLDocument(URI uri)
Public ctor, from URI.
|
XSLDocument(URL url)
Public ctor, from URL.
|
XSLDocument(XML src)
Public ctor, from XML as a source.
|
XSLDocument(XML src,
String base)
Public ctor, from XML as a source.
|
| Modifier and Type | Method and Description |
|---|---|
String |
applyTo(XML xml)
Transform XML into text.
|
static XSL |
make(InputStream stream)
Make an instance of XSL stylesheet without I/O exceptions.
|
static XSL |
make(URL url)
Make an instance of XSL stylesheet without I/O exceptions.
|
String |
toString() |
XML |
transform(XML xml)
Transform XML to another one.
|
XSL |
with(Sources src)
With this sources.
|
XSL |
with(String name,
Object value)
With this parameter.
|
public static final XSL STRIP
This will NOT remove
existing indentation between Element nodes currently introduced by the
constructor of XMLDocument. For example:
<a>
<b> TXT </b>
</a>
becomes
<a>
<b> TXT </b>
</a>
public XSLDocument(XML src)
src - XSL document bodypublic XSLDocument(XML src, String base)
src - XSL document bodybase - SystemId/Basepublic XSLDocument(URL url) throws IOException
url - Location of documentIOException - If fails to readpublic XSLDocument(File file) throws FileNotFoundException
file - Location of documentFileNotFoundException - If fails to readpublic XSLDocument(Path file) throws FileNotFoundException
file - Location of documentFileNotFoundException - If fails to readpublic XSLDocument(URI uri) throws IOException
uri - Location of documentIOException - If fails to readpublic XSLDocument(InputStream stream)
stream - XSL input streampublic XSLDocument(InputStream stream, String base)
stream - XSL input streambase - SystemId/Basepublic XSLDocument(String src)
src - XML document bodypublic XSLDocument(String src, String base)
src - XML document bodybase - SystemId/Basepublic XSLDocument(String src, Sources srcs)
src - XML document bodysrcs - Sourcespublic XSLDocument(String src, Sources srcs, String base)
src - XML document bodysrcs - Sourcesbase - SystemId/Basepublic XSLDocument(String src, Sources srcs, Map<String,Object> map)
src - XML document bodysrcs - Sourcesmap - Map of XSL paramspublic XSLDocument(String src, Sources srcs, Map<String,Object> map, String base)
src - XML document bodysrcs - Sourcesmap - Map of XSL paramsbase - SystemId/Basepublic XSL with(String name, Object value)
XSLpublic static XSL make(InputStream stream)
This factory method is useful when you need to create an instance of XSL stylesheet as a static final variable. In this case you can't catch an exception but this method can help, for example:
class Foo {
private static final XSL STYLESHEET = XSLDocument.make(
Foo.class.getResourceAsStream("my-stylesheet.xsl")
);
}stream - Input streampublic static XSL make(URL url)
url - URL with contentmake(InputStream)public XML transform(XML xml)
XSLCopyright © 2012–2019 jcabi.com. All rights reserved.