W3C home > Mailing lists > Public > public-change@w3.org > August 2014

Re: Change tracking processing instructions and deletion

From: Claudius Teodorescu <claudius.teodorescu@gmail.com>
Date: Thu, 28 Aug 2014 19:49:55 +0300
Message-ID: <CAPTZ0Vw9DqXtZwMBVbUkmOH6_zBNRC30vfFWtBakE8xW=w-0SQ@mail.gmail.com>
Cc: "public-change@w3.org" <public-change@w3.org>

It is very nice to see PIs used to track changes. Last year, when I mention
PIs as a method for track changes, on this list, I had no clue they were

As to syntax for effectively track changes, why not use XQuery Update?

Your example would become:

<?change user="nigel" time="2014-08-27 15:12:00" change="delete node
//p[1]" ?>

for example.

Another example

<?change user="nigel" time="2014-08-27 15:12:00" change="insert node <p
xml:lang="en">Hello World</p> into //body" ?>.

Thus, it is plain what p element was deleted (as the respective XPath
expression identifies it clearly for the respective version of document)

The only overhead is that the deleted content has to be stored, too, in
order to revert the changes, etc.


On Wed, Aug 27, 2014 at 5:59 PM, Nigel Whitaker <nigel.whitaker@deltaxml.com
> wrote:

> Hello everyone,
> There's an aspect of the existing change tracking PIs that are used in a
> number of systems that I've often wondered about:
> The PIs that are used follow the convention of using an attribute-like
> syntax.  Its a convention that's been adopted for standard PIs such as
> xml-stylesheet and xml-model.
> While its a convention, the XML spec itself doesn't say a lot about what
> you can/can't do in a PI
> When content including elements and attributes is deleted in change
> tracking systems the content is typically escaped so that its a legal
> attribute.
> Suppose I was to delete this paragraph:  <p xml:lang="en">Hello World</p>
> We may see something like this (I'm generalising from what I've seen in a
> number of systems):
> <?change user="nigel" time="2014-08-27 15:12:00" delete="&lt;p
> xml:lang=&quot;en&quot;&gt;Hello World&lt;/p&gt;" ?>
> The angle brackets and quotes have been 'escaped' to make it a legal
> attribute.  I've got code to deal with this process, but I do wonder if its
> necessary and if things could be simplified?
> If we don't use attributes we could perhaps do this:
> <?change
>   <delete>
>     <dc:creator>nigel</dc:creator>
>     <dc:time>2014-08-27 15:12:00</dc:time>
>     <deletedContent><p xml:lang="en">Hello World</p></deletedContent>
>   </delete>
> ?>
> The pseudo-attribute based representation is more compact for small cases
> certainly, but if there's a large amount of deleted content then the size
> needed for escaping grows.
> And with the XPath3/XLST3 parse/serialize functions coming soon (and
> saxon:parse()) would an 'element based PI'  be easier for new-comers to
> read and process?  And perhaps there could be a convention of using a .xsd
> or .rng grammar to specify the PI content.
> It's not a big issue for me - I've written the code for handling the
> escaping, but I've often wondered if things could be easier.
> I wonder if there are any advantages to the attribute like notation, other
> than its a convention that's always been followed.  Does anyone know the
> history here?
> Thanks,
> Nigel
> --
> Nigel Whitaker - DeltaXML Ltd - nigel.whitaker@deltaxml.com

Received on Thursday, 28 August 2014 16:50:27 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:11:22 UTC