{"id":15739643,"url":"https://github.com/xp-framework/xml","last_synced_at":"2025-03-13T08:31:44.384Z","repository":{"id":11793992,"uuid":"14337712","full_name":"xp-framework/xml","owner":"xp-framework","description":"XML APIs for the XP Framework","archived":false,"fork":false,"pushed_at":"2024-03-29T09:22:55.000Z","size":3485,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-29T13:22:02.044Z","etag":null,"topics":["php","xml","xp-framework"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"HackathonHackers/personal-sites","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xp-framework.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","contributing":null,"funding":null,"license":null,"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":"2013-11-12T16:21:19.000Z","updated_at":"2023-01-13T12:17:02.000Z","dependencies_parsed_at":"2024-10-04T02:05:32.459Z","dependency_job_id":"424331e3-f441-4ebd-9711-b635cfbb3c20","html_url":"https://github.com/xp-framework/xml","commit_stats":{"total_commits":17960,"total_committers":39,"mean_commits":460.5128205128205,"dds":0.3546770601336303,"last_synced_commit":"554dd1d3c70c43070e82c5fe1409d9d032876b2f"},"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-framework%2Fxml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-framework%2Fxml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-framework%2Fxml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-framework%2Fxml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xp-framework","download_url":"https://codeload.github.com/xp-framework/xml/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243369845,"owners_count":20280088,"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","xml","xp-framework"],"created_at":"2024-10-04T02:05:17.821Z","updated_at":"2025-03-13T08:31:43.912Z","avatar_url":"https://github.com/xp-framework.png","language":"PHP","readme":"XML APIs for the XP Framework\n=============================\n\n[![Build status on GitHub](https://github.com/xp-framework/xml/workflows/Tests/badge.svg)](https://github.com/xp-framework/xml/actions)\n[![XP Framework Module](https://raw.githubusercontent.com/xp-framework/web/master/static/xp-framework-badge.png)](https://github.com/xp-framework/core)\n[![BSD Licence](https://raw.githubusercontent.com/xp-framework/web/master/static/licence-bsd.png)](https://github.com/xp-framework/core/blob/master/LICENCE.md)\n[![Requires PHP 7.0+](https://raw.githubusercontent.com/xp-framework/web/master/static/php-7_0plus.svg)](http://php.net/)\n[![Supports PHP 8.0+](https://raw.githubusercontent.com/xp-framework/web/master/static/php-8_0plus.svg)](http://php.net/)\n[![Latest Stable Version](https://poser.pugx.org/xp-framework/xml/version.svg)](https://packagist.org/packages/xp-framework/xml)\n\nThe xml package provides APIs to handle XML.\n\nXML data\n--------\nMost of the time, XML is used to hold data. In this case, a fully blown\nDOM api is too much overhead to work with the data. This is where the\nxml.Tree class comes in.\n\nThis example will print out a nicely formatted XML document:\n\n```php\nuse xml\\{Tree, Node};\n\n$t= new Tree('customer');\n$t-\u003eroot()-\u003esetAttribute('id', '6100');\n$t-\u003eaddChild(new Node('name', 'Timm Übercoder'));\n$t-\u003eaddChild(new Node('email', 'uebercoder@example.com'));\n\necho $t-\u003egetSource(INDENT_DEFAULT);\n```\n\nXSL Transformation\n------------------\nThe DomXSLProcessor class uses LibXSLT and thus supports EXSLT features\nlike user functions, callbacks, string functions, dynamic evaluation and\nmore.\n\nA simple example:\n\n```php\nuse xml\\DomXSLProcessor;\nuse xml\\TransformerException;\nuse util\\cmd\\Console;\n\n$proc= new DomXSLProcessor();\n$proc-\u003esetXSLFile('test.xsl');\n$proc-\u003esetXMLFile('test.xml');\n\ntry {\n  $proc-\u003erun();\n} catch (TransformerException $e) {\n  // Handle\n}\n\nConsole::writeLine($proc-\u003eoutput());\n```\n\nXPath queries\n-------------\n\n```php\nuse xml\\XPath;\nuse util\\cmd\\Console;\n\n$xml= '\u003cdialog id=\"file.open\"\u003e\n \u003ccaption\u003eOpen a file\u003c/caption\u003e\n   \u003cbuttons\u003e\n     \u003cbutton name=\"ok\"/\u003e\n     \u003cbutton name=\"cancel\"/\u003e\n   \u003c/buttons\u003e\n\u003c/dialog\u003e';\n\nConsole::writeLine((new XPath($xml))-\u003equery('/dialog/buttons/button/@name')));\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxp-framework%2Fxml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxp-framework%2Fxml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxp-framework%2Fxml/lists"}