XML Helper
The XML Helper file contains functions that assist in working with XML data.
Loading this Helper
This helper is loaded using the following code:
$this->load->helper('xml');
The following functions are available:
xml_convert('string')
Takes a string as input and converts the following reserved XML characters to entities:
Ampersands: &
Less then and greater than characters: < >
Single and double quotes: ' "
Dashes: -
This function ignores ampersands if they are part of existing character entities. Example:
$string = xml_convert($string);
xml2array( url, get_attributes = 1, priority = 'tag')
Converts raw XML from a url into an array that retains the structure of the original XML.
Example:
print_r( xml2array( "http://someplace.com/this.xml" ) );
ajax_xml_sanitize( txt )
Maurice's XML sanitizer that sanitizes XML for use with AJAX.
Example:
$sanitized = ajax_xml_sanitize( $dirty_xml );
xml_to_html_code( txt )
Maurice's XML to HTML converter.
Example:
$html = xml_to_html_code( $xml );
full_xml_sanitize( txt )
Maurice's XML sanitizer that sanitizes XML for use with AJAX.
Example:
$sanitized = ajax_xml_sanitize( $dirty_xml );