Input Output Management APIs for Perl
The Input Output (I/O) element in Perl is represented by the NaElement class. The I/O elements are similar to XML containers; they have a name-value pair. You can nest them arbitrarily within other I/O elements.
The I/O Management APIs are used to create I/O elements, and to set the value to or retrieve the value from the I/O elements.
This page contains information about the Input Output Management APIs for Perl, including the description and syntax, and the input, input types, input description, and input return values.
NaElement::new
Prototype
new($name, $value)
Description
Constructs a new I/O element with the given name and value.
Return value
The NaElement object
NaElement::child_add
Prototype
child_add($elt)
Description
Adds the element $elt to the children list of the current object of the type NaElement.
This can be used to add any input element, its typedef, and the elements of the typedef.
Return value
None
NaElement::child_add_string
Prototype
child_add_string($name, $value)
Description
◦
◦
◦
Return value
None
NaElement::child_add_string_encrypted
Prototype
child_add_string_encrypted($name, $value, $key)
Description
◦
◦
Encrypts $value with the key $key and adds it to the new object.
◦
Both the client-side and the server-side should know the value of $key to encrypt and decrypt $value appropriately. You use the API child_get_string_encrypted to decrypt the value.
Return value
None
NaElement::set_content
Prototype
set_content($content)
Description
Sets the value of an element to $content.
Return value
None
NaElement::child_get
Prototype
child_get($name)
Description
Gets the child element named $name from the current object.
You can nest the elements arbitrarily and the returned element can have other child elements.
Return value
◦
◦
NaElement::child_get_int
Prototype
child_get_int($name)
Description
Gets the child $name from the current object and returns its value as an integer.
Return value
◦
◦
NaElement::child_get_string
Prototype
child_get_string($name)
Description
Gets the child named $name from the current object and returns its value.
If there is no child named $name, undef is returned.
Return value
◦
◦
NaElement::child_get_string_encrypted
Prototype
child_get_string_encrypted($name, $key)
Description
◦
Gets the child named $name from the current object.
◦
◦
◦
Return value
◦
◦
NaElement::get_content
Prototype
get_content()
Description
Retrieves the content of the element.
Return value
Content of the element
NaElement::children_get
Prototype
children_get()
Description
Returns the list of children as an array.
Return value
The array of objects of the type NaElement
NaElement::has_children
Prototype
has_children()
Description
Checks whether the current element has any child element.
Return value
◦
◦
NaElement::sprintf
Prototype
sprintf()
Description
Prints the current element and its child elements recursively in XML format.
You can use this API for debugging purposes.
Return value
The XML string containing the element and its child elements
NaElement::parse_raw_xml
Prototype
parse_raw_xml($xml_str)
Description
Retrieves the API element from raw XML input.
Return value
◦
◦
NaElement::toEncodedString
Prototype
toEncodedString()
Description
Encodes a string containing special characters such as ampersand (&), less than (<), greater than (>), single quote ('), and double quote (").
This is mainly useful while passing string values containing special characters such as '&' and '<','>' to any core API. The special characters can result in unexpected parsing of XML data; therefore, they need to be handled appropriately.
Return value
The encoded string in XML format
Parent topic: Perl Core APIs

Was this topic helpful? Send comments to NetApp.