@Immutable public final class XSLDocument extends Object implements XSL
XSL
.
Objects of this class are immutable and thread-safe.
Constructor and Description |
---|
XSLDocument(InputStream stream)
Public ctor, from XSL as an input stream.
|
XSLDocument(String src)
Public ctor, from XSL as a string.
|
XSLDocument(String src,
Sources srcs)
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.
|
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.
|
public static final XSL STRIP
public XSLDocument(@NotNull(message="XML can\'t be NULL") XML src)
src
- XSL document bodypublic XSLDocument(@NotNull(message="URL can\'t be NULL") URL url) throws IOException
url
- Location of documentIOException
- If fails to readpublic XSLDocument(@NotNull(message="URI can\'t be NULL") URI uri) throws IOException
uri
- Location of documentIOException
- If fails to readpublic XSLDocument(@NotNull(message="XSL input stream can\'t be NULL") InputStream stream)
stream
- XSL input streampublic XSLDocument(String src)
src
- XML document bodypublic XSL with(@NotNull(message="sources can\'t be NULL") Sources src)
XSL
public static XSL make(@NotNull(message="XSL input stream can\'t be NULL") 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(@NotNull(message="URL can\'t be NULL") URL url)
url
- URL with contentmake(InputStream)
@NotNull(message="XML is never NULL") public XML transform(@NotNull(message="XML can\'t be NULL") XML xml)
XSL
Copyright © 2012–2015 jcabi.com. All rights reserved.