We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
We do not save all our xml as utf-8 for example user.xml files $xml = new SimpleXMLElement('<item></item>');
$xml = new SimpleXMLElement('<item></item>');
usually we do $xml = new SimpleXMLExtended('<?xml version="1.0" encoding="UTF-8"?><item></item>'); for cdata support and utf-8 encoding
$xml = new SimpleXMLExtended('<?xml version="1.0" encoding="UTF-8"?><item></item>');
I suggest we extend SimpleXmlElement or always use extended and add wrapper functions to create new xml elements for GS in it.
SimpleXmlElement
example usage, not actual
I do not know if its possible to modify the constructor... its final
class myclass extends SimpleXMLElement { static function make($data, $xmlVersion='1.0', $xmlEncoding='ISO-8859-1', $rootName='root'){ $obj=parent::__construct($data); $obj->x=$xmlVersion; $obj->e=$xmlEncoding; $obj->r=$rootName; return $obj; } } // or class myclass extends SimpleXMLElement { public static function getInstance($xmlversion = '1.0', $xmlencoding = 'ISO-8859-1', $rootName='root') { return new self("<?xml version='$xmlVersion' encoding='$xmlEncoding'?><$rootName />"); } }
I have updated all extended objs, but i missed ones using the native class
The text was updated successfully, but these errors were encountered:
also simplexml_load_file simplexml_load_string accept a classname param
simplexml_load_file
simplexml_load_string
Sorry, something went wrong.
No branches or pull requests
We do not save all our xml as utf-8
for example user.xml files
$xml = new SimpleXMLElement('<item></item>');
usually we do
$xml = new SimpleXMLExtended('<?xml version="1.0" encoding="UTF-8"?><item></item>');
for cdata support and utf-8 encoding
I suggest we extend
SimpleXmlElement
or always use extended andadd wrapper functions to create new xml elements for GS in it.
example usage, not actual
I do not know if its possible to modify the constructor... its final
I have updated all extended objs, but i missed ones using the native class
The text was updated successfully, but these errors were encountered: