{"id":31225083,"url":"https://github.com/scriptkittie/saxpath","last_synced_at":"2025-09-22T00:35:50.004Z","repository":{"id":57735769,"uuid":"88553023","full_name":"scriptkittie/saxPath","owner":"scriptkittie","description":"A simple, fast asynchronous XML framework for parsing large XML files. ","archived":false,"fork":false,"pushed_at":"2017-04-17T22:07:58.000Z","size":36,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-16T15:04:51.179Z","etag":null,"topics":["asynchronous","bestcodeever","expressions","java","sax","unittesting","xml","xpath"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scriptkittie.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}},"created_at":"2017-04-17T21:38:21.000Z","updated_at":"2018-11-05T21:46:15.000Z","dependencies_parsed_at":"2022-08-24T03:30:40.915Z","dependency_job_id":null,"html_url":"https://github.com/scriptkittie/saxPath","commit_stats":null,"previous_names":["scriptkittie/saxpath"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/scriptkittie/saxPath","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scriptkittie%2FsaxPath","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scriptkittie%2FsaxPath/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scriptkittie%2FsaxPath/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scriptkittie%2FsaxPath/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scriptkittie","download_url":"https://codeload.github.com/scriptkittie/saxPath/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scriptkittie%2FsaxPath/sbom","scorecard":{"id":806391,"data":{"date":"2025-08-11","repo":{"name":"github.com/scriptkittie/saxPath","commit":"c9e95faadcadf2515d69247374f1fbca7319aef9"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Code-Review","score":0,"reason":"Found 0/18 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: GNU General Public License v3.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"10 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-78wr-2p64-hpwj","Warn: Project is vulnerable to: GHSA-gwrp-pvrq-jmwv","Warn: Project is vulnerable to: GHSA-269g-pwp5-87pp","Warn: Project is vulnerable to: GHSA-j288-q9x7-2f5v","Warn: Project is vulnerable to: GHSA-7rjr-3q55-vv33","Warn: Project is vulnerable to: GHSA-8489-44mv-ggj8","Warn: Project is vulnerable to: GHSA-fxph-q3j8-mv87","Warn: Project is vulnerable to: GHSA-jfh8-c2jp-5v3q","Warn: Project is vulnerable to: GHSA-p6xc-xr62-6r2g","Warn: Project is vulnerable to: GHSA-vwqq-5vrc-xw9h"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T11:52:48.237Z","repository_id":57735769,"created_at":"2025-08-23T11:52:48.238Z","updated_at":"2025-08-23T11:52:48.238Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276329315,"owners_count":25623326,"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-09-21T02:00:07.055Z","response_time":72,"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":["asynchronous","bestcodeever","expressions","java","sax","unittesting","xml","xpath"],"created_at":"2025-09-22T00:35:46.624Z","updated_at":"2025-09-22T00:35:49.996Z","avatar_url":"https://github.com/scriptkittie.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"## saxPath\r\n\r\n[![Build Status](https://travis-ci.org/scriptkittie/saxPath.svg?branch=master)](https://travis-ci.org/scriptkittie/saxPath)\r\n\r\n### Overview\r\n\r\nsaxPath is an rule based SAX parser built for processing large XML files. saxPath performs the same functions as a typical SAX parser, while maintaining low memory usage for files of all sizes by only invoking callbacks for specific XML user determined XPATH expressions, therefore avoiding large heap growth for larger sized files. Once the parser reaches an XML path that matches an XPATH expression, it will load the XML only for that sub-tree that was matched. Text Content is only parsed in sub-trees, and not processed if a sub-tree is not being processed. You can choose to process each rule asynchronously, with the sacrifice of guaranteed order for each rule processed. Due to the nature this parsing and to maintain a low level of memory usage, only XPATH attributes and elements are able to be triggered, XPATH expressions such as the examples below will not work to trigger XPATH rules. However, all XPATH expressions will work in sub-tree's.\r\n\r\n```xml\r\n//text()[. = 'Text Content']\r\n```\r\nOr\r\n\r\n```xml\r\n//text()[contains(.,'Text Content that is not parsed')]\r\n```\r\n\r\nExpressions such the below will work:\r\n\r\n```xml\r\n//title[@lang]\r\n```\r\n```xml\r\n/bookstore/book[price\u003e35.00]\r\n```\r\n\r\n```xml\r\n/bookstore/book[@test='title']/test123\r\n```\r\n\r\n```xml\r\n/bookstore/book[@test='title'][@test2]/bookings\r\n```\r\n\r\nOnce an XPATH expression has been matched, it is loaded into a special class called a SaxNode, which is a wrapper for the node with helper methods to query deeper into the subtree.\r\n\r\n## Changelog\r\n\r\n\u003cdetails\u003e \r\n  \u003csummary\u003eOpen spoiler to view changelog \u003c/summary\u003e\r\n  \r\n### 1.0.0\r\n- Initial release.\r\n\u003c/details\u003e\r\n\r\n\r\n## Installation\r\n### Install from Maven Central\r\n\r\nJust add the following dependencies to your maven pom.xml\r\n\r\n```xml\r\n\u003cdependency\u003e\r\n    \u003cgroupId\u003eio.laniakia\u003c/groupId\u003e\r\n    \u003cartifactId\u003esaxPath\u003c/artifactId\u003e\r\n    \u003cversion\u003e1.0.0\u003c/version\u003e\r\n\u003c/dependency\u003e\r\n```\r\n## Example Usage\r\n\r\nAll rules have to have an XPATH expression specified to be triggered when the SAX parser reaches that path in the XML.\r\n\r\n**Create a Rule**\r\n\r\nBelow is the skeleton of a basic Rule \r\n\r\n```java\r\nimport io.laniakia.rule.Rule;\r\n...\r\npublic class RuleImpl extends Rule\r\n{\r\n\tpublic static boolean processed = false;\r\n\t\r\n\tpublic RuleImpl(String path) throws Exception \r\n\t{\r\n\t\tsuper(path);\r\n\t}\r\n\r\n\t@Override\r\n\tpublic void processRule(SaxNode saxNode) throws Exception \r\n\t{\r\n\t\t//Do things here\r\n\t}\r\n}\r\n```\r\n\r\nSetup for Rule Usage\r\n\r\n```java\r\nString testXML = \"\u003cbookstore\u003eExcludeText\u003ctest\u003etest\u003c/test\u003e\u003cbook\u003etestingText\u003ctesting123\u003e\u003c/testing123\u003e\u003c/book\u003e\u003c/bookstore\u003e\";\r\nXMLProcessor test = new XMLProcessor();\r\n//Your XPATH expression to trigger this rule on goes here\r\ntest.addRule(new RuleImpl(\"/bookstore/book\"));\r\ntest.process(new ByteArrayInputStream(testXML.getBytes(StandardCharsets.UTF_8)));\r\n```\r\n\r\n**Process Rules Asynchronously**\r\n\r\n```java\r\nimport io.laniakia.rule.Rule;\r\n...\r\ntest.process(new ByteArrayInputStream(testXML.getBytes(StandardCharsets.UTF_8)), true);\r\n```\r\n\r\n**Query SaxNode with XPATH Expression**\r\n\r\n```java\r\nimport io.laniakia.rule.Rule;\r\n...\r\n@Override\r\npublic void processRule(SaxNode saxNode) throws Exception \r\n{\r\n\tSaxNode resultNode = saxNode.xPathQueryNode(\"/location/subTree\");\r\n}\r\n```\r\n\r\n**Query SaxNode LIST with XPATH Expression**\r\n\r\n```java\r\nimport io.laniakia.rule.Rule;\r\n...\r\n@Override\r\npublic void processRule(SaxNode saxNode) throws Exception \r\n{\r\n\tList\u003cSaxNode\u003e resultNode = saxNode.xPathQueryNodeList(\"/location/subTree\");\r\n}\r\n```\r\n\r\n**Query Text of SaxNode**\r\n\r\nThis method of extracting text uses getTextContent() of the resulting Node\r\n\r\n```java\r\nimport io.laniakia.rule.Rule;\r\n...\r\n@Override\r\npublic void processRule(SaxNode saxNode) throws Exception \r\n{\r\n\tString text = saxNode.getAllNodeText(\"/textpath\");\r\n}\r\n```\r\n\r\n**Query Text of SaxNode V2**\r\n\r\nThis method of extracting text uses the XPath method of extracting Node text, rather than getting the Node value of each node.\r\n\r\n```java\r\nimport io.laniakia.rule.Rule;\r\n...\r\n@Override\r\npublic void processRule(SaxNode saxNode) throws Exception \r\n{\r\n\tString text = saxNode.getXPathNodeText(\"/textpath\");\r\n}\r\n```\r\n\r\n\r\n## Install from Source\r\n\r\nClone from remote repository then `mvn install`. All of the modules will be installed to your local maven repository.\r\n\r\n~~~bash\r\ngit clone https://github.com/scriptkittie/saxPath.git\r\ncd saxPath\r\nmvn install\r\n~~~\r\n\r\n## Issues/Forks\r\nPlease report any issues to the issues section \u0026 as always if you have any functionality requests go ahead and open an issue containing your suggestions.\r\n\r\nIf you have an addition to the project, fork it and submit a pull request. Any type of contributions are welcome.\r\n\r\n## Credits\r\nPackage written by [StCypher](https://twitter.com/yo_scriptkittie/with_replies)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscriptkittie%2Fsaxpath","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscriptkittie%2Fsaxpath","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscriptkittie%2Fsaxpath/lists"}