[Standards] XEP-0372 references pointing to different elements in same stanza

JC Brand lists at opkode.com
Wed Aug 25 14:13:55 UTC 2021

Hi all

I didn't get any response, so I've gone ahead and made an MR with the 
proposed changes in the previous email.



On 13.08.21 14:00, JC Brand wrote:
> Hi everyone
> In XEP-0372, when references are used for "mentions", there is an 
> implicit assumption that the referenced text is in the <body> tag.
> There are however other elements where mentions could also occur, such 
> as <subject>, <reason> and <text>, and some stanzas could have 
> multiple possible elements whose text might be referenced.
> XEP-0372 provides an "anchor" attribute for the <reference> tag, which 
> can be used to refer to other addressable entities, to handle the case 
> where the reference points to something in another stanza.
> I think this "anchor" attribute can also be used to disambiguate the 
> references in a stanza that has multiple text-containing elements. In 
> this case, instead of letting the anchor point to an XMPP URI, it 
> would only point to a fragment, meaning that the fragment is inside 
> the same stanza.
> In HTML the fragment of a URI points to an element with the same id 
> attribute value as the fragment itself, but apparently this isn't a 
> general requirement for URIs. In this case, for simplicity, I would 
> however stick to that convention.
> So, if you have a stanza with for example, both "subject" and "body" 
> tags, we can have references for both, and use the "anchor" attribute 
> as follows (I hope this comes out formatted properly once sent):
> <message type="headline" from="school at springfield.city">
>     <subject id="subject">Attention Bart Simpson</subject>
>     <body id="body">Please hand in your homework before the end of the 
> day</body>
>     <reference anchor="#subject" begin="9" end="21" type="mention"/>
> </message>
> I think this is an elegant solution that uses the existing mechanics, 
> and the only further requirement would be to clarify in the XEP that 
> the anchor attribute can be used in this way.
> I'd be happy to hear your thoughts and feedback.
> Regards
> JC

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.jabber.org/pipermail/standards/attachments/20210825/b73170cc/attachment.html>

More information about the Standards mailing list