[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Proposed new XML format

From: Greg Hudson <ghudson_at_mit.edu>
Date: 2000-10-03 19:05:39 CEST

(It turns out Branko's DTD had a way of transmitting ancestor
information which I hadn't noticed, incidentally. Still not sure how
the current XML format transmits directory entry properties.)

Here is a DTD and sample delta in my new proposed non-hierarchical
format. Having to follow IDs around isn't as readable as being able
to see the hierarchy of changes, but this way is a lot more flexible.
(Plus, it doesn't run off the right side of the screen. :) )

<?xml version="1.0" encoding="UTF-8"?>
<!-- XML DTD for Subversion's delta packages. -->

<!ELEMENT delta-pkg (replace-root | delete | add-dir | replace-dir
                     | change-dir-prop | change-dirent-prop | close-dir
                     | add-file | replace-file | text-delta | change-file-prop
                     | close-file)*>

<!-- replace-root: specify ID of root directory -->
<!ELEMENT replace-root>
<!ATTLIST replace-root
 dir-id ID #REQUIRED
>

<!-- delete-dirent: delete a directory entry -->
<!ELEMENT delete-dirent>
<!ATTLIST delete-dirent
 parent-id IDREF #REQUIRED
 name CDATA #REQUIRED
>

<!-- add-dir: Create a new directory -->
<!ELEMENT add-dir>
<!ATTLIST add-dir
 parent-id IDREF #REQUIRED
 name CDATA #REQUIRED
 dir-id ID #REQUIRED
 ancestor CDATA #IMPLIED
 ancver CDATA #IMPLIED
>

<!-- replace-dir: Modify a directory -->
<!ELEMENT replace-dir>
<!ATTLIST replace-dir
 parent-id IDREF #REQUIRED
 name CDATA #REQUIRED
 dir-id ID #REQUIRED
 ancestor CDATA #IMPLIED
 ancver CDATA #IMPLIED
>

<!-- change-dir-prop: Edit the properties of a directory -->
<!ELEMENT change-dir-prop (set | delete)+>
<!ATTLIST change-dir-prop
 dir-id IDREF #REQUIRED
>

<!-- change-dirent-prop: Edit the properties of a directory entry -->
<!ELEMENT change-dirent-prop (set | delete)+>
<!ATTLIST change-dirent-prop
 dir-id IDREF #REQUIRED
 name CDATA #REQUIRED
>

<!-- close-dir: Indicate that we are done with a directory -->
<!ELEMENT close-dir>
<!ATTLIST close-dir
 dir-id IDREF #REQUIRED
>

<!-- add-file: Create a new file -->
<!ELEMENT add-file>
<!ATTLIST add-file
 dir-id IDREF #REQUIRED
 name CDATA #REQUIRED
 file-id ID #REQUIRED
 ancestor CDATA #IMPLIED
 ancver CDATA #IMPLIED
>

<!-- replace-file: Modify a file -->
<!ELEMENT replace-file>
<!ATTLIST replace-file
 dir-id IDREF #REQUIRED
 name CDATA #REQUIRED
 file-id ID #REQUIRED
 ancestor CDATA #IMPLIED
 ancver CDATA #IMPLIED
>

<!-- text-delta: Edit the text of a file -->
<!ELEMENT text-delta (#PCDATA)>
<!ATTLIST text-delta
 file-id IDREF #REQUIRED
>

<!-- change-file-prop: Edit the properties of a file -->
<!ELEMENT change-file-prop (set | delete)+>
<!ATTLIST change-file-prop
 file-id IDREF #REQUIRED
>

<!-- close-file: Indicate that we are done with a file -->
<!ELEMENT close-file>
<!ATTLIST close-file
 file-id CDATA #REQUIRED
>

<!-- set: Set a property's value -->
<!ELEMENT set (#PCDATA)>
<!ATTLIST set
 name CDATA #REQUIRED
>

<!-- delete: Delete a property -->
<!ELEMENT delete EMPTY>
<!ATTLIST delete
 name CDATA #REQUIRED
>

<?xml version="1.0" encoding="UTF-8"?>
<delta-pkg>
  <replace-root dir-id="ROOT"/>
  <add-dir parent-id="ROOT" name="A" dir-id="D1" ancestor="/A" ancver="1"/>
  <add-file dir-id="D1" name="mu" file-id="F1" ancestor="/A/mu"/>
  <text-delta file-id="F1">This is the file 'mu'.</text-delta>
  <close-file file-id="F1"/>
  <add-dir parent-id="D1" name="B" dir-id="D2" ancestor="/A/B"/>
  <add-file dir-id="D2" name="lambda" file-id="F2" ancestor="/A/B/lambda"/>
  <text-delta file-id="F1">This is the file 'lambda'.</text-delta>
  <close-file file-id="F2"/>
  <add-dir parent-id="D2" name="E" dir-id="D3" ancestor="/A/B/E"/>
  <change-dir-prop dir-id="D3">
    <set name="car">buick</set>
  </change-dir-prop>
  <close-dir dir-id="D3"/>
  <add-dir parent-id="D2" name="F" dir-id="D4" ancestor="/A/B/F"/>
  <change-dir-prop dir-id="D4">
    <delete name="glub"/>
  </change-dir-prop>
  <close-dir dir-id="D4"/>
  <close-dir dir-id="D2"/>
  <add-dir parent-id="D1" name="C" dir-id="D5" ancestor="/A/C"/>
  <close-dir dir-id="D5"/>
  <add-dir parent-id="D1" name="D" dir-id="D6" ancestor="/A/D"/>
  <add-file dir-id="D6" name="gamma" file-id="F3" ancestor="/A/D/gamma"/>
  <change-file-prop file-id="F3">
    <set name="banana">yellow</set>
    <delete name="lemon"/>
    <set name="crabgrass">epistemological</set>
  </change-file-prop>
  <text-delta file-id="F3">This is the file 'gamma'.</text-delta>
  <close-file file-id="F3"/>
  <close-dir dir-id="D6"/>
  <close-dir dir-id="D1"/>
  <close-dir dir-id="ROOT"/>
</delta-pkg>
Received on Sat Oct 21 14:36:10 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.