My current project consists of letters which are in collections. Each collection has an id and the letters refer to these ids. Coming from the "TEI world", I thought it would be the best solution to do that with #:
<collection xml:id="1"/>
<letter is_included_in="#1"/>
I thought that is the usal and best way to do that and also intended by the XPointer standard.
Recently, I have learned there is a dt:type="idref" type in XML Schema to handle references to ids. This way it would be without the #.
So, I'm a little bit confused right now.
What is best pratice here and a the most semantic way to handle id references inside one xml document? Or, in other words: How would any human or non-human reader which doesn't know my XMl schema expect me to do this?
If you're developing a simple referencing scheme that does not have to make sub-references, I recommend that you do not pre-pend all references with hash characters (#
):
<collection xml:id="c1"/>
<letter is_included_in="c1"/>
@id
and @idref
match exactly.#
in a reference is used to precede a reference to a subpart. (See specifically the widely adopted standard use of hash marks in HTML @href
to introduce a fragment identifier to refer to a named part of an HTML page.) TEI and XPointer built upon this convention in URIs.