{"action":"created","issue":{"url":"https://api.github.com/repos/JATS4R/jats4r.github.io/issues/19","labels_url":"https://api.github.com/repos/JATS4R/jats4r.github.io/issues/19/labels{/name}","comments_url":"https://api.github.com/repos/JATS4R/jats4r.github.io/issues/19/comments","events_url":"https://api.github.com/repos/JATS4R/jats4r.github.io/issues/19/events","html_url":"https://github.com/JATS4R/jats4r.github.io/pull/19","id":69254961,"number":19,"title":"Validate XML against the JATS DTD using xmllint","user":{"login":"hubgit","id":14294,"avatar_url":"https://avatars.githubusercontent.com/u/14294?v=3","gravatar_id":"","url":"https://api.github.com/users/hubgit","html_url":"https://github.com/hubgit","followers_url":"https://api.github.com/users/hubgit/followers","following_url":"https://api.github.com/users/hubgit/following{/other_user}","gists_url":"https://api.github.com/users/hubgit/gists{/gist_id}","starred_url":"https://api.github.com/users/hubgit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hubgit/subscriptions","organizations_url":"https://api.github.com/users/hubgit/orgs","repos_url":"https://api.github.com/users/hubgit/repos","events_url":"https://api.github.com/users/hubgit/events{/privacy}","received_events_url":"https://api.github.com/users/hubgit/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-04-18T02:06:01Z","updated_at":"2015-06-25T21:15:54Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/JATS4R/jats4r.github.io/pulls/19","html_url":"https://github.com/JATS4R/jats4r.github.io/pull/19","diff_url":"https://github.com/JATS4R/jats4r.github.io/pull/19.diff","patch_url":"https://github.com/JATS4R/jats4r.github.io/pull/19.patch"},"body":"[this isn't necessarily ready to merge yet - it has some drawbacks and might need further work]\r\n\r\nAdded here: \r\n* The JATS 1.0 DTD files (in the `dtd` directory).\r\n* [`xmllint.js`](https://github.com/kripken/xml.js/) (~4MB), which is libxml2's xmllint ported to JS using Emscripten.\r\n* JS polyfills for the `Promise` and `fetch` APIs, for browsers that don't support them.\r\n\r\nWhen an XML file is selected, it will first be passed through `xmllint` (equivalent to `xmllint --noent --dtdvalid JATS-journalpublishing1.dtd example-file.xml`) which validates the contents of the XML file against the DTD and replaces named entities.\r\n\r\nOnce the XML is validated, it continues on to the Schematron checks as before.\r\n\r\nThis fixes https://github.com/JATS4R/elements/issues/49 - but has a downside in that it will only validate XML against the JATS 1.0 DTD, and requires that the doctype URI at the start of the XML file is exactly \"JATS-journalpublishing1.dtd\" - any other form and it will fail to validate.\r\n\r\nI haven't yet thought further about how other DTDs could be accomodated, or whether to proceed to Schematron validation if this first step fails."},"comment":{"url":"https://api.github.com/repos/JATS4R/jats4r.github.io/issues/comments/115400229","html_url":"https://github.com/JATS4R/jats4r.github.io/pull/19#issuecomment-115400229","issue_url":"https://api.github.com/repos/JATS4R/jats4r.github.io/issues/19","id":115400229,"user":{"login":"hubgit","id":14294,"avatar_url":"https://avatars.githubusercontent.com/u/14294?v=3","gravatar_id":"","url":"https://api.github.com/users/hubgit","html_url":"https://github.com/hubgit","followers_url":"https://api.github.com/users/hubgit/followers","following_url":"https://api.github.com/users/hubgit/following{/other_user}","gists_url":"https://api.github.com/users/hubgit/gists{/gist_id}","starred_url":"https://api.github.com/users/hubgit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hubgit/subscriptions","organizations_url":"https://api.github.com/users/hubgit/orgs","repos_url":"https://api.github.com/users/hubgit/repos","events_url":"https://api.github.com/users/hubgit/events{/privacy}","received_events_url":"https://api.github.com/users/hubgit/received_events","type":"User","site_admin":false},"created_at":"2015-06-25T21:15:54Z","updated_at":"2015-06-25T21:15:54Z","body":"@Klortho Great! I think it would be best to make a new branch, as I've linked to this one from elsewhere. That way you can make as many changes as you want, and we can merge together what works at the end."}}