Consider trying to insert a new line in the two cases:
"<line>This is a line of text. This is another line.</line>"
"<line></line>This is a line of text. This is another line."

In the first case the following operations would be required:
deleteElementStart("line")
deleteCharacters("This is a line of text. This is another line.")
deleteElementEnd()
elementStart("line")
characters("This is another line.")
elementEnd()
elementStart("line")
characters("This is another line.")
elementEnd()

In the second case all that's needed is:
retain(25)
deleteCharacters(" ")
elementStart("line")
elementEnd()
retain(21)

As for wave and XML, Wave needed to be able to represent structure as
well as plain text. So, some of the XML concepts (e.g. elements and
attributes) are used in wave. But, wave doesn't use actual XML syntax.
An element isn't actually encoded as XML elements (e.g. "<line>"), but
as a set of operations (see above for an example). The operations are
encoded in a binary format that, in the case of the Java
implementation, translate to a set of method calls on an interface.

The reason for not using straight HTML or XML text is that it's not
possible to resolve conflicts properly when using only text. The
structure in the content has to be managed explicitly by the protocol,
and that can't be done when the structure is in the text (e.g. XML).

On Sun, Nov 15, 2009 at 2:54 PM, Duke <[email protected]> wrote:
>
>
>
> On Oct 1, 11:36 pm, Tad Glines <[email protected]> wrote:
>
>> My comments on that section of the spec are more of a nit-pick anyway.
>> I understand why they chose to use "<line></line>text" instead of
>> "<line>text</line>". And, I'm assuming they used "<line/>" instead of
>> "<line></line>" in the spec because it looks cleaner. And reduces the
>> chances that someone will assume that "<line>text</line>" is ok.
>
> Tad, i hope you can help me, i'm trying to figure out the reason that
> have driven the design of the <line> tag.
> I really can't find the reason why it has been choosen to be "<line></
> line>text" instad of "<line>text</line>", as you appear to know the
> reason, or if anyone knows it, can you please explain me?
> i'm also confused by the fact that the Wave protocol is declared to be
> inspired by XML but it is not fully compliant.
> why that? XML works pretty well and is proven to be quite flexible,
> why we need to write a Wave parser when there are dozen of XML parser
> out there?
>
> Am i missing something?
>
> I'm very excited by Wave, but this two details sounds very strange to
> me so i'm afraid that i've really missed something
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Wave 
Protocol" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/wave-protocol?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to