Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Cannot Reproduce
-
Affects Version/s: 0.6
-
Fix Version/s: 0.7
-
Labels:None
Description
DomUtils is like a garbage can of static methods. It would be much easier to write code such as this:
XMLDocument doc = new XMLDocument(new File("input.xml");
XMLSchema schema = new XMLSchema("x.xsd", new ClasspathResolver());
schema.validate(doc);
doc.transform(new XSLTTransformation("y.xslt"));
or even like this:
XMLSchema schema = new XMLSchema("x.xsd", new ClasspathResolver());
XMLDocument doc = new XMLDocument("input.xml").process(schema).process(new XSLTTransformer("y.xslt"));
Using static imports of XMLDocument.xmldocument(), XSLTTransofmration.transformation(), XMLSchema.schema()
XMLDocument doc = xmldocument("input.xml").process(schema("x.xsd").process(transformation("y.xslt");
Then, going even further, with shorthands for process(schema()) and process(transformation())
XMLDocument doc = xmldocument("input.xml").validate("x.xsd").transform("y.xslt");
XMLDocument doc = new XMLDocument(new File("input.xml");
XMLSchema schema = new XMLSchema("x.xsd", new ClasspathResolver());
schema.validate(doc);
doc.transform(new XSLTTransformation("y.xslt"));
or even like this:
XMLSchema schema = new XMLSchema("x.xsd", new ClasspathResolver());
XMLDocument doc = new XMLDocument("input.xml").process(schema).process(new XSLTTransformer("y.xslt"));
Using static imports of XMLDocument.xmldocument(), XSLTTransofmration.transformation(), XMLSchema.schema()
XMLDocument doc = xmldocument("input.xml").process(schema("x.xsd").process(transformation("y.xslt");
Then, going even further, with shorthands for process(schema()) and process(transformation())
XMLDocument doc = xmldocument("input.xml").validate("x.xsd").transform("y.xslt");
XSLTransformer has been removed.
Most of DomUtils has been removed.