Package com.jcabi.xml
Class XSLDocument
- java.lang.Object
-
- com.jcabi.xml.XSLDocument
-
- All Implemented Interfaces:
XSL
public final class XSLDocument extends Object implements XSL
Implementation ofXSL.Objects of this class are immutable and thread-safe.
- Since:
- 0.4
- Suppressed Checkstyle violations:
- ClassDataAbstractionCouplingCheck (500 lines), AbbreviationAsWordInNameCheck (5 lines), ClassFanOutComplexityCheck (500 lines)
-
-
Constructor Summary
Constructors Constructor Description XSLDocument(XML src)Public ctor, from XML as a source.XSLDocument(XML src, String base)Public ctor, from XML as a source.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(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, String base)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, String base)Public ctor, from XSL as a string.XSLDocument(URI uri)Public ctor, from URI.XSLDocument(URL url)Public ctor, from URL.XSLDocument(Path file)Public ctor, from file.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringapplyTo(XML xml)Transform XML into text.static XSLmake(InputStream stream)Make an instance of XSL stylesheet without I/O exceptions.static XSLmake(URL url)Make an instance of XSL stylesheet without I/O exceptions.StringtoString()XMLtransform(XML xml)Transform XML to another one.XSLwith(Sources src)With this sources.XSLwith(String name, Object value)With this parameter.
-
-
-
Field Detail
-
STRIP
public static final XSL STRIP
Strips spaces of whitespace-only text nodes.This will NOT remove existing indentation between Element nodes currently introduced by the constructor of
XMLDocument. For example:
becomes<a> <b> TXT </b> </a><a> <b> TXT </b> </a>- Since:
- 0.14
-
-
Constructor Detail
-
XSLDocument
public XSLDocument(XML src)
Public ctor, from XML as a source.- Parameters:
src- XSL document body
-
XSLDocument
public XSLDocument(XML src, String base)
Public ctor, from XML as a source.- Parameters:
src- XSL document bodybase- SystemId/Base- Since:
- 0.20
-
XSLDocument
public XSLDocument(URL url) throws IOException
Public ctor, from URL.- Parameters:
url- Location of document- Throws:
IOException- If fails to read- Since:
- 0.7.4
-
XSLDocument
public XSLDocument(File file) throws FileNotFoundException
Public ctor, from file.- Parameters:
file- Location of document- Throws:
FileNotFoundException- If fails to read- Since:
- 0.21
-
XSLDocument
public XSLDocument(Path file) throws FileNotFoundException
Public ctor, from file.- Parameters:
file- Location of document- Throws:
FileNotFoundException- If fails to read- Since:
- 0.21
-
XSLDocument
public XSLDocument(URI uri) throws IOException
Public ctor, from URI.- Parameters:
uri- Location of document- Throws:
IOException- If fails to read- Since:
- 0.15
-
XSLDocument
public XSLDocument(InputStream stream)
Public ctor, from XSL as an input stream.- Parameters:
stream- XSL input stream
-
XSLDocument
public XSLDocument(InputStream stream, String base)
Public ctor, from XSL as an input stream.- Parameters:
stream- XSL input streambase- SystemId/Base- Since:
- 0.20
-
XSLDocument
public XSLDocument(String src)
Public ctor, from XSL as a string.- Parameters:
src- XML document body
-
XSLDocument
public XSLDocument(String src, String base)
Public ctor, from XSL as a string.- Parameters:
src- XML document bodybase- SystemId/Base- Since:
- 0.20
-
XSLDocument
public XSLDocument(String src, Sources srcs)
Public ctor, from XSL as a string.- Parameters:
src- XML document bodysrcs- Sources- Since:
- 0.9
-
XSLDocument
public XSLDocument(String src, Sources srcs, String base)
Public ctor, from XSL as a string.- Parameters:
src- XML document bodysrcs- Sourcesbase- SystemId/Base- Since:
- 0.20
-
XSLDocument
public XSLDocument(String src, Sources srcs, Map<String,Object> map)
Public ctor, from XSL as a string.- Parameters:
src- XML document bodysrcs- Sourcesmap- Map of XSL params- Since:
- 0.16
-
XSLDocument
public XSLDocument(String src, Sources srcs, Map<String,Object> map, String base)
Public ctor, from XSL as a string.- Parameters:
src- XML document bodysrcs- Sourcesmap- Map of XSL paramsbase- SystemId/Base- Since:
- 0.20
- Suppressed Checkstyle violations:
- ParameterNumberCheck (5 lines)
-
-
Method Detail
-
with
public XSL with(String name, Object value)
Description copied from interface:XSLWith this parameter.
-
make
public static XSL make(InputStream stream)
Make an instance of XSL stylesheet without I/O exceptions.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") ); }- Parameters:
stream- Input stream- Returns:
- XSL stylesheet
-
make
public static XSL make(URL url)
Make an instance of XSL stylesheet without I/O exceptions.- Parameters:
url- URL with content- Returns:
- XSL stylesheet
- Since:
- 0.7.4
- See Also:
make(InputStream)
-
transform
public XML transform(XML xml)
Description copied from interface:XSLTransform XML to another one.
-
-