Class DomTripSAXSource

  • All Implemented Interfaces:
    javax.xml.transform.Source

    public class DomTripSAXSource
    extends javax.xml.transform.sax.SAXSource
    A SAXSource backed by a domtrip Document for JAXP interoperability.

    This class enables a domtrip document to be used directly with JAXP APIs such as Transformer and Validator without requiring intermediate serialization to a string or stream.

    Usage Examples:

    
     // XSLT transformation
     Document doc = Document.of(xml);
     SAXSource source = DomTripSAXSource.of(doc);
     transformer.transform(source, result);
    
     // Schema validation
     SAXSource source = DomTripSAXSource.of(doc);
     validator.validate(source);
     
    Since:
    1.3.0
    See Also:
    SAXOutputter, DomTripXMLReader
    • Field Summary

      • Fields inherited from class javax.xml.transform.sax.SAXSource

        FEATURE
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static DomTripSAXSource of​(Document doc)
      Creates a new SAXSource backed by the given document.
      • Methods inherited from class javax.xml.transform.sax.SAXSource

        getInputSource, getSystemId, getXMLReader, isEmpty, setInputSource, setSystemId, setXMLReader, sourceToInputSource
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • of

        public static DomTripSAXSource of​(Document doc)
        Creates a new SAXSource backed by the given document.
        Parameters:
        doc - the document to use as the source
        Returns:
        a new DomTripSAXSource
        Throws:
        java.lang.IllegalArgumentException - if doc is null