{"id":21426089,"url":"https://github.com/bcdh/tei-strip-and-include","last_synced_at":"2026-02-25T11:08:31.920Z","repository":{"id":135734185,"uuid":"213041524","full_name":"BCDH/tei-strip-and-include","owner":"BCDH","description":"A quick and dirty workaround for including TEI fragments with xi:include into \u003cegXML\u003e","archived":false,"fork":false,"pushed_at":"2019-10-05T18:32:53.000Z","size":108,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-28T16:48:28.069Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BCDH.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2019-10-05T17:26:20.000Z","updated_at":"2019-10-05T18:32:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"b4a1f253-93e3-41df-a26a-13f8830c0173","html_url":"https://github.com/BCDH/tei-strip-and-include","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/BCDH/tei-strip-and-include","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BCDH%2Ftei-strip-and-include","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BCDH%2Ftei-strip-and-include/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BCDH%2Ftei-strip-and-include/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BCDH%2Ftei-strip-and-include/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BCDH","download_url":"https://codeload.github.com/BCDH/tei-strip-and-include/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BCDH%2Ftei-strip-and-include/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29819265,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-25T05:36:42.804Z","status":"ssl_error","status_checked_at":"2026-02-25T05:36:31.934Z","response_time":61,"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":[],"created_at":"2024-11-22T21:39:54.855Z","updated_at":"2026-02-25T11:08:31.904Z","avatar_url":"https://github.com/BCDH.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TEI Strip and Include Examples\n\nTEI uses `\u003cegXML\u003e` in a separate namespace (`http://www.tei-c.org/ns/Examples`) for encoding XML fragments demonstrating the use of some XML, in which the egXML element functions as the root element.\n\nI was driven on the brink of insanity by the fact that the content of `\u003cegXML\u003e` cannot include any other namespace including `http://www.tei-c.org/ns/1.0`. Because of this restriction, it is impossible to xi:include fragments from a separate TEI file.\n\nNot being able to validate or reuse one's examples is a total pain in the neck, especially in longer documents.\n\nYou can use my quick and dirty workaround, as illustrated by this repo:\n\n- open the oXygen project file `TEI-strinp-and-include-examples.xpr`\n- use `examples.xml` to store and validate all your TEI examples\n- associate this file with an XSLT transformation scenario (in the attached oXygen project `TEI-ns-stripper`) which uses the provided `tei-stripper.xsl`\n- every time you add and validate some new TEI content in `examples.xml`, run the `TEI-ns-stripper` scenario. It will create a file called `examples-stripped.xml`, which will be exactly the same as your original `example.xml`, but it will artificially put the TEI root element in the `http://www.tei-c.org/ns/Examples` namespace, making it legit for inclusion in `\u003cegXML\u003e`\n- to include TEI fragments in a TEI document (in this repo, `call4examples.xml`), use `xi:include` to include from `examples-stripped.xml` as opposed to `examples.xml`, like this:\n\n  ```xml\n  \u003cegXML xmlns=\"http://www.tei-c.org/ns/Examples\"\u003e\n    \u003cxi:include href=\"examples-stripped.xml\" xpointer=\"element(test/1)\"/\u003e\n  \u003c/egXML\u003e\n  ```\n- The included fragments will now be in the same namespace as `\u003cegXML\u003e` which means that your `call4examples.xml` file will not cause any validation errors, but your included (and potentially reusable) fragments will be the same as those that you validated im `examples.xml`.\n\nOf course, if there is an easier way to do all this, I'd be thrilled to learn about it.\n\nThis is something that should have been considered when deciding on `\u003cegXML\u003e`. Creating fake TEI files in the wrong namespace is not what I consider best practice.  \n\n![screenshot](https://i.imgur.com/rbmr8qV.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbcdh%2Ftei-strip-and-include","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbcdh%2Ftei-strip-and-include","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbcdh%2Ftei-strip-and-include/lists"}