{"id":18988289,"url":"https://github.com/marhop/xml-processing","last_synced_at":"2025-11-10T17:03:38.338Z","repository":{"id":72731092,"uuid":"115423603","full_name":"marhop/xml-processing","owner":"marhop","description":"Examples for XML processing in different programming languages","archived":false,"fork":false,"pushed_at":"2023-09-16T20:01:33.000Z","size":67,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-01T13:43:17.796Z","etag":null,"topics":["exercise","haskell","programming-exercise","python","xml","xml-processing","xmlstarlet","xslt"],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marhop.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":"2017-12-26T13:15:19.000Z","updated_at":"2023-09-17T16:46:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"7ef1983a-0503-4105-8c5a-75d8aa0982aa","html_url":"https://github.com/marhop/xml-processing","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marhop%2Fxml-processing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marhop%2Fxml-processing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marhop%2Fxml-processing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marhop%2Fxml-processing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marhop","download_url":"https://codeload.github.com/marhop/xml-processing/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240001784,"owners_count":19732161,"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":["exercise","haskell","programming-exercise","python","xml","xml-processing","xmlstarlet","xslt"],"created_at":"2024-11-08T16:43:21.639Z","updated_at":"2025-11-10T17:03:38.302Z","avatar_url":"https://github.com/marhop.png","language":"Haskell","readme":"# xml-processing\n\nExamples for XML processing in different programming languages.\n\nThe exercises below are simple instances of common real-world XML processing\ntasks: selection of elements, modification of element content, modification of\nthe XML tree and validation against an XML schema. The [example XML\nfile](xml/example.xml) and the [underlying schema](xml/gtr_dc.xsd) can be found\nin the xml directory.\n\nFeel free to send pull requests for solutions in additional languages or for\nimprovements of the existing solutions!\n\n# Exercises\n\n## Exercise 1\n\nPrint a list of all leaf node creators and titles, i.e., all `content/creator`\nand `content/title` children of `node` elements that contain no other `node`\nelements as children. Each item should be a line of the form \"creator, title\".\n\n## Exercise 2\n\nSame as exercise 1, but consider the case where some leaf nodes have no creator\nelement. Search their ancestors until a creator element is found and print that\ninstead.\n\n## Exercise 3\n\nMake the content of all `title` elements uppercase. Print the resulting XML\ndocument.\n\n## Exercise 4\n\nAdd a new item to the end of the \"A Song of Ice and Fire\" section with title \"A\nFeast for Crows\" and date \"2005\". Print the resulting XML document.\n\n## Exercise 5\n\nRemove the \"Programming Books\" section. Print the resulting XML document.\n\n## Exercise 6\n\nValidate the XML document. Keep in mind that the schema file references\nadditional external schema files that have to be retrieved from the internet, so\ninternet access is required for validation.\n\n## Exercise 7\n\nFlatten the XML hierarchy by removing the top level nodes (those immediately\nbelow the `tree` root element). Add a `content/subject` element to all their\nimmediate child nodes that preserves the `name` attribute value of the removed\nparent node (\"Programming Books\" or \"Fantasy Books\", respectively). Print the\nresulting XML document.\n\n## Exercise 8\n\nReverse exercise 7: Create a new top level node for each distinct subject found\nin the current top level nodes. Move each node to its respective parent node\n(one of the new top level nodes). Remove the subject elements. Print the\nresulting XML document.\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarhop%2Fxml-processing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarhop%2Fxml-processing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarhop%2Fxml-processing/lists"}