W3C home > Mailing lists > Public > public-change@w3.org > March 2013

Re: Fwd: A sort of synthesis

From: Liam R E Quin <liam@w3.org>
Date: Wed, 27 Mar 2013 20:35:44 -0400
To: Casey Jordan <casey.jordan@jorsek.com>
Cc: dennis.hamilton@acm.org, "public-change@w3.org" <public-change@w3.org>
Message-ID: <1364430944.17360.69.camel@localhost.localdomain>
On Mon, 2013-03-11 at 15:53 -0400, Casey Jordan wrote:
[...]
> Take for instance this document:
> 
> <topic>
> <title><b>Hello</b> everyone!</title>
> 
> </topic>
> 
> Given any tree structure we could represent a range in the with a pair of
> locations (start, end) and offsets. The node would be indicated by a
> position vector, and the offset by the caret placement in that node.

This is sometimes called a "tumbler"; there's also an XPointer scheme
for them.

> 
> Consider indicating that someone selected and deleted "Hello everyone!".
> The range would be:
> (Start: [0.0.0.0, 0], End [0.0.1, 10])

There's a number of difficulties with this approach. The biggest is that
<topic><title><b>Hello</b> everyone!</title></topic>
is likely to be the "same" document - whitespace between element nodes
is always a problem with markup like XML, HTML and SGML.

The next biggest is that it's not robust.
If you used
<delete start="/topic/title/char(1)" end="/topic/title/char(-1)" />
then you get the right result if the document was changed to
<topic>
  <name>Example</name>
  <title><b>Hello</b> everyone!</title>
</topic>

It's not perfect but it's massively better, and massively better but not
perfect is, we should recall, how the Web succeeded :)

Best,

Liam

-- 
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/
Ankh: irc.sorcery.net irc.gnome.org freenode/#xml
Received on Thursday, 28 March 2013 00:35:54 UTC

This archive was generated by hypermail 2.3.1 : Thursday, 28 March 2013 00:35:54 UTC