{"id":30211250,"url":"https://github.com/mons/xml-fast","last_synced_at":"2025-10-12T22:40:21.003Z","repository":{"id":136417504,"uuid":"722983","full_name":"Mons/XML-Fast","owner":"Mons","description":"Very fast simple xml to hash parser","archived":false,"fork":false,"pushed_at":"2017-06-29T23:04:00.000Z","size":1763,"stargazers_count":4,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-13T20:55:42.430Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://search.cpan.org/dist/XML-Fast","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Mons.png","metadata":{"files":{"readme":"README","changelog":"Changes","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,"zenodo":null}},"created_at":"2010-06-15T21:40:57.000Z","updated_at":"2017-02-16T15:18:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"7877f61c-e999-445e-8f57-a7c8e0a7916e","html_url":"https://github.com/Mons/XML-Fast","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Mons/XML-Fast","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mons%2FXML-Fast","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mons%2FXML-Fast/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mons%2FXML-Fast/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mons%2FXML-Fast/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mons","download_url":"https://codeload.github.com/Mons/XML-Fast/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mons%2FXML-Fast/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279013279,"owners_count":26085250,"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","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-08-13T20:34:21.089Z","updated_at":"2025-10-12T22:40:20.998Z","avatar_url":"https://github.com/Mons.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"NAME\n    XML::Fast - Simple and very fast XML - hash conversion\n\nSYNOPSIS\n      use XML::Fast;\n  \n      my $hash = xml2hash $xml;\n      my $hash2 = xml2hash $xml, attr =\u003e '.', text =\u003e '~';\n\nDESCRIPTION\n    This module implements simple, state machine based, XML parser written\n    in C.\n\n    It could parse and recover some kind of broken XML's. If you need XML\n    validator, use XML::LibXML\n\nRATIONALE\n    Another similar module is XML::Bare. I've used it for some time, but it\n    have some failures:\n\n    *   If your XML have node with TextNode, then CDATANode, then again\n        TextNode, you'll got broken value\n\n    *   It doesn't support charsets\n\n    *   It doesn't support any kind of entities.\n\n    So, after count of tries to fix XML::Bare I've decided to write parser\n    from scratch.\n\n    Here is some features and principles:\n\n    *   It uses minimal count of memory allocations.\n\n    *   All XML is parsed in 1 scan.\n\n    *   All values are copied from source XML only once (to destination\n        keys/values)\n\n    *   If some types of nodes (for ex comments) are ignored, there are no\n        memory allocations/copy for them.\n\n    I've removed benchmark results, since they are very different for\n    different xml's. Sometimes XML::Bare is faster, sometimes not. So,\n    XML::Fast mainly should be considered not \"faster-than-bare\", but\n    \"format-other-than-bare\"\n\nEXPORT\n  xml2hash $xml, [ %options ]\n  hash2xml $hash, [ %options ]\nOPTIONS\n    order [ = 0 ]\n        Not implemented yet. Strictly keep the output order. When enabled,\n        structures become more complex, but xml could be completely\n        reverted.\n\n    attr [ = '-' ]\n        Attribute prefix\n\n            \u003cnode attr=\"test\" /\u003e  =\u003e  { node =\u003e { -attr =\u003e \"test\" } }\n\n    text [ = '#text' ]\n        Key name for storing text\n\n        When undef, text nodes will be ignored\n\n            \u003cnode\u003etext\u003csub /\u003e\u003c/node\u003e  =\u003e  { node =\u003e { sub =\u003e '', '#text' =\u003e \"test\" } }\n\n    join [ = '' ]\n        Join separator for text nodes, splitted by subnodes\n\n        Ignored when \"order\" in effect\n\n            # default:\n            xml2hash( '\u003citem\u003eTest1\u003csub /\u003eTest2\u003c/item\u003e' )\n            : { item =\u003e { sub =\u003e '', '~' =\u003e 'Test1Test2' } };\n    \n            xml2hash( '\u003citem\u003eTest1\u003csub /\u003eTest2\u003c/item\u003e', join =\u003e '+' )\n            : { item =\u003e { sub =\u003e '', '~' =\u003e 'Test1+Test2' } };\n\n    trim [ = 1 ]\n        Trim leading and trailing whitespace from text nodes\n\n    cdata [ = undef ]\n        When defined, CDATA sections will be stored under this key\n\n            # cdata = undef\n            \u003cnode\u003e\u003c![CDATA[ test ]]\u003e\u003c/node\u003e  =\u003e  { node =\u003e 'test' }\n\n            # cdata = '#'\n            \u003cnode\u003e\u003c![CDATA[ test ]]\u003e\u003c/node\u003e  =\u003e  { node =\u003e { '#' =\u003e 'test' } }\n\n    comm [ = undef ]\n        When defined, comments sections will be stored under this key\n\n        When undef, comments will be ignored\n\n            # comm = undef\n            \u003cnode\u003e\u003c!-- comm --\u003e\u003csub/\u003e\u003c/node\u003e  =\u003e  { node =\u003e { sub =\u003e '' } }\n\n            # comm = '/'\n            \u003cnode\u003e\u003c!-- comm --\u003e\u003csub/\u003e\u003c/node\u003e  =\u003e  { node =\u003e { sub =\u003e '', '/' =\u003e 'comm' } }\n\n    array =\u003e 1\n        Force all nodes to be kept as arrays.\n\n            # no array\n            \u003cnode\u003e\u003csub/\u003e\u003c/node\u003e  =\u003e  { node =\u003e { sub =\u003e '' } }\n\n            # array = 1\n            \u003cnode\u003e\u003csub/\u003e\u003c/node\u003e  =\u003e  { node =\u003e [ { sub =\u003e [ '' ] } ] }\n\n    array =\u003e [ 'node', 'names']\n        Force nodes with names to be stored as arrays\n\n            # no array\n            \u003cnode\u003e\u003csub/\u003e\u003c/node\u003e  =\u003e  { node =\u003e { sub =\u003e '' } }\n\n            # array =\u003e ['sub']\n            \u003cnode\u003e\u003csub/\u003e\u003c/node\u003e  =\u003e  { node =\u003e { sub =\u003e [ '' ] } }\n\n    utf8decode =\u003e 1\n        Force decoding of utf8 sequences, instead of just upgrading them\n        (may be useful for broken xml)\n\nSEE ALSO\n    *   XML::Bare\n\n        Another fast parser\n\n    *   XML::LibXML\n\n        The most powerful XML parser for perl. If you don't need to parse\n        gigabytes of XML ;)\n\n    *   XML::Hash::LX\n\n        XML parser, that uses XML::LibXML for parsing and then constructs\n        hash structure, identical to one, generated by this module. (At\n        least, it should ;)). But of course it is much more slower, than\n        XML::Fast\n\nLIMITATIONS\n    *   Does not support wide charsets (UTF-16/32) (see RT71534\n        \u003chttps://rt.cpan.org/Ticket/Display.html?id=71534\u003e)\n\nTODO\n    *   Ordered mode (as implemented in XML::Hash::LX)\n\n    *   Create hash2xml, identical to one in XML::Hash::LX\n\n    *   Partial content event-based parsing (I need this for reading XML\n        streams)\n\n    Patches, propositions and bug reports are welcome ;)\n\nAUTHOR\n    Mons Anderson, \u003cmons@cpan.org\u003e\n\nCOPYRIGHT AND LICENSE\n    Copyright (C) 2010 Mons Anderson\n\n    This library is free software; you can redistribute it and/or modify it\n    under the same terms as Perl itself.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmons%2Fxml-fast","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmons%2Fxml-fast","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmons%2Fxml-fast/lists"}