{"id":21019339,"url":"https://github.com/rmraya/typesxml","last_synced_at":"2025-08-10T22:07:03.792Z","repository":{"id":133853849,"uuid":"448346474","full_name":"rmraya/TypesXML","owner":"rmraya","description":"Open source XML library written in TypeScript","archived":false,"fork":false,"pushed_at":"2025-02-28T19:18:24.000Z","size":225,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-09T17:59:43.352Z","etag":null,"topics":["parser","typescript","xml"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rmraya.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,"zenodo":null}},"created_at":"2022-01-15T17:32:42.000Z","updated_at":"2025-02-28T19:18:28.000Z","dependencies_parsed_at":"2023-12-26T15:32:50.721Z","dependency_job_id":"d4548144-8607-4e9d-974b-e55d751db061","html_url":"https://github.com/rmraya/TypesXML","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/rmraya/TypesXML","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmraya%2FTypesXML","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmraya%2FTypesXML/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmraya%2FTypesXML/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmraya%2FTypesXML/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rmraya","download_url":"https://codeload.github.com/rmraya/TypesXML/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rmraya%2FTypesXML/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269794097,"owners_count":24476743,"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-08-10T02:00:08.965Z","response_time":71,"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":["parser","typescript","xml"],"created_at":"2024-11-19T10:31:18.703Z","updated_at":"2025-08-10T22:07:03.754Z","avatar_url":"https://github.com/rmraya.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TypesXML\n\nOpen source XML library written in TypeScript\n\nImplements a SAX parser that exposes these methods from the `ContentHandler` interface:\n\n* initialize(): void;\n* setCatalog(catalog: Catalog): void;\n* startDocument(): void;\n* endDocument(): void;\n* xmlDeclaration(version: string, encoding: string, standalone: string): void;\n* startElement(name: string, atts: Array\\\u003cXMLAttribute\u003e): void;\n* endElement(name: string): void;\n* internalSubset(declaration: string): void;\n* characters(ch: string): void;\n* ignorableWhitespace(ch: string): void;\n* comment(ch: string): void;\n* processingInstruction(target: string, data: string): void;\n* startCDATA(): void;\n* endCDATA(): void;\n* startDTD(name: string, publicId: string, systemId: string): void;\n* endDTD(): void;\n* skippedEntity(name: string): void;\n\nClass `DOMBuilder` implements the `ContentHandler` interface and builds a DOM tree from an XML document.\n\n## Features currently in development\n\n* Parsing of DTDs and internal subsets from \u003c!DOCTYPE\u003e\n\n## Limitations\n\n* Validation not supported yet\n* Default values for attributes are not set when parsing an element\n\n## On the Roadmap\n\n* Support for XML Schemas\n* Support for RelaxNG\n\n## Installation\n\n```bash\nnpm install typesxml\n```\n\n## Example\n\n```TypeScript\nimport { ContentHandler } from \"./ContentHandler\";\nimport { DOMBuilder } from \"./DOMBuilder\";\nimport { SAXParser } from \"./SAXParser\";\nimport { XMLDocument } from \"./XMLDocument\";\nimport { XMLElement } from \"./XMLElement\";\n\nexport class Test {\n\n    constructor() {\n        try {\n            let contentHandler: ContentHandler = new DOMBuilder();\n            let xmlParser = new SAXParser();\n            xmlParser.setContentHandler(contentHandler);\n\n            // build the document from a file\n            xmlParser.parseFile(\"test.xml\");\n            let doc: XMLDocument = (contentHandler as DOMBuilder).getDocument();\n            let root: XMLElement = doc.getRoot();\n            console.log(doc.toString());\n\n            //  build the document again, this time from a string\n            xmlParser.parseString(doc.toString());\n            let newDoc = (contentHandler as DOMBuilder).getDocument();\n            console.log(newDoc.toString());\n\n        } catch (error: any) {\n            if (error instanceof Error) {\n                console.log(error.message);\n            } else {\n                console.log(error);\n            }\n        }\n    }\n}\n\nnew Test();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frmraya%2Ftypesxml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frmraya%2Ftypesxml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frmraya%2Ftypesxml/lists"}