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.

 

Input

Description

$name

The name of the element.

$value

The value of the element to be created.

This parameter is optional for the typedefs and the API names.

Return value

The NaElement object

[top]

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.

 

Input

Description

$elt

The object of NaElement.

Return value

None

[top]

NaElement::child_add_string

Prototype

child_add_string($name, $value)

Description

 

Input

Description

$name

The name of the element.

$value

The value to be assigned to the element.

Return value

None

[top]

NaElement::child_add_string_encrypted

Prototype

child_add_string_encrypted($name, $value, $key)

Description

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.

 

Input

Description

$name

The name of the element.

$value

The value to be assigned to the element.

$key

The encryption key.

Return value

None

[top]

NaElement::set_content

Prototype

set_content($content)

Description

Sets the value of an element to $content.

 

Input

Description

$content

The value to be set to the current object.

Return value

None

[top]

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.

 

Input

Description

$name

The name of the child element.

Return value

[top]

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

 

Input

Description

$name

The name of the child element.

Return value

[top]

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.

 

Input

Description

$name

The name of the child element.

Return value

[top]

NaElement::child_get_string_encrypted

Prototype

child_get_string_encrypted($name, $key)

Description

 

Input

Description

$name

The name of the child element.

$key

The decryption key.

Return value

[top]

NaElement::children_get

Prototype

children_get()

Description

Returns the list of children as an array.

Return value

The array of object of the type NaElement

[top]

NaElement::has_children

Prototype

has_children()

Description

Checks whether the current element has any child element.

Return value

[top]

NaElement::sprintf

Prototype

sprintf()

Description

Prints the current element and its child elements recursively in the XML format.

You can use this API for debugging purposes.

Return value

The XML string containing the element and its child elements

[top]

NaElement::parse_raw_xml

Prototype

parse_raw_xml($xml_str)

Description

Retrieves the API element from raw XML input.

Return value

Input

Description

$xml_str

The raw XML input string.

Return value

[top]

NaElement::toEncodedString

Prototype

toEncodedString()

Description

Encodes a string containing special characters like ampersand (&), less than (<), greater than (>), single quote ('), and double quote (").

This is mainly useful while passing string values containing special characters like '&' 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