{"id":16853647,"url":"https://github.com/alex-oleshkevich/php-fast-xml-parser","last_synced_at":"2025-03-17T05:32:13.471Z","repository":{"id":21586234,"uuid":"24906262","full_name":"alex-oleshkevich/php-fast-xml-parser","owner":"alex-oleshkevich","description":"Fast SAX XML parser for PHP.","archived":false,"fork":false,"pushed_at":"2023-02-24T20:26:03.000Z","size":23,"stargazers_count":31,"open_issues_count":3,"forks_count":6,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-03-12T13:46:53.804Z","etag":null,"topics":["parsing","php","sax","sax-parser","xml"],"latest_commit_sha":null,"homepage":"","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/alex-oleshkevich.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":"2014-10-07T18:51:26.000Z","updated_at":"2025-01-03T15:19:23.000Z","dependencies_parsed_at":"2024-06-21T15:55:25.487Z","dependency_job_id":null,"html_url":"https://github.com/alex-oleshkevich/php-fast-xml-parser","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alex-oleshkevich%2Fphp-fast-xml-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alex-oleshkevich%2Fphp-fast-xml-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alex-oleshkevich%2Fphp-fast-xml-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alex-oleshkevich%2Fphp-fast-xml-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alex-oleshkevich","download_url":"https://codeload.github.com/alex-oleshkevich/php-fast-xml-parser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243846976,"owners_count":20357294,"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":["parsing","php","sax","sax-parser","xml"],"created_at":"2024-10-13T13:52:37.238Z","updated_at":"2025-03-17T05:32:13.054Z","avatar_url":"https://github.com/alex-oleshkevich.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"PHP Fast XML Parser\n=========\n\nPHP Fast XML Parser is a PHP library for parsing large XML files using PHP.\nKey features:\n\n  - Lightweight;\n  - Flexible (result can be easily managed via callback handlers);\n  - Good for memory critical projects (~10Mb in average while parsing 500mb XML file)\n  \n[![Build Status](https://travis-ci.org/alex-oleshkevich/php-fast-xml-parser.svg)](https://travis-ci.org/alex-oleshkevich/php-fast-xml-parser)\n\n## Installation\n\n```\ncomposer require alex.oleshkevich/fast-xml-parser\n```\n\nExample \u0026 Tutorial\n--------------\n\n```php\n\u003c?php\ndeclare(strict_types=1);\n\nrequire_once(\"vendor/autoload.php\");\n\nuse FastXml\\CallbackHandler\\GenericHandler;\nuse FastXml\\Parser;\n\n\n// create callback handler\n$handler = new GenericHandler;\n\n// set \"on item parsed\" callback\n$handler-\u003esetOnItemParsedCallback(function ($item) use ($self) {\n    // do smth with parsed item\n});\n\n// set \"on progress\" callback\n$handler-\u003esetOnProgressCallback(function ($bytesProcessed, $bytesTotal) use ($self) {\n    // eg. draw a progress bar\n});\n\n// instantiate\n$parser = new Parser($handler);\n\n// define tags which you don't want to include in resulting array (optional)\n$parser-\u003esetIgnoreTags(['root']);\n\n// define end tag for every item\n// (this is used as marker to determine when XML\n// item was processed.\n// For example, if you want to extract \"value\" from this XML source\n//\u003croot\u003e\n//    \u003cvalue\u003eVALUE\u003c/value\u003e\n//    \u003cvalue\u003eVALUE\u003c/value\u003e\n//    \u003cvalue\u003eVALUE\u003c/value\u003e\n//\u003c/root\u003e\n// you must call $parser-\u003esetEndTag('value') so library can\n// emit content of every \u003cvalue /\u003e tag in \"onItemParsed\" event.\n$parser-\u003esetEndTag('value');\n\n// run\n$parser-\u003eparse('bigfile.xml');\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falex-oleshkevich%2Fphp-fast-xml-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falex-oleshkevich%2Fphp-fast-xml-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falex-oleshkevich%2Fphp-fast-xml-parser/lists"}