- Inheritance
- < Object
Represents a tagged XML element. Elements are characterized by having children, attributes, and names, and can themselves be children.
Constants
Name | Description | |
---|---|---|
NAMESPLIT | = /^(?:(#{XMLTokens::NCNAME_STR}):)?(#{XMLTokens::NCNAME_STR})/u | |
PARENTS | = [ :element, :document, :doctype ] |
Methods
Class
Visibility | Signature |
---|---|
public | new (node=nil) |
Instance
Visibility | Signature |
---|---|
public | << (element) |
public | =~ ( path ) |
public | [] ( reference, ns=nil ) |
public | []= ( reference, ns, value=nil ) |
public | children () |
public | each ( ) {|at(x+4 )| ...} |
public | has_name? ( name, namespace = '' ) |
public | local_name () |
public | local_name= ( name_str ) |
public | name () |
public | name= ( name_str, ns=nil ) |
public | namespace ( prefix=prefix() ) |
public | namespace= ( namespace ) |
public | node_type () |
public | parent () |
public | parent= ( node ) |
public | prefix ( namespace=nil ) |
public | root () |
public | size () |
public | text= ( foo ) |
public | to_s () |
Class Method Detail
new(node=nil)
Create a new element.
Instance Method Detail
<<(element)
Append a child to this element, optionally under a provided namespace. The namespace argument is ignored if the element argument is an Element object. Otherwise, the element argument is a string, the namespace (if provided) is the namespace the element is created in.
=~( path )
[]( reference, ns=nil )
[]=( reference, ns, value=nil )
Doesn‘t handle namespaces yet