Releases: jcabi/jcabi-xml
Extra logging
Extra logging in XSD and XSL
XSD and XSL with URL-accepting ctor
XSDDocument
and XSLDocument
got new ctors, that accept URL
XSD and XSL are @Immutable-annotated
In this version interfaces XSD
and XSL
are @Immutable
-annotated
Synchronization problems removed
This version is truly thread safe.
Compatibility bug fixed
This versions enables compatible usage of the library with Saxon, Xerces, and any others.
XSDDocument.make() and XSLDocument.make()
This version fixed a few bugs and introduced two new static methods: XSDDocument.make()
and XSLDocument.make()
. They are useful when you need to create a reusable artifact, for example:
class Foo {
private static final XSD SCHEMA = XSDDocument.make(
Foo.class.getResourceAsStream("schema.xsd")
);
}
This make()
method re-throws IOException
as a RuntimeException
.
XSD#validate() accepts Source
In this version XSD#validate()
accepts Source
, not only XML
. Beside that, this version sets version 1.0 to XML documents, not 1.1.
XSD and XSDDocument
This version introduces XSD validation, see #4
XSL and XSLDocument
A new class and a new interface added in this version, XSLDocument
and XSL
respectfully. Transformation of XML is as easy as this:
XML first = new XMLDocument("<hello/>");
XML second = new XSLDocument(xsl).transform(first);
Conditional printing of documents and nodes
This version prints documents and nodes differently. For example:
XML xml = new XMLDocument("<root><name>John</name></root>");
System.out.println(xml);
will output:
<?xml version="1.1"?>
<root><name>John</name></root>
While this code:
XML xml = new XMLDocument("<root><name>John</name></root>");
System.out.println(xml.nodes("/root").get(0));
will output (mind the absence of XML declaration):
<root><name>John</name></root>