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='[email protected]'> <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:[email protected]'> <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='[email protected]'> <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:[email protected]' 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
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Standards mailing list Info: http://mail.jabber.org/mailman/listinfo/standards Unsubscribe: [email protected] _______________________________________________
