Class: Saxon::DocumentBuilder::ConfigurationDSL

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

Overview

Provides a simple configuraion DSL for DocumentBuilders.

See Also:

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(document_builder) ⇒ ConfigurationDSL

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.

Returns a new instance of ConfigurationDSL.



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

def initialize(document_builder)
  @document_builder = document_builder
end

Class Method Details

.define(document_builder, block) ⇒ Object

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.

Create a new instance and instance_exec the passed-in block against it



13
14
15
# File 'lib/saxon/document_builder.rb', line 13

def self.define(document_builder, block)
  new(document_builder).instance_exec(&block)
end

Instance Method Details

#base_uri(value) ⇒ Object

Sets the base URI of documents created using this instance.

Parameters:

  • value (String, URI::File, URI::HTTP)

    The (absolute) base URI to use

See Also:



36
37
38
# File 'lib/saxon/document_builder.rb', line 36

def base_uri(value)
  @document_builder.base_uri = value
end

#dtd_validation(value) ⇒ Object

Sets the base URI of documents created using this instance.

Parameters:

  • value (String, URI::File, URI::HTTP)

    The (absolute) base URI to use

See Also:



54
55
56
# File 'lib/saxon/document_builder.rb', line 54

def dtd_validation(value)
  @document_builder.dtd_validation = value
end

#line_numbering(value) ⇒ Object

Sets line numbering on or off

Parameters:

  • value (Boolean)

    on (true) or off (false)

See Also:



27
28
29
# File 'lib/saxon/document_builder.rb', line 27

def line_numbering(value)
  @document_builder.line_numbering = value
end

#whitespace_stripping_policy(value) ⇒ Object

Sets the base URI of documents created using this instance.

Parameters:

  • value (String, URI::File, URI::HTTP)

    The (absolute) base URI to use

See Also:



45
46
47
# File 'lib/saxon/document_builder.rb', line 45

def whitespace_stripping_policy(value)
  @document_builder.whitespace_stripping_policy = value
end