Hi Jonas

On 31.08.21 17:23, Jonas Schäfer wrote:
Hi JC,

This has somehow slipped past me.

Thanks for taking the time to respond.

On Freitag, 13. August 2021 14:00:06 CEST JC Brand wrote:
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="sch...@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>
What about messages with multiple <body/> elements disambiguated by xml:lang?
Could some conceivably contain a mention while others don't? Does this require
replicating the mention element all over? Same question for <subject/>.
This is another currently ambiguous and undefined use-case that I think can be solved with my proposal. As the XEP currently stands, there's no documented way to distinguish between multiple <body/> (or <subject/>) elements.

Going with my proposal, the solution would be to have a separate <reference/> element for each <body/>. The mention parameters ("begin", "end") will be different for each <body/> since the mentioned text usually won't be in the exact same place for the different translations.

The "id" attribute can have any value, it doesn't have to be "body" or "subject", those were just examples.

Besides that, I don't think that adding an attribute to an element in this way
is really acceptable.

I would prefer an approach which identifies the XML element without having to
modify the XML being referenced.
The only mechanism that doesn't require modifying the referenced elements that I can think of is XPath.

My example then becomes:

<message type="headline" from="sch...@springfield.city">
     <subject xml:lang="en">Attention Bart Simpson</subject>
     <subject xml:lang="af">Aandag Bart Simpson</subject>
     <body xml:lang="en">Please hand in your homework before the end of the 
day</body>
     <body xml:lang="af">Handig asseblief jou huiswerk in voor die einde van die 
dag</body>
     <reference anchor="/message/subject[@xml:lang='en']" begin="9" end="21" 
type="mention"/>
     <reference anchor="/message/subject[@xml:lang='af']" begin="6" end="18" 
type="mention"/>
 </message>

Regards
JC


Libraries which currently represent body as a
(mappnig of language tags to) string(s) would now need extra magic in order to
be able to set ID attributes on those. This feels like a quite major change,
and not just to References, but to literally everything else.

kind regards,
Jonas

    [1]: https://www.w3.org/TR/REC-xml/#id

_______________________________________________
Standards mailing list
Info: https://mail.jabber.org/mailman/listinfo/standards
Unsubscribe: standards-unsubscr...@xmpp.org
_______________________________________________

Reply via email to