{"id":18069192,"url":"https://github.com/viniciussanchez/xml-builder","last_synced_at":"2025-04-05T16:18:28.138Z","repository":{"id":65949950,"uuid":"457376388","full_name":"viniciussanchez/xml-builder","owner":"viniciussanchez","description":"XML Builder for Delphi and Lazarus","archived":false,"fork":false,"pushed_at":"2022-02-10T18:02:44.000Z","size":22,"stargazers_count":58,"open_issues_count":1,"forks_count":15,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-02-11T12:53:40.057Z","etag":null,"topics":["builder","delphi","fpc","lazarus","xml"],"latest_commit_sha":null,"homepage":"","language":"Pascal","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/viniciussanchez.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":"2022-02-09T13:45:51.000Z","updated_at":"2025-01-20T12:31:56.000Z","dependencies_parsed_at":"2023-02-18T00:25:14.568Z","dependency_job_id":null,"html_url":"https://github.com/viniciussanchez/xml-builder","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viniciussanchez%2Fxml-builder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viniciussanchez%2Fxml-builder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viniciussanchez%2Fxml-builder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viniciussanchez%2Fxml-builder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/viniciussanchez","download_url":"https://codeload.github.com/viniciussanchez/xml-builder/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247361706,"owners_count":20926643,"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":["builder","delphi","fpc","lazarus","xml"],"created_at":"2024-10-31T08:09:33.849Z","updated_at":"2025-04-05T16:18:28.097Z","avatar_url":"https://github.com/viniciussanchez.png","language":"Pascal","funding_links":[],"categories":[],"sub_categories":[],"readme":"# XML Builder\n\n## ⚙️ Installation\nInstallation is done using the [`boss install`](https://github.com/HashLoad/boss) command line:\n``` sh\nboss install viniciussanchez/xml-builder\n```\n\n## ⚙️ Manual Installation for Delphi\nIf you choose to install manually, simply add the following folders to your project, in *Project \u003e Options \u003e Resource Compiler \u003e Directories and Conditionals \u003e Include file search path*\n```\n../xml-builder/src\n```\n\n## ⚡️ Quickstart\n\n```pascal\nuses Xml.Builder;\n\nvar\n  LDeveloperNode, LProjectsNode: IXmlNode;\nbegin\n  LProjectsNode := TXmlNode.New('projects')\n    .AddElement('Horse', 'yes')\n    .AddElement('Boss', 'yes')\n    .AddElement('RESTRequest4Delphi', 'yes')\n    .AddElement('DataSet-Serialize', 'yes')\n    .AddElement('BCrypt', 'yes');\n\n  LDeveloperNode := TXmlNode.New('developer')\n    .AddAttribute('mvp', 'true')\n    .AddElement('firstName', 'Vinicius')\n    .AddElement('lastName', 'Sanchez')\n    .AddElement('age')\n    .AddNode(LProjectsNode);\n\n  TXmlBuilder.New\n    .AddNode(LDeveloperNode)\n    .Xml;\nend;\n\n// Another way to implement:\n\nbegin\n  TXmlBuilder.New\n    .AddNode(TXmlNode.New('developer')\n      .AddAttribute('mvp', 'true')\n      .AddElement('firstName', 'Vinicius')\n      .AddElement('lastName', 'Sanchez')\n      .AddElement('age')\n      .AddNode(TXmlNode.New('projects')\n        .AddElement('Horse', 'yes')\n        .AddElement('Boss', 'yes')\n        .AddElement('RESTRequest4Delphi', 'yes')\n        .AddElement('DataSet-Serialize', 'yes')\n        .AddElement('BCrypt', 'yes')))\n    .Xml;\nend;\n``` \nResult:\n```xml\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003cdeveloper mvp=\"true\"\u003e\n   \u003cfirstName\u003eVinicius\u003c/firstName\u003e\n   \u003clastName\u003eSanchez\u003c/lastName\u003e\n   \u003cage /\u003e\n   \u003cprojects\u003e\n      \u003cBoss\u003eyes\u003c/Boss\u003e\n      \u003cDataSet-Serialize\u003eyes\u003c/DataSet-Serialize\u003e\n      \u003cRESTRequest4Delphi\u003eyes\u003c/RESTRequest4Delphi\u003e\n      \u003cBCrypt\u003eyes\u003c/BCrypt\u003e\n      \u003cHorse\u003eyes\u003c/Horse\u003e\n   \u003c/projects\u003e\n\u003c/developer\u003e\n```\nYou can also save the file to disk:\n```pascal\nTXmlBuilder.New.SaveToFile('C:\\sample.xml');\n```\n\n## ⚡️ DataSet Adapter\n\n```pascal\nuses Xml.Builder;\n\nbegin\n  mtDeveloper.Append;\n  mtDeveloperfirstName.AsString := 'Vinicius';\n  mtDeveloperlastName.AsString := 'Sanchez';\n  mtDevelopermvp.AsBoolean := True;\n  mtDeveloper.Post;\n  \n  mmXml.Lines.Text := TXmlBuilder.Adapter(mtDeveloper).Xml;\nend;\n``` \nResult:\n```xml\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003cmtDeveloper\u003e\n   \u003cfirstName\u003eVinicius\u003c/firstName\u003e\n   \u003clastName\u003eSanchez\u003c/lastName\u003e\n   \u003cmvp\u003eTrue\u003c/mvp\u003e\n\u003c/mtDeveloper\u003e\n```\n\n## ⚠️ License\n\n`XML Builder` is free and open-source software licensed under the [MIT License](https://github.com/viniciussanchez/xml-builder/blob/master/LICENSE). \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviniciussanchez%2Fxml-builder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fviniciussanchez%2Fxml-builder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviniciussanchez%2Fxml-builder/lists"}