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

Florian Schmaus flo at geekplace.eu
Thu Sep 9 17:04:54 UTC 2021


On 13/08/2021 14.00, JC Brand wrote:> <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>

Why is there a number sign ('#') before the element name? What if there 
is another first-level stanza child element with a local name 'subject' 
but a different namespace?

I am happy to ignore the existence of xml:lang for now, but I think the 
'anchor' attribute value should be specified to be either in Clark 
notation, or, if not, reference first-level stanza child elements by 
their localname with the same namespace as the stanza. So your example 
becomes

<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>

and, in case of a theoretical <subject xmlns='foo'> element.

<message type="headline" from="school at springfield.city">
     <subject xmlns='foo' id="subject">Attention Bart Simpson</subject>
     <body id="body">Please hand in your homework before the end of the 
day</body>
     <reference anchor="{foo}subject" begin="9" end="21" type="mention"/>
</message>

- Florian

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 495 bytes
Desc: OpenPGP digital signature
URL: <http://mail.jabber.org/pipermail/standards/attachments/20210909/33054fb7/attachment.sig>


More information about the Standards mailing list