[Standards] Proposed XMPP Extension: References

Florian Schmaus flo at geekplace.eu
Thu Feb 11 16:21:54 UTC 2016


On 11.02.2016 16:37, Edwin Mons wrote:
> On 11-02-16 15:53, Kevin Smith wrote:
>>> - how begin/end attributes work when there are several bodies ? e.g.: XHTML-
>>> IM: how to we references XHTML body ?
>> A reasonable question. What do people think?
> 
> Or worse, xml:lang alternatives.  I haven't thought of a reasonable
> solution, other than an XPath relative to the message element which
> would default to "body", but that might be a bit of a monster.

While being a potential solution, XPath appears to heavyweight to me.
Why not simply add three optional attributes (with sensible defaults)

- ref-element
- ref-xmlns
- ref-xmllang

to <reference/> in order to identify the element the reference belongs to?

I would eventually even refactor those together with begin and end into
a child element of <reference/>, to avoid some redundancy:

<message type='groupchat' to='balcony at muc.example.org'>
  <body xml:lang='en'>Good day, Juliet</body>
  <body xml:lang='de'>Guten Tag, Juliet</body>
  <reference xmlns='urn:xmpp:reference:0'
             type='mention'
             uri='xmpp:juliet at capulet.lit'>
    <element ref-element='body'
             ref-xmlns='jabber:client'
             ref-xmllang='en'
             begin='10'
             end='15'/>
    <element ref-element='body'
             ref-xmlns='jabber:client'
             ref-xmllang='de'
             begin='11'
             end='16'/>
  <reference/>
</message>

Or with all redundancy removed:

<message type='groupchat' to='balcony at muc.example.org'>
  <body xml:lang='en'>Good day, Juliet</body>
  <body xml:lang='de'>Guten Tag, Juliet</body>
  <reference xmlns='urn:xmpp:reference:0'
             type='mention'
             uri='xmpp:juliet at capulet.lit'
             ref-element='body'
             ref-xmlns='jabber:client'>
    <element ref-xmllang='en'
             begin='10'
             end='15'/>
    <element ref-xmllang='de'
             begin='11'
             end='16'/>
  <reference/>
</message>


- Florian


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 603 bytes
Desc: OpenPGP digital signature
URL: <http://mail.jabber.org/pipermail/standards/attachments/20160211/896146ba/attachment.sig>


More information about the Standards mailing list