Re: Fwd: A sort of synthesis

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