function

xml_attr . xml . sncode

VERSIONlatest Get attribute for current node.

XML_ATTR(1e)

NAME

xml_attr - Get attribute for current node.

SYNOPSIS

xml_attr(xml:string, [attr:string,error:variable,hash:bool]);

DESCRIPTION

This function get the attribute for current name. If paramater attibute is not specify, return all attributes.

PARAMETERS

xml
Specify xml to parse.
error
Capture error.
attr
Attribute to retreive.
hash
Return then attributes as an hash array if this parameter is true. Otherwise, it return an array.

RETURN

Return the value of an attributes of an array of all attributes or (hash is the parameter hash is true)

MODULES

To use this module, you must specify the following in /usr/local/website/site.conf:

Module xml {
        Library : "/usr/local/lib/libsnxml.so"
        Init : "snxml_init"
}

EXAMPLES

a = cur_node.xml_attr();

xml_attr(child, attr:"id");

AUTHOR

Written by Pierre Laplante, <laplante@sednove.com>