Trying to create xml file and get warning.
WARNING 'SimpleXMLElement::addChild(): unterminated entity reference Brantford Jonson'
so when i try to open xml file get error
This page contains the following errors:
error on line 3 at column 4: StartTag: invalid element name
Below is a rendering of the page up to the first error.,
i think my error is related with this php warning.
here is relevant code
if ($value instanceof Zend_Config) {
$child = $xml->addChild($key);
$this->_addBranch($value, $child, $xml);
} else {
$xml->addChild($key, (string) $value);
}
can you help me to pin point why this error occurs. Tried something like this
if ($value instanceof Zend_Config) {
$child = $xml->addChild($key);
$this->_addBranch($value, $child, $xml);
} else {
$xml->$key((string) htmlspecilalchars($value));
}
I ran across the error when there was an ampersand "&" in my XML. Maybe try escaping the string with htmlspecialchars().
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With