{"id":22173250,"url":"https://github.com/digao-dalpiaz/dzxmltable","last_synced_at":"2026-02-07T01:31:14.680Z","repository":{"id":47132674,"uuid":"346516076","full_name":"digao-dalpiaz/DzXMLTable","owner":"digao-dalpiaz","description":"Flexible dynamic table stored as XML file","archived":false,"fork":false,"pushed_at":"2021-09-19T23:12:02.000Z","size":99,"stargazers_count":13,"open_issues_count":0,"forks_count":6,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-24T17:53:18.684Z","etag":null,"topics":["component","data-store","delphi","dynamic","pascal","table","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/digao-dalpiaz.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":"2021-03-10T23:04:14.000Z","updated_at":"2024-05-18T21:47:04.000Z","dependencies_parsed_at":"2022-08-19T01:10:51.312Z","dependency_job_id":null,"html_url":"https://github.com/digao-dalpiaz/DzXMLTable","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/digao-dalpiaz/DzXMLTable","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digao-dalpiaz%2FDzXMLTable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digao-dalpiaz%2FDzXMLTable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digao-dalpiaz%2FDzXMLTable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digao-dalpiaz%2FDzXMLTable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/digao-dalpiaz","download_url":"https://codeload.github.com/digao-dalpiaz/DzXMLTable/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digao-dalpiaz%2FDzXMLTable/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29183946,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T00:44:15.062Z","status":"ssl_error","status_checked_at":"2026-02-07T00:35:01.758Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["component","data-store","delphi","dynamic","pascal","table","xml"],"created_at":"2024-12-02T07:31:29.704Z","updated_at":"2026-02-07T01:31:14.665Z","avatar_url":"https://github.com/digao-dalpiaz.png","language":"Pascal","funding_links":["https://ko-fi.com/C0C53LVFN"],"categories":[],"sub_categories":[],"readme":"# DzXMLTable\n\n## Delphi non-visual component to handle flexible dynamic table stored as XML file\n\n![Delphi Supported Versions](https://img.shields.io/badge/Delphi%20Supported%20Versions-XE3..11-blue.svg)\n![Platforms](https://img.shields.io/badge/Platforms-Win32%20and%20Win64-red.svg)\n![Auto Install](https://img.shields.io/badge/-Auto%20Install%20App-orange.svg)\n![VCL and FMX](https://img.shields.io/badge/-VCL%20and%20FMX-lightgrey.svg)\n\n[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/C0C53LVFN)\n\n- [What's New](#whats-new)\n- [Component Description](#component-description)\n- [Installing](#installing)\n- [Example of use](#example-of-use)\n- [Published Properties](#published-properties)\n- [Public Properties](#public-properties)\n- [Methods](#methods)\n- [TDzRecord Object](#tdzrecord-object)\n\n## What's New\n\n- 09/12/2021 (Version 1.2)\n\n   - Delphi 11 auto-install support.\n\n\u003cdetails\u003e\n  \u003csummary\u003eClick here to view the entire changelog\u003c/summary\u003e\n\n- 04/13/2021 (Version 1.1)\n\n   - Fixed previous Delphi versions (at least on XE2, XE3, XE4 and XE5) package tag. It was causing package compilation error.\n\n- 03/27/2021 (Version 1.0)\n\n   - First version of component.\n   \n\u003c/details\u003e\n\n## Component Description\n\nWhen you are working on your software project, you always need to store some data into a INI file or some text file, as a configuration file or other information.\n\nSo, the options you have is INI file, or plain text. And almost always you need a table with some fields.\n\nIn a plain text, you can use one record per line, and separate fields using tab character, or pipe character, or another one. But you have some problems with this method: you need to take care about the separator char, not using it at fields value; and you have a biggest problem: in a future version, if you need to add a column, you lose the compatibility at this file when there are already data stored.\n\nIf you are working with INI file, you can specify the field names, but even that, you have problems to store one record per section, and is difficult to reorder records, delete records and name the record.\n\nBut don't worry, here is the solution.\n\nThe DzXMLTable is a non-visual component where you can store records with fields and values, and you can name the field, so you don't need to worry at future versions. You can add new fields at any time, just reading and writing them.\n\n*This is a new concept of my previous DzMiniTable component.*\n\n## Installing\n\n### Auto install\n\n1. Download Component Installer from: https://github.com/digao-dalpiaz/CompInstall/releases/latest\n2. Put **CompInstall.exe** into the component repository sources folder.\n3. Close Delphi IDE and run **CompInstall.exe** app.\n\n### Manual install\n\n1. Open **DzXMLTable** package in Delphi.\n2. Ensure **Win32** Platform and **Release** config are selected.\n3. Then **Build** and **Install**.\n4. If you want to use Win64 platform, select this platform and Build again.\n5. Add sub-path Win32\\Release to the Library paths at Tools\\Options using 32-bit option, and if you have compiled to 64 bit platform, add sub-path Win64\\Release using 64-bit option.\n\nSupports Delphi XE3..Delphi 11\n\n## Example of use\n\n```delphi\ntype\n  TContact = class\n    ID: Integer;\n    Name: string;\n    Phone: string;\n    Active: Boolean; //new field in some new program version\n  end;\n\nprocedure LoadContactsExample(List: TObjectList\u003cTContact\u003e);\nvar\n  XML: TDzXMLTable;  \n  Rec: TDzRecord;\n  Contact: TContact;\nbegin\n  XML := TDzXMLTable.Create(nil);\n  try\n    XML.FileName := 'C:\\Data.xml';\n    XML.Load;\n    \n    for Rec in XML do\n    begin\n      Contact := TContact.Create;\n      Contact.ID := Rec['ID'];\n      Contact.Name := Rec['Name'];\n      Contact.Phone := Rec['Phone'];\t  \n      Contact.Active := Rec.ReadDef('Active', True); //saved xml in old version could not have this field, so, read with default value.\n      List.Add(Contact);\n    end;\n    \n  finally\n    XML.Free;\n  end;\nend;\n```\n\n\u003e The field name is always case-insensitive in all methods and properties parameter.\n\n## Published Properties\n\n`FileName: string` = Specifies the full XML file name to Open and Save the table\n\n`RequiredFile: Boolean` = When this property is disabled (default), if the file does not exist at Open method, the table will be loaded empty without raising any exception.\n\n`RequiredField: Boolean` = When this property is disabled (default), you can read a non-exitent field without raising and exception, returning `Unassigned` variant value.\n\n## Public Properties\n\n`Rec[Index: Integer]: TDzRecord` (default component property) = Returns record object by index.\n\n`RecCount: Integer` = Returns record count.\n\n## Methods\n\n```delphi\nprocedure Load;\n```\nLoad the table from file specified at FileName property\n\n```delphi\nprocedure Save;\n```\nSave the table to file specified at FileName property\n\n```delphi\nprocedure Clear;\n```\nClear all data in the table\n\n```delphi\nfunction New(Index: Integer = -1): TDzRecord;\n```\nCreate a new record in the table and returns record object. You can specify the new record position in the table, using `Index` parameter. If you leave `Index = -1`, the record wil be added at the end of the table.\n\n```delphi\nprocedure Delete(Index: Integer);\n```\nDelete a record by index.\n\n```delphi\nfunction FindIdxByField(const Name: string; const Value: Variant): Integer;\n```\nReturns the first record index that matches same Name and Value. If no record is found, the function will return `nil`.\n\n```delphi\nfunction FindRecByField(const Name: string; const Value: Variant): TDzRecord;\n```\nReturns the first record object that matches same Name and Value. If no record is found, the function will return `nil`.\n\n```delphi\nfunction FindIdxBySameText(const Name: string; const Value: Variant): Integer;\n```\nReturns the first record index that matches same Name and Value, **where Value is compared as String using case-insensitive**. If no record is found, the function will return `nil`.\n\n```delphi\nfunction FindRecBySameText(const Name: string; const Value: Variant): TDzRecord;\n```\nReturns the first record object that matches same Name and Value, **where Value is compared as String using case-insensitive**. If no record is found, the function will return `nil`.\n\n```delphi\nprocedure Move(CurIndex, NewIndex: Integer);\n```\nMoves a record from `CurIndex` to `NewIndex` position in the table.\n\n## TDzRecord Object\n\n### Properties\n\n`Field[const Name: string]: Variant` = Returns or defines field value as variant by field name.\nWhen getting field value, if the field does not exist, an exception will be raised, unless the `RequiredField` property is False (in this case, an `Unassigned` value will be returned.\nWhen setting field value, if the field does not exist, it will be automatically created with specified name and value.\n\n`FieldIdx[Index: Integer]: TDzField` = Returns field object by field index.\n\n\u003e Warning: One record can contain fields that are different from another record. So, you should never use a fixed index to a specific field (like a column) across the records.\n\n`FieldCount: Integer` = Returns number of fields in this record.\n\n### Methods\n\n```delphi\nfunction ReadDef(const Name: string; DefValue: Variant): Variant;\n```\nReturns field value by field name. If field does not exist in the record, return `DefValue`.\n\n```delphi\nfunction FindField(const Name: string): TDzField;\n```\nReturns field object by field name. If field does not exist, returns `nil`.\n\n```delphi\nfunction FieldExists(const Name: string): Boolean;\n```\nReturns true if field exists by specified field name.\n\n```delphi\nprocedure ClearFields;\n```\nClear all fields data in the record (It doesn't just remove the value from the fields, but the fields altogether).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigao-dalpiaz%2Fdzxmltable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdigao-dalpiaz%2Fdzxmltable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigao-dalpiaz%2Fdzxmltable/lists"}