Class: Nokogiri::XML::Namespace

Inherits:
Object
  • Object
show all
Includes:
PP::Node
Defined in:
lib/nokogiri/xml/namespace.rb,
ext/nokogiri/xml_namespace.c

Constant Summary

Constants included from PP::Node

PP::Node::COLLECTIONS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from PP::Node

#inspect, #pretty_print

Instance Attribute Details

#documentObject (readonly)

Returns the value of attribute document.


7
8
9
# File 'lib/nokogiri/xml/namespace.rb', line 7

def document
  @document
end

Instance Method Details

#hrefObject

Get the href for this namespace


99
100
101
102
103
104
105
106
107
108
# File 'ext/nokogiri/xml_namespace.c', line 99

static VALUE
href(VALUE self)
{
  xmlNsPtr ns;

  Noko_Namespace_Get_Struct(self, xmlNs, ns);
  if (!ns->href) { return Qnil; }

  return NOKOGIRI_STR_NEW2(ns->href);
}

#prefixObject

Get the prefix for this namespace. Returns nil if there is no prefix.


82
83
84
85
86
87
88
89
90
91
# File 'ext/nokogiri/xml_namespace.c', line 82

static VALUE
prefix(VALUE self)
{
  xmlNsPtr ns;

  Noko_Namespace_Get_Struct(self, xmlNs, ns);
  if (!ns->prefix) { return Qnil; }

  return NOKOGIRI_STR_NEW2(ns->prefix);
}