{"action":"created","issue":{"url":"https://api.github.com/repos/substance/texture/issues/627","repository_url":"https://api.github.com/repos/substance/texture","labels_url":"https://api.github.com/repos/substance/texture/issues/627/labels{/name}","comments_url":"https://api.github.com/repos/substance/texture/issues/627/comments","events_url":"https://api.github.com/repos/substance/texture/issues/627/events","html_url":"https://github.com/substance/texture/issues/627","id":343734284,"node_id":"MDU6SXNzdWUzNDM3MzQyODQ=","number":627,"title":"Getting rid of InternalArticle XML schema","user":{"login":"michael","id":2931,"node_id":"MDQ6VXNlcjI5MzE=","avatar_url":"https://avatars1.githubusercontent.com/u/2931?v=4","gravatar_id":"","url":"https://api.github.com/users/michael","html_url":"https://github.com/michael","followers_url":"https://api.github.com/users/michael/followers","following_url":"https://api.github.com/users/michael/following{/other_user}","gists_url":"https://api.github.com/users/michael/gists{/gist_id}","starred_url":"https://api.github.com/users/michael/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michael/subscriptions","organizations_url":"https://api.github.com/users/michael/orgs","repos_url":"https://api.github.com/users/michael/repos","events_url":"https://api.github.com/users/michael/events{/privacy}","received_events_url":"https://api.github.com/users/michael/received_events","type":"User","site_admin":false},"labels":[{"id":398653442,"node_id":"MDU6TGFiZWwzOTg2NTM0NDI=","url":"https://api.github.com/repos/substance/texture/labels/priority","name":"priority","color":"d93f0b","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-23T17:57:18Z","updated_at":"2018-07-23T18:15:07Z","closed_at":null,"author_association":"MEMBER","body":"There are some serious problems with our approach of 2 XML schemas. Especially during conversion. I've realised that we've so far programmed against the following assumption: During conversion at all times both schemas TextureArticle and InternalArticle need to be valid in order to use schema reflection (things like `schema.findFirstValidPos(parent, tagName)`)\r\n\r\nI'm now struggling with importing / exporting the article record:\r\n\r\n- In TextureArticle we have standard-conform tagging with strict order e.g. for (((fpage, lpage?)?, page-range?) | elocation-id)?\r\n- In InternalArticle these elements are not allowed (as we have them inside pubMetaDb (article-record) for storing that information\r\n- In InternalArticle we have some custom things in place such as aff-group or custom table schema \r\n- The importing step means that the underlying XML tree will be valid in InternalArticle but invalid in TextureArticle\r\n- Now this is a problem because during export I want to use schema reflection to find the insertion positions for fpage,lpage where i need to rely on schema.findFirstValidPos. However, this is not possible before the xml becomes valid for TextureArticle (it's only valid after completion of all export transforms, but not in between when we need the schema information)\r\n\r\nProposed strategy:\r\n\r\n- we only define TextureArticle schema\r\n- for custom elements we use Substance models directly (e.g. for our custom table model and things like affiliations, references etc. as we do now)\r\n- we keep the XML valid JATS at all times (e.g. interally we drop the ref-list since we have our own representation)\r\n- I'd even go so far that on import to remove the body element from the XML because then we can use regular substance container nodes and custom models for fig + table etc. without violating the JATS schema (it's fine to keep them XML nodes for now to satisfy the implementation but then we'd be free to use flat substance models everywhere in the future)\r\n- If we keep a reference to the original body node we could continue using el.find('') in subtrees etc.\r\n\r\n@oliver---- what do you think about that matter? Is there an incremental path towards reaching that design without breaking too much? I'd be crucial to have a plan for this soon, as with the more complex metadata we're blocked currently. and i don't want to base the code on static assumptions (like ensure we have one anchor element in article-meta which we can use to derive element positions). "},"comment":{"url":"https://api.github.com/repos/substance/texture/issues/comments/407151933","html_url":"https://github.com/substance/texture/issues/627#issuecomment-407151933","issue_url":"https://api.github.com/repos/substance/texture/issues/627","id":407151933,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNzE1MTkzMw==","user":{"login":"oliver----","id":284099,"node_id":"MDQ6VXNlcjI4NDA5OQ==","avatar_url":"https://avatars1.githubusercontent.com/u/284099?v=4","gravatar_id":"","url":"https://api.github.com/users/oliver----","html_url":"https://github.com/oliver----","followers_url":"https://api.github.com/users/oliver----/followers","following_url":"https://api.github.com/users/oliver----/following{/other_user}","gists_url":"https://api.github.com/users/oliver----/gists{/gist_id}","starred_url":"https://api.github.com/users/oliver----/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oliver----/subscriptions","organizations_url":"https://api.github.com/users/oliver----/orgs","repos_url":"https://api.github.com/users/oliver----/repos","events_url":"https://api.github.com/users/oliver----/events{/privacy}","received_events_url":"https://api.github.com/users/oliver----/received_events","type":"User","site_admin":false},"created_at":"2018-07-23T18:15:07Z","updated_at":"2018-07-23T18:15:07Z","author_association":"MEMBER","body":"First I agree with you that the more we deviate internally from JATS the more it does not make sense to try an inplace-DOM-transformation -- which I guess is causing more problems than we would like.\r\n\r\nBeyond that, I guess it might still be difficult with a Two-DOM (or model-to-DOM) conversion strategy -- because the target DOM (=JATS DOM) would still need to be in a valid state all the time.\r\n\r\nWhat we could try for export is, create a new minimal JATS DOM and generate into it. @michael would that help?"}}
{"actor":{"display_login":"oliver----"}}