class Nokogiri::XML::Node

def [](name)


# => "broad"
doc.at_css("child").attribute_with_ns("size", "http://example.com/widths").value
doc.at_css("child").attribute("size").value # => "broad"
doc.at_css("child")["size"] # => nil
EOF



doc = Nokogiri::XML(<<~EOF)

⚠ Note namespaced attributes may be accessed with #attribute or #attribute_with_ns

*Example:* Namespaced attributes will not be returned.

child["class"] # => "big wide tall"
child["size"] # => "large"
child = doc.at_css("child")
doc = Nokogiri::XML("")

*Example*

[Returns] (String, nil) value of the attribute +name+, or +nil+ if no matching attribute exists

namespaced attributes, use #attribute_with_ns.
⚠ Note that attributes with namespaces cannot be accessed with this method. To access

Fetch an attribute from this node.

:call-seq: [](name) → (String, nil)
def [](name)
  get(name.to_s)
end