Sha256: 9a72bd6909c7ce0b7e7cb61215a0bd68a30091ec266b4cc2910dca83b3bf0b15

Contents?: true

Size: 843 Bytes

Versions: 4

Compression:

Stored size: 843 Bytes

Contents

require 'saxon/xdm_node'

module Saxon
  # Builds XDM objects from XML sources, for use in XSLT or for query and
  # access
  class DocumentBuilder
    # @api private
    # @param [net.sf.saxon.s9api.DocumentBuilder] s9_document_builder The
    # Saxon DocumentBuilder instance to wrap
    def initialize(s9_document_builder)
      @s9_document_builder = s9_document_builder
    end

    # @param [Saxon::Source] source The Saxon::Source containing the source
    #   IO/string
    # @return [Saxon::XdmNode] The Saxon::XdmNode representing the root of the
    #   document tree
    def build(source)
      XdmNode.new(@s9_document_builder.build(source.to_java))
    end

    # @return [net.sf.saxon.s9api.DocumentBuilder] The underlying Java Saxon
    #   DocumentBuilder instance
    def to_java
      @s9_document_builder
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
saxon-0.2.2-java lib/saxon/document_builder.rb
saxon-0.2.1-java lib/saxon/document_builder.rb
saxon-0.2.0-java lib/saxon/document_builder.rb
saxon-0.1.0-java lib/saxon/document_builder.rb