{"id":15495114,"url":"https://github.com/samchon/sxml","last_synced_at":"2025-07-26T04:03:34.012Z","repository":{"id":65412292,"uuid":"119629675","full_name":"samchon/sxml","owner":"samchon","description":"Simple XML Library for TypeScript (JavaScript)","archived":false,"fork":false,"pushed_at":"2025-02-16T19:24:50.000Z","size":42,"stargazers_count":18,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-21T21:24:20.789Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/samchon.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":"2018-01-31T03:29:53.000Z","updated_at":"2025-03-27T12:27:24.000Z","dependencies_parsed_at":"2025-04-22T20:36:44.138Z","dependency_job_id":"27d69fb5-63a5-4f68-99cf-d1cd61f83949","html_url":"https://github.com/samchon/sxml","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/samchon/sxml","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samchon%2Fsxml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samchon%2Fsxml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samchon%2Fsxml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samchon%2Fsxml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samchon","download_url":"https://codeload.github.com/samchon/sxml/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samchon%2Fsxml/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267116173,"owners_count":24038623,"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-07-26T02:00:08.937Z","response_time":62,"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":"2024-10-02T08:16:08.990Z","updated_at":"2025-07-26T04:03:33.990Z","avatar_url":"https://github.com/samchon.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple XML\n[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/samchon/sxml/blob/master/LICENSE)\n[![npm version](https://badge.fury.io/js/sxml.svg)](https://www.npmjs.com/package/sxml)\n[![Downloads](https://img.shields.io/npm/dm/sxml.svg)](https://www.npmjs.com/package/sxml)\n[![Build Status](https://github.com/samchon/sxml/workflows/build/badge.svg)](https://github.com/samchon/sxml/actions?query=workflow%3Abuild)\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fsamchon%2Fsxml.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fsamchon%2Fsxml?ref=badge_shield)\n[![Chat on Gitter](https://badges.gitter.im/samchon/sxml.svg)](https://gitter.im/samchon/sxml?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\nIt's the most simple, concise and eledic library for XML. Just remember that structure, then you'll understand how to use it. If you want to know more about the detailed features, then utilize \u003cu\u003eauto-completion\u003c/u\u003e of TypeScript or read the [Guide Documents](https://github.com/samchon/sxml/wiki).\n\n```typescript\ndeclare module \"sxml\"\n{\n    export class XML extends std.HashMap\u003cstring, XMLList\u003e\n    {\n        private tag_: string;\n        private value_: string;\n        private property_map_: std.HashMap\u003cstring, string\u003e;\n    }\n    export class XMLList extends std.Vector\u003cXML\u003e;\n}\n```\n\n\n\n## Installation\n### NPM Module\nInstalling **SXML** in *NodeJS* is very easy. Just install with the `npm`\n\n```bash\n# Install SXML from the NPM module\nnpm install --save sxml\n```\n\n### Usage\nIn this section, we will study how to parse XML-string and access to members of that XML object. It's very simple and easy. Just remember and consider the principle structure of this `SXML`.\n\nIf you want to know more about the detailed features or how to generate XML, then utilize \u003cu\u003eauto-completion\u003c/u\u003e of TypeScript or read the [Guide Documents](https://github.com/samchon/sxml/wiki).\n\n#### example.xml\n```xml\n\u003c?xml version=\"1.0\" encoding=\"utf-8\" ?\u003e\n\u003cinvoke listener=\"setMemberList\"\u003e\n    \u003cparameter name=\"application\" type=\"string\"\u003esimulation\u003c/parameter\u003e\n    \u003cparameter name=\"sequence\" type=\"number\"\u003e3\u003c/parameter\u003e\n    \u003cparameter name=\"memberList\" type=\"XML\"\u003e\n        \u003cmemberList\u003e\n            \u003cmember id=\"samchon\" email=\"samchon@samchon.org\" name=\"Jeongho Nam\" /\u003e\n            \u003cmember id=\"github\" email=\"github@github.com\" name=\"GitHub\" /\u003e\n            \u003cmember id=\"robot\" email=\"google@google.com\" name=\"AlphaGo\" /\u003e\n        \u003c/memberList\u003e\n    \u003c/parameter\u003e\n\u003c/invoke\u003e\n```\n\n#### read.ts\n```typescript\nimport fs = require(\"fs\");\nimport sxml = require(\"sxml\");\n\nimport XML = sxml.XML;\nimport XMLList = sxml.XMLList;\n\nfunction main(): void\n{\n    let str: string = fs.readFileSync(\"example.xml\", \"utf8\");\n    trace(str);\n}\n\nfunction trace(str: string): void\n{\n    // CREATE AN XML OBJECT BY PARSING CHARACTERS\n    let xml: XML = new XML(str);\n\n    //----\n    // LIST OF PARAMETER OBJECTS\n    //----\n    // XML =\u003e std.HashMap\u003cstring, XMLList\u003e\n    // XMLList =\u003e std.Vector\u003cXML\u003e\n    let xmlList: XMLList = xml.get(\"parameter\");\n\n    console.log(\"#\" + xmlList.size()); // #3\n    \n    // PROPERTIES \u0026 VALUE OF 1ST PARAMETER\n    console.log\n    (\n        xmlList.at(0).getProperty(\"name\"), // \"application\"\n        xmlList.at(0).getProperty(\"type\"),  // \"string\"\n        xmlList.at(0).getValue() // \"simulation\"\n    );\n\n    // PROPERTIES \u0026 VALUE OF 2ND PARAMETER\n    console.log\n    (\n        xmlList.at(1).getProperty(\"name\"), // \"sequence\"\n        xmlList.at(1).getProperty(\"type\"), // \"number\"\n        xmlList.at(1).getValue() // \"3\"\n    );\n\n    //----\n    // ACCESS TO CHILDREN XML OBJECTS\n    //----\n    let members: XMLList = xml.get(\"parameter\").at(2)\n        .get(\"memberList\").at(0)\n        .get(\"member\");\n\n    // PRINT PROPERTIES\n    console.log\n    (\n        members.at(0).getProperty(\"id\"), // \"samchon\"\n        members.at(1).getProperty(\"email\"), // \"github@github.com\"\n        members.at(2).getProperty(\"name\") // \"Alphago\n    );\n}\n\nmain();\n```\n\n\n\n## References\n  - **Repositories**\n    - [GitHub Repository](https://github.com/samchon/sxml)\n    - [NPM Repository](https://www.npmjs.com/package/sxml)\n  - **Documents**\n    - [**Guide Documents**](https://github.com/samchon/sxml/wiki)\n    - [API Documents](http://samchon.github.io/sxml/api)\n  - **Related Project**\n    - [TSTL](https://github.com/samchon/tstl)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamchon%2Fsxml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamchon%2Fsxml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamchon%2Fsxml/lists"}