Class: Saxon::XPath::StaticContext

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

Overview

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_namespacesObject (readonly)

Returns the value of attribute declared_namespaces.



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

def declared_namespaces
  @declared_namespaces
end

#declared_variablesObject (readonly)

Returns the value of attribute declared_variables.



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

def declared_variables
  @declared_variables
end

#default_collationObject (readonly)

Returns the value of attribute default_collation.



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

def default_collation
  @default_collation
end

Class Method Details

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

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:



138
139
140
# File 'lib/saxon/xpath/static_context.rb', line 138

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

Instance Method Details

#define(block) ⇒ Object



156
157
158
# File 'lib/saxon/xpath/static_context.rb', line 156

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

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

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:



152
153
154
# File 'lib/saxon/xpath/static_context.rb', line 152

def resolve_variable_qname(qname_or_string)
  Resolver.resolve_variable_qname(qname_or_string, declared_namespaces)
end