{"id":20460576,"url":"https://github.com/fawno/simplexmlextended","last_synced_at":"2026-04-02T02:59:25.286Z","repository":{"id":62503686,"uuid":"228149835","full_name":"fawno/SimpleXMLExtended","owner":"fawno","description":"SimpleXMLElement Extended class","archived":false,"fork":false,"pushed_at":"2024-07-21T17:29:06.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-09-22T20:18:05.575Z","etag":null,"topics":["php","simplexmlelement","xml"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fawno.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-12-15T08:03:34.000Z","updated_at":"2024-07-21T17:29:09.000Z","dependencies_parsed_at":"2024-11-15T12:33:37.466Z","dependency_job_id":null,"html_url":"https://github.com/fawno/SimpleXMLExtended","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fawno%2FSimpleXMLExtended","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fawno%2FSimpleXMLExtended/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fawno%2FSimpleXMLExtended/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fawno%2FSimpleXMLExtended/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fawno","download_url":"https://codeload.github.com/fawno/SimpleXMLExtended/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243559969,"owners_count":20310829,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["php","simplexmlelement","xml"],"created_at":"2024-11-15T12:20:34.162Z","updated_at":"2025-12-28T19:18:30.309Z","avatar_url":"https://github.com/fawno.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SimpleXMLExtended\n\n[![GitHub license](https://img.shields.io/github/license/fawno/SimpleXMLExtended)](https://github.com/fawno/SimpleXMLExtended/blob/master/LICENSE)\n[![GitHub release](https://img.shields.io/github/release/fawno/SimpleXMLExtended)](https://github.com/fawno/SimpleXMLExtended/releases)\n[![Packagist](https://img.shields.io/packagist/v/fawno/simple-xml-extended)](https://packagist.org/packages/fawno/simple-xml-extended)\n[![Packagist Downloads](https://img.shields.io/packagist/dt/fawno/simple-xml-extended)](https://packagist.org/packages/fawno/simple-xml-extended/stats)\n[![GitHub issues](https://img.shields.io/github/issues/fawno/SimpleXMLExtended)](https://github.com/fawno/simple-xml-extended/issues)\n[![GitHub forks](https://img.shields.io/github/forks/fawno/SimpleXMLExtended)](https://github.com/fawno/simple-xml-extended/network)\n[![GitHub stars](https://img.shields.io/github/stars/fawno/SimpleXMLExtended)](https://github.com/fawno/simple-xml-extended/stargazers)\n[![PHP](https://img.shields.io/packagist/php-v/fawno/simple-xml-extended)](https://php.net)\n\n SimpleXMLElement Extended class\n SimpleXMLExtended add a new method for create CData nodes.\n Also added a new method for output e nice format XML.\n\n## Requirements\n - libxml PHP extension (enabled by default).\n - SimpleXML PHP extension (enabled by default).\n - DOM PHP extension (enabled by default).\n\n## Installation\n\nYou can install this plugin into your application using\n[composer](https://getcomposer.org):\n\n```\n  composer require fawno/simple-xml-extended\n```\n\nor, clone/download this repo, and include src/SimpleXMLExtended.php in your project.\n\n## Usage\n\n```php\n  use Fawno\\SimpleXMLExtended\\SimpleXMLExtended;\n\n  // Get a SimpleXMLExtended object from a DOM node\n  $xml = simplexml_import_dom($dom, SimpleXMLExtended::class);\n\n  // Interprets an XML file into an SimpleXMLExtended object\n  $xml = simplexml_load_file($xml_file, SimpleXMLExtended::class);\n\n  // Interprets a string of XML into an SimpleXMLExtended object\n  $xml = simplexml_load_string($xml_string, SimpleXMLExtended::class);\n\n  // Creates a new SimpleXMLExtended object\n  $xml = new SimpleXMLExtended($xml_string);\n\n  // Adds a child element to the XML node as cdata\n  $xml-\u003eaddChildCData('node_cdata', 'data as cdata');\n\n  // Return a well-formed and nice formated XML string based on SimpleXMLExtended element\n  $xml-\u003eformatXML()\n```\n\n## Example\n\n```php\n  require 'src/SimpleXMLExtended.php';\n\n  use Fawno\\SimpleXMLExtended\\SimpleXMLExtended;\n\n  $root = new SimpleXMLExtended('\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\u003croot/\u003e');\n\n  $root-\u003eaddChildCData('node_cdata', 'data as cdata');\n\n  print_r($root-\u003easXML());\n  /*\n    Output:\n      \u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n      \u003croot\u003e\u003cnode_cdata\u003e\u003c![CDATA[data as cdata]]\u003e\u003c/node_cdata\u003e\u003c/root\u003e\n  */\n\n  print_r($root-\u003eformatXML());\n  /*\n    Output:\n      \u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n      \u003croot\u003e\n        \u003cnode_cdata\u003e\u003c![CDATA[data as cdata]]\u003e\u003c/node_cdata\u003e\n      \u003c/root\u003e\n  */\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffawno%2Fsimplexmlextended","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffawno%2Fsimplexmlextended","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffawno%2Fsimplexmlextended/lists"}