Package com.jcabi.xml
Class XSLDocument
java.lang.Object
com.jcabi.xml.XSLDocument
- All Implemented Interfaces:
XSL
Implementation of
XSL
.
Objects of this class are immutable and thread-safe.
- Since:
- 0.4
- Suppressed Checkstyle violations:
- ClassDataAbstractionCouplingCheck (500 lines), AbbreviationAsWordInNameCheck (5 lines), ClassFanOutComplexityCheck (500 lines)
-
Field Summary
-
Constructor Summary
ConstructorDescriptionXSLDocument
(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
(File file, String base) Public ctor, from file with alternative SystemId.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.Public ctor, from XSL as a string.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
(URI uri, String base) Public ctor, from URI.XSLDocument
(URL url) Public ctor, from URL.XSLDocument
(URL url, String base) Public ctor, from URL with alternative SystemId.XSLDocument
(Path file) Public ctor, from file.XSLDocument
(Path file, String base) Public ctor, from file with custom SystemId. -
Method Summary
Modifier and TypeMethodDescriptionTransform XML into text.static XSL
make
(InputStream stream) Make an instance of XSL stylesheet without I/O exceptions.static XSL
Make an instance of XSL stylesheet without I/O exceptions.toString()
Transform XML to another one.With this sources.With this parameter.
-
Field Details
-
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:<a> <b> TXT </b> </a>
<a> <b> TXT </b> </a>
- Since:
- 0.14
-
-
Constructor Details
-
XSLDocument
Public ctor, from XML as a source.- Parameters:
src
- XSL document body
-
XSLDocument
Public ctor, from XML as a source.- Parameters:
src
- XSL document bodybase
- SystemId/Base- Since:
- 0.20
-
XSLDocument
Public ctor, from URL.- Parameters:
url
- Location of document- Throws:
IOException
- If fails to read- Since:
- 0.7.4
-
XSLDocument
Public ctor, from URL with alternative SystemId.- Parameters:
url
- Location of documentbase
- SystemId/Base- Throws:
IOException
- If fails to read- Since:
- 0.26.0
-
XSLDocument
Public ctor, from file.- Parameters:
file
- Location of document- Throws:
FileNotFoundException
- If fails to read- Since:
- 0.21
-
XSLDocument
Public ctor, from file with alternative SystemId.- Parameters:
file
- Location of documentbase
- SystemId/Base- Throws:
FileNotFoundException
- If fails to read- Since:
- 0.26.0
-
XSLDocument
Public ctor, from file.- Parameters:
file
- Location of document- Throws:
FileNotFoundException
- If fails to read- Since:
- 0.21
-
XSLDocument
Public ctor, from file with custom SystemId.- Parameters:
file
- Location of documentbase
- SystemId/Base- Throws:
FileNotFoundException
- If fails to read- Since:
- 0.26.0
-
XSLDocument
Public ctor, from URI.- Parameters:
uri
- Location of document- Throws:
IOException
- If fails to read- Since:
- 0.15
-
XSLDocument
Public ctor, from URI.- Parameters:
uri
- Location of documentbase
- SystemId/Base- Throws:
IOException
- If fails to read- Since:
- 0.26.0
-
XSLDocument
Public ctor, from XSL as an input stream.- Parameters:
stream
- XSL input stream
-
XSLDocument
Public ctor, from XSL as an input stream.- Parameters:
stream
- XSL input streambase
- SystemId/Base- Since:
- 0.20
-
XSLDocument
Public ctor, from XSL as a string.- Parameters:
src
- XML document body
-
XSLDocument
Public ctor, from XSL as a string.- Parameters:
src
- XML document bodybase
- SystemId/Base- Since:
- 0.20
-
XSLDocument
Public ctor, from XSL as a string.- Parameters:
src
- XML document bodysrcs
- Sources- Since:
- 0.9
-
XSLDocument
Public ctor, from XSL as a string.- Parameters:
src
- XML document bodysrcs
- Sourcesbase
- SystemId/Base- Since:
- 0.20
-
XSLDocument
Public ctor, from XSL as a string.- Parameters:
src
- XML document bodysrcs
- Sourcesmap
- Map of XSL params- Since:
- 0.16
-
XSLDocument
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 Details
-
with
Description copied from interface:XSL
With this sources. -
with
Description copied from interface:XSL
With this parameter. -
make
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
Make an instance of XSL stylesheet without I/O exceptions.- Parameters:
url
- URL with content- Returns:
- XSL stylesheet
- Since:
- 0.7.4
- See Also:
-
toString
-
transform
Description copied from interface:XSL
Transform XML to another one. -
applyTo
Description copied from interface:XSL
Transform XML into text.
-