[XML-SIG] XBEL DTD

Marc van Grootel bwaumg@urc.tue.nl
Wed, 09 Sep 1998 22:31:11 +0200


Hi,


For the purpose of discussion I added my attempt
at what is dubbed the XBEL DTD.

I took Mark Hammond's as a starting point.

I scoped it a little wider and included most features
of the Netscape bookmark format. Between MSIE and NS
the latter offers more and the bookmark organizer is
much much better. When a user saves a bookmark file
to XBEL I think it should be possible to convert it 
back to Netscape without much loss of data. Although 
this useless fun thing started with Mark's idea for
the MS favourites I would like the DTD to be able to
express the NS format too (dunno about the
Opera bookmark format).

Here are most of the changes with Mark's initial DTD:

- optional 'folded' attribute (to restore the state of a folder NS)
- optional description element for 'folder' and 'bookmark' elements (NS)
- added 'id' attribute to 'folder' and 'bookmark'
- added 'alias' element with 'ref' attribute to reference bookmarks
  (NS) maybe this can be implemented with shortcuts on MS Favourites?
- simplified the top level to (info,folder)
- changed 'name' into 'title' and made it a required element
- put all timestamps in attributes (where 'added' belongs to
  'bookmark' and the other to the 'url')
- no dates only timestamps (more precise and all these attributes
  can be treated with the same code)
- optional 'separator' element (not very useful but NS uses it in it's
  menu's)
- added 'added' timestamp attribute for folders too
- added link checking attributes to 'url' element (MSIE offers the
  possibility to subscribe and notify you of changes so we need the
  last checked time and status code)

Some other issues:

- Are duplicate names/titles allowed? Since Favourites use the
  filename they are restricted in characters/length it is also not
  possible to have duplicate names (there is no way the parser could
  check for this).
- Should the folder hierarchy be a forest or a tree. In NS the
  top level can have a description and title instead of adding these
  to the xbel element using (info,folder) or (info?,folder) lets
  the folder element itself take care of that. 
- The visited, modified, etc attributes belong to the url not
  to the bookmarks itself. The added attribute belongs to the
  bookmark element

As I said this is for discussion. I looked at it mainly from the
modelling side and did not consider implementation in any of the
Python XML parsers.

---
Marc
bwaumg@urc.tue.nl


Here's the DTD:

================ snip snip snip ==================

<!ELEMENT xbel     (info, folder)>
<!ATTLIST xbel
            version    CDATA   #IMPLIED
>

<!-- contents of info needs some more thought. Adding a meta    -->
<!-- element (like in HTML) makes this open-ended               -->

<!ELEMENT info    (owner,machinename)>
<!ELEMENT owner       (#PCDATA)>
<!ELEMENT machinename (#PCDATA)>


<!ELEMENT folder   (title, desc?, (bookmark|folder|separator|alias)+)>
<!ATTLIST folder
            id       ID       #IMPLIED
            added    CDATA    #IMPLIED 
            folded   (yes|no) 'yes'
>

<!ELEMENT bookmark (title,desc?,url)>
<!ATTLIST bookmark
            id       ID       #IMPLIED
            added    CDATA    #IMPLIED
>

<!ELEMENT title      (#PCDATA)>
<!ELEMENT desc       (#PCDATA)>
<!ELEMENT url        (#PCDATA)>
<!ATTLIST url
            visited  CDATA    #IMPLIED
            modified CDATA    #IMPLIED
            response CDATA    #IMPLIED
            checked  CDATA    #IMPLIED
>


<!ELEMENT separator EMPTY>

<!ELEMENT alias EMPTY>
<!ATTLIST alias
            ref       IDREF    #REQUIRED  
>