| The XML Helper file contains functions that assist in working with XML |
| <div class="custom-index container"></div> |
| This helper is loaded using the following code |
| $this->load->helper('xml'); |
| The following functions are available: |
| .. php:function:: xml_convert($str[, $protect_all = FALSE]) |
| :param string $str: the text string to convert |
| :param bool $protect_all: Whether to protect all content that looks like a potential entity instead of just numbered entities, e.g. &foo; |
| :returns: XML-converted string |
| Takes a string as input and converts the following reserved XML |
| - Less than and greater than characters: < > |
| - Single and double quotes: ' " |
| This function ignores ampersands if they are part of existing numbered |
| character entities, e.g. {. Example:: |
| $string = '<p>Here is a paragraph & an entity ({).</p>'; |
| $string = xml_convert($string); |
| <p>Here is a paragraph & an entity ({).</p> |