{"id":23960860,"url":"https://github.com/pawel-slowik/sql-xml-to-csv","last_synced_at":"2026-05-14T18:06:13.203Z","repository":{"id":226011128,"uuid":"764700599","full_name":"pawel-slowik/sql-xml-to-csv","owner":"pawel-slowik","description":"Convert MySQL / MariaDB XML into CSV","archived":false,"fork":false,"pushed_at":"2024-12-23T10:18:03.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-24T12:47:56.441Z","etag":null,"topics":["csv","mariadb","mysql","xml","xslt"],"latest_commit_sha":null,"homepage":"","language":"XSLT","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pawel-slowik.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}},"created_at":"2024-02-28T14:59:27.000Z","updated_at":"2024-12-23T10:18:06.000Z","dependencies_parsed_at":"2024-12-20T13:41:33.830Z","dependency_job_id":"9465113d-293c-420c-bb0c-a474b9c30cf3","html_url":"https://github.com/pawel-slowik/sql-xml-to-csv","commit_stats":null,"previous_names":["pawel-slowik/sql-xml-to-csv"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pawel-slowik/sql-xml-to-csv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pawel-slowik%2Fsql-xml-to-csv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pawel-slowik%2Fsql-xml-to-csv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pawel-slowik%2Fsql-xml-to-csv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pawel-slowik%2Fsql-xml-to-csv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pawel-slowik","download_url":"https://codeload.github.com/pawel-slowik/sql-xml-to-csv/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pawel-slowik%2Fsql-xml-to-csv/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33037077,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-14T02:00:06.663Z","response_time":57,"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":["csv","mariadb","mysql","xml","xslt"],"created_at":"2025-01-06T19:57:20.802Z","updated_at":"2026-05-14T18:06:13.189Z","avatar_url":"https://github.com/pawel-slowik.png","language":"XSLT","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Convert MySQL / MariaDB XML into CSV\n\nThis is a XSLT 1.0 transformation that converts MySQL / MariaDB XML output into\nCSV format.\n\nIt can be useful for dumping database contents into CSV files when you can't use\nthe `SELECT ... INTO OUTFILE ...` syntax.\n\n\n## Usage\n\nWith the CLI client:\n\n    echo 'SELECT * FROM table' | \\\n    mariadb --batch --xml --host localhost --user user --password=password db | \\\n    xsltproc xml2csv.xslt - \u003e output.csv\n\nWith the `mysqldump` CLI utility:\n\n    mysqldump --xml --host localhost --user user --password=password db table | \\\n    xsltproc xml2csv.xslt - \u003e output.csv\n\nUsing `;` instead of the default `,` as column separators:\n\n    mysqldump --xml --host localhost --user user --password=password db table | \\\n    xsltproc --stringparam column_separator ';' xml2csv.xslt - \u003e output.csv\n\n\n### Parameters\n\n- `column_separator` - string used to separate columns. This is the equivalent\n  of the `TERMINATED BY ...` option for `SELECT ... INTO OUTFILE ...`. Default\n  is `,`.\n- `column_enclosed_by` - string used to quote column values. This is meant to be\n  the equivalent of the `ENCLOSED BY ...` option, but its handling may be\n  slightly different. Default is `\"`. Can be empty.\n- `column_escaped_by` - string used to escape the `column_enclosed_by`\n  character.  This is roughly equivalent to the `ESCAPED BY ...` option.\n  Default is `\\`.\n- `escape_newlines` - string with two allowed values:\n    - `1`: replace newlines in column content with the string `\\n`. This is the\n      default.\n    - `0`: output newlines unchanged.\n\n\n## End of line processing\n\nThe XML engine does not distinguish between various [newline\nrepresentations](https://en.wikipedia.org/wiki/End_of_line). Therefore any\nrequired end of line processing should be performed separately. This could be\nimplemented either before any XML processing, e.g. in SQL queries, or after\nfinishing it, with tools like `sed`, `tr`, `dos2unix` etc.\n\n`xsltproc`'s internal representation of a newline can be verified like this:\n\n    printf '\u003c?xml version=\"1.0\"?\u003e\u003croot\u003ea\\nb\u003c/root\u003e' | xsltproc test_newlines.xslt -\n\n    printf '\u003c?xml version=\"1.0\"?\u003e\u003croot\u003ea\\rb\u003c/root\u003e' | xsltproc test_newlines.xslt -\n\nThe output is the same for both cases, even though they contain data with\ndifferent line endings.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpawel-slowik%2Fsql-xml-to-csv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpawel-slowik%2Fsql-xml-to-csv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpawel-slowik%2Fsql-xml-to-csv/lists"}