Class: Saxon::DocumentBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/saxon/document_builder.rb

Overview

Builds XDM objects from XML sources, for use in XSLT or for query and access

Instance Method Summary collapse

Constructor Details

#initialize(s9_document_builder) ⇒ DocumentBuilder

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Saxon DocumentBuilder instance to wrap

Parameters:



10
11
12
# File 'lib/saxon/document_builder.rb', line 10

def initialize(s9_document_builder)
  @s9_document_builder = s9_document_builder
end

Instance Method Details

#build(source) ⇒ Saxon::XDM::Node

Returns The Saxon::XDM::Node representing the root of the document tree.

Parameters:

  • source (Saxon::Source)

    The Saxon::Source containing the source IO/string

Returns:

  • (Saxon::XDM::Node)

    The Saxon::XDM::Node representing the root of the document tree



18
19
20
# File 'lib/saxon/document_builder.rb', line 18

def build(source)
  XDM::Node.new(@s9_document_builder.build(source.to_java))
end

#to_javanet.sf.saxon.s9api.DocumentBuilder

Returns The underlying Java Saxon DocumentBuilder instance.

Returns:

  • (net.sf.saxon.s9api.DocumentBuilder)

    The underlying Java Saxon DocumentBuilder instance



24
25
26
# File 'lib/saxon/document_builder.rb', line 24

def to_java
  @s9_document_builder
end