Open obuchtala opened 5 years ago
@oliver---- Can you elaborate on why you'd need to retain the id of the paragraph element? In eLife JATS XML and other examples I've seen, <p>
always exists without an id attribute even when there are many of them present in a section or caption.
Thanks,
James
Yeah, that is a bit of a special problem in editor land.
While in a single user case, it would be ok to omit all ids, and only retain those necessary for xref'ing, we always have collaboration features on the radar, too.
The premise is, if two users opened the same document, they should see the same internal ids, so that their changes can be tracked robustly. The order of elements like in an xpath ...fig/caption/p[0]
is unfortunately dangerous, as position can change due to insertion of new elements, and if two users created 'p[1]' (a second paragraph) at the same time, then there would be a collision of ids.
Ah, that makes sense. Thanks!
I don't imagine these ids would cause problems elsewhere but it might be something to account for when converting the XML for different endpoints e.g. PMC.
James
Yeah, then we can drop a lot of these ids.
This will be done in the 'Translation Layer'
ATM, we generate a lot of ids, where some of them are not necessary, because the element is uniquely identified by the context. Beyond that, Texture uses ids internally very extensively to 'route' changes to the correct place in the document. When loading or generating JATS, some of the ids could be omitted.
Example:
For most elements inside a
<fig>
we could omit the id (label, title, graphic). Only paragraphs need an id, because there could be more of them. Internally, during import the uniquely identified elements would get a derived id, such asfig1-title
.