Utils
  1. Utils
  2. UTILS-11

Replace DomUtils by more object-oriented method for working with XML, Schema, and Transformations.

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Minor 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");

        Activity

        Hide
        Erik Brakkee added a comment -
        Added XMLSchema, XMLDocument, and XSLTransformation classes.
        XSLTransformer has been removed.
        Most of DomUtils has been removed.
        Show
        Erik Brakkee added a comment - Added XMLSchema, XMLDocument, and XSLTransformation classes. XSLTransformer has been removed. Most of DomUtils has been removed.

          People

          • Assignee:
            Erik Brakkee
            Reporter:
            Erik Brakkee
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: