Class: Saxon::XPath::StaticContext Private

Inherits:
Object
  • Object
show all
Includes:
Common
Defined in:
lib/saxon/xpath/static_context.rb

Overview

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

Represents the static context for a compiled XPath. StaticContexts are immutable.

Defined Under Namespace

Modules: Common Classes: DSL

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Common

#args_hash, #initialize

Instance Attribute Details

#declared_namespacesHash<String => String> (readonly)

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 the declared namespaces, as a prefix => uri hash.

Returns:

  • (Hash<String => String>)

    the declared namespaces, as a prefix => uri hash



125
126
127
# File 'lib/saxon/xpath/static_context.rb', line 125

def declared_namespaces
  @declared_namespaces
end

#declared_variablesHash<Saxon::QName => Saxon::XPath::VariableDeclaration] the declared variables (readonly)

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 Hash<Saxon::QName => Saxon::XPath::VariableDeclaration] the declared variables.

Returns:



123
124
125
# File 'lib/saxon/xpath/static_context.rb', line 123

def declared_variables
  @declared_variables
end

#default_collationString (readonly)

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 The default collation URI as a String.

Returns:

  • (String)

    The default collation URI as a String



121
122
123
# File 'lib/saxon/xpath/static_context.rb', line 121

def default_collation
  @default_collation
end

Class Method Details

.define(block) ⇒ Saxon::XPath::StaticContext

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.

Executes the Proc/lambda passed in with a new instance of Saxon::XPath::StaticContext as self, allowing the DSL methods to be called in a DSL-ish way

Parameters:

  • block (Proc)

    the block of DSL calls to be executed

Returns:



116
117
118
# File 'lib/saxon/xpath/static_context.rb', line 116

def self.define(block)
  DSL.define(block)
end

Instance Method Details

#define(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 Saxon::XPath::StaticContext based on this one. Passed Proc is evaluated in the same way as Saxon::XPath::StaticContext::DSL.define



141
142
143
# File 'lib/saxon/xpath/static_context.rb', line 141

def define(block)
  DSL.define(block, args_hash)
end

#resolve_variable_qname(qname) ⇒ Saxon::QName #resolve_variable_qname(string) ⇒ Saxon::QName

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.

Overloads:

  • #resolve_variable_qname(qname) ⇒ Saxon::QName

    returns the QName

    Parameters:

  • #resolve_variable_qname(string) ⇒ Saxon::QName

    resolve the prefix:local_name string into a proper QName by looking up the prefix in the #declared_namespaces

    Parameters:

    • qname_or_string (String)

      the name as a string

Returns:



135
136
137
# File 'lib/saxon/xpath/static_context.rb', line 135

def resolve_variable_qname(qname_or_string)
  Saxon::QName.resolve(qname_or_string, declared_namespaces)
end