{"id":18069194,"url":"https://github.com/viniciussanchez/xml-reader","last_synced_at":"2025-04-05T16:18:28.490Z","repository":{"id":98684454,"uuid":"498475048","full_name":"viniciussanchez/xml-reader","owner":"viniciussanchez","description":"XML Reader for Delphi and Lazarus","archived":false,"fork":false,"pushed_at":"2024-04-02T13:32:57.000Z","size":31,"stargazers_count":29,"open_issues_count":0,"forks_count":5,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-02-11T12:53:40.202Z","etag":null,"topics":["delphi","fpc","lazarus","reader","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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2022-05-31T19:42:18.000Z","updated_at":"2025-01-29T15:13:25.000Z","dependencies_parsed_at":"2024-04-02T14:54:11.460Z","dependency_job_id":null,"html_url":"https://github.com/viniciussanchez/xml-reader","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viniciussanchez%2Fxml-reader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viniciussanchez%2Fxml-reader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viniciussanchez%2Fxml-reader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viniciussanchez%2Fxml-reader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/viniciussanchez","download_url":"https://codeload.github.com/viniciussanchez/xml-reader/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":["delphi","fpc","lazarus","reader","xml"],"created_at":"2024-10-31T08:09:33.971Z","updated_at":"2025-04-05T16:18:28.450Z","avatar_url":"https://github.com/viniciussanchez.png","language":"Pascal","readme":"# XML Reader\n\n## ⚙️ Installation\nInstallation is done using the [`boss install`](https://github.com/HashLoad/boss) command line:\n``` sh\nboss install viniciussanchez/xml-reader\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-reader/src\n```\n\n## ⚡️ Quickstart\n\n```pascal\nuses Xml.Reader;\n```\n\n#### Load from file\n\n```pascal\nvar\n  LXmlReader: IXmlReader;\nbegin\n  LXmlReader := TXmlReader.New.LoadFromFile('C:\\xml\\nfe.xml');\nend;\n```\n\n#### Load from string\n\n```pascal\nvar\n  LXmlReader: IXmlReader;\nbegin\n  LXmlReader := TXmlReader.New.LoadFromString('my xml here!');\nend;\n```\n\n#### Get xml version\n\n```pascal\nbegin\n  Result := LXmlReader.Version;\nend;\n```\n\n#### Get xml encoding\n\n```pascal\nbegin\n  Result := LXmlReader.Encoding;\nend;\n```\n\n#### Get main node\n\n```pascal\nvar\n  LMainNode: IXmlNode;\nbegin\n  LMainNode := LXmlReader.Node;\nend;\n```\n\n#### How to list nodes\n\n```pascal\nvar\n  LNode: IXmlNode;\nbegin\n  for LNode in LMainNode.Nodes do\n    // my code here!\nend;\n```\n\n#### How to list attributes\n\n```pascal\nvar\n  LAttribute: IXmlAttribute;\nbegin\n  for LAttribute in LMainNode.Attributes do\n    // my code here!\nend;\n```\n\n#### How to list elements\n\n```pascal\nvar\n  LElement: IXmlElement;\nbegin\n  for LElement in LMainNode.Elements do\n    // my code here!\nend;\n```\n\n#### Other resources\n\n```pascal\nvar\n  LNode: IXmlNode;\n  LElement: IXmlElement;\n  LAttribute: IXmlAttribute;\nbegin\n  // get the name of a node\n  LNode.Name;\n\n  // check if the node has an attribute\n  LNode.ContainsAttribute('attribute name');\n\n  // check if the node has a node\n  LNode.ContainsNode('node name');\n\n  // check if the node has an element\n  LNode.ContainsElement('element name');    \n\n  // get the value of an attribute from a node\n  LNode.GetAttribute('attribute name');\n\n  // get a node from a node\n  LNode.GetNode('node name');\n\n  // get the element of a node\n  LNode.GetElement('element name');\n\n  // get the attributes of a node\n  LNode.Attributes;\n\n  // get the elements of a node\n  LNode.Elements;\n\n  // get the nodes of a node\n  LNode.Nodes;\n\n  // get the name of an element\n  LElement.Name;\n\n  // get the value of an element\n  LElement.Value;  \n\n  // get the value in string format from an element\n  LElement.AsString;\n\n  // get the value in integer format of an element\n  LElement.AsInteger;\n\n  // get the name of an attribute\n  LAttribute.Name;\n\n  // get the value of an attribute\n  LAttribute.Value;  \n\n  // get the value in string format of an attribute\n  LAttribute.AsString;\n\n  // get the value in integer format of an attribute\n  LAttribute.AsInteger;\nend;\n```\n\n## ⚠️ License\n\n`XML Reader` is free and open-source software licensed under the [MIT License](https://github.com/viniciussanchez/xml-reader/blob/master/LICENSE).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviniciussanchez%2Fxml-reader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fviniciussanchez%2Fxml-reader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviniciussanchez%2Fxml-reader/lists"}