function xmlentities in Taxonomy import/export via XML 6.2
Same name and namespace in other branches
- 6 taxonomy_xml.module \xmlentities()
- 7 taxonomy_xml.module \xmlentities()
Safer entity encoding.
htmlentities doesn't actually encode strings to anything XML-safe. This is a slightly laborious emulation that does decimal entities not fancy character ones. Taken from http://nz.php.net/manual/en/function.htmlentities.php
As such, it's screwing things up for non-English taxonomies.
4 calls to xmlentities()
- taxonomy_xml_add_terms_as_tcs in ./
tcs_format.inc - Given a list of terms, append definitions of them to the passed DOM container
- taxonomy_xml_add_vocab_as_rdf in ./
rdf_format.inc - Create a vocabulary definition (just the def, not its terms) and insert it into the given document element.
- taxonomy_xml_entity_to_rdf in ./
rdf_format.inc - Given a Drupal object, some mapping rules and a DOMDocument, create the XML representationof the thing
- taxonomy_xml_rdf_document in ./
rdf_format.inc - Set up an RDF document preamble. Returns a document, also sets the passed handle to the RDF node that content should land in
File
- ./
taxonomy_xml.module, line 2385 - This module makes it possible to import and export taxonomies as XML documents.
Code
function xmlentities($str) {
return preg_replace('/[^\\x00-\\x25\\x27-\\x7F]/e', '"&#".ord("$0").";"', $str);
}