Go to main content

xml_child

Return child for current node.

XML_CHILD

NAME

xml_child - Return child for current node.

SYNOPSIS

xml_child(xml:string, [error:variable]);

DESCRIPTION

This function return child of current node.

PARAMETERS

xml
Specify xml to parse.
error
Capture error.

RETURN

Child node of current node.

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

t = xml_traverse(cur_node.xml_child());

child = xml_child(xml);

%include "/includes/xml.sn";

child = skip_text_node(child);

The function skip_text_node is define in the include file:

//
// Description:         Skip text node
//
// Input:                       xml node
//
// Output:                      xml node where type is not XML_TEXT_NODE
//
// Author:                      2013-10-10 21:30:48 laplante@sednove.com
//
function skip_text_node(node)
        type = xml_type(node);
        while type == XML_TEXT_NODE do
                node = xml_next(node);
                type = xml_type(node);
        endw
        return node;
endf

SEE ALSO

{{ include("includes/modules.sn") }}

AUTHOR

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

MODIFICATIONS

1.0 2014-09-09 21:24:14 laplante@sednove.com

Edit

© 2024 extenso Inc. All rights reserved.