Subversion and other updates

Volume 8, Issue 16; 09 Feb 2005; last modified 08 Oct 2010

A random assortment of updates and announcements.

A few days ago, I decided to bite the bullet and convert the repository that sits behind this site from CVS to Subversion. I did this “by hand,” not using any CVS to Subversion conversion script.

I've been wanting to play with Subversion for a while and I specifically wanted to take advantage of the ability to create a “pre-commit” hook in Subversion to enforce additional constraints on all my essays. In particular, that they be not only valid but also have IDs on all the paragraphs. I've been forgetting to put IDs on the paragraphs and it's been bugging me. Now I can't forget anymore.

In other news:

  • I published DocBook NG: The “IPA” Release yesterday. And at the same time, I updated the schema for essays on this site to be a customization of the IPA release and updated all of the essays to conform to it.

  • The DocBook Open Repository Team published V1.68.0 of the DocBook XSL Stylesheets.

  • The Candidate Recommendation draft of xml:id was published on Tuesday, just moments before a storm of controversy erupted. Oh, joy! Maybe the TAG can fix it.

  • I have updated the Atom feeds from this site to conform to Version 05 of the Atom Format Specification.

Needless to say, if anyone notices something that I've broken, please report it.

Comments

What will happen when you need to insert a paragraph? Or delete? Will al unique links shift or stay the same?

—Posted by Anne on 10 Feb 2005 @ 11:48 UTC #

Adding a new paragraph won't change any of the existing IDs. The ID-generating code just adds a new one. Deleting a paragraph would remove its ID, but I'll probably avoid deleting paragraphs for that reason. FWIW, here's my current hack for adding IDs:

 (defun blog:idparas () 
  (interactive)
  (save-excursion
    (let ((paracount 0)
	  (paraid 0))
      (beginning-of-buffer)
      (re-search-forward "\/info\\|\/essayinfo" nil t nil)
      (while (re-search-forward "\\|]*\\)>"
				nil t nil)
	(if (match-string 3)
	    (let ((attributes (match-string 3)))
	      (if (string-match " id=[\"\']\\([^\"\']+\\)[\"\']" attributes)
		  (let ((id (match-string 1 attributes)))
		    (if (string-match "^p\\([0-9]+\\)$" id)
			(let ((idnum (string-to-number (match-string 1 id))))
			  (if (> idnum paraid)
			      (setq paraid idnum)))))))))
      (setq paraid (+ paraid 1))
      (beginning-of-buffer)
      (re-search-forward "\/info\\|\/essayinfo" nil t nil)
      (while (re-search-forward "\\|]*\\)>"
				nil t nil)
	(if (or (not (match-string 3))
		(not (string-match " id=[\"\']\\([^\"\']+\\)[\"\']" (match-string 3))))
	    (progn
	      (forward-char -1)
	      (insert (format " id='p27" paraid))
	      (setq paracount (+ paracount 1))
	      (setq paraid (+ paraid 1)))))
      (message (format "Inserted IDs" paracount)))))(defun blog:idparas () 
  (interactive)
  (save-excursion
    (let ((paracount 0)
	  (paraid 0))
      (beginning-of-buffer)
      (re-search-forward "\/info\\|\/essayinfo" nil t nil)
      (while (re-search-forward "\\|]*\\)>"
				nil t nil)
	(if (match-string 3)
	    (let ((attributes (match-string 3)))
	      (if (string-match " id=[\"\']\\([^\"\']+\\)[\"\']" attributes)
		  (let ((id (match-string 1 attributes)))
		    (if (string-match "^p\\([0-9]+\\)$" id)
			(let ((idnum (string-to-number (match-string 1 id))))
			  (if (> idnum paraid)
			      (setq paraid idnum)))))))))
      (setq paraid (+ paraid 1))
      (beginning-of-buffer)
      (re-search-forward "\/info\\|\/essayinfo" nil t nil)
      (while (re-search-forward "\\|]*\\)>"
				nil t nil)
	(if (or (not (match-string 3))
		(not (string-match " id=[\"\']\\([^\"\']+\\)[\"\']" (match-string 3))))
	    (progn
	      (forward-char -1)
	      (insert (format " id='p27" paraid))
	      (setq paracount (+ paracount 1))
	      (setq paraid (+ paraid 1)))))
      (message (format "Inserted IDs" paracount)))))

I think I'd rather do that with XSLT, but I haven't bothered to get that working just yet.

—Posted by Norman Walsh on 10 Feb 2005 @ 12:28 UTC #

Except, of course, "id=" in that code should now be "xml:id=". For the time being, at least.

—Posted by Norman Walsh on 10 Feb 2005 @ 12:59 UTC #

Hmm, I hope they are not going to change it to xmlid just because some specfication is flawed. The discussion it generates on www-tag is interesting though. Especially about other specifications introducing backwards incompatible changes in the new namespace. (As far as I understand it.)

—Posted by Anne on 10 Feb 2005 @ 02:32 UTC #

I hope so too. Alas, I don't expect the TAG to get a chance to discuss it before the 21st and perhaps not before the plenary.

—Posted by Norman Walsh on 10 Feb 2005 @ 03:04 UTC #

The comments feeds have now been upgraded to Atom Format 05 too.

—Posted by Norman Walsh on 14 Feb 2005 @ 02:15 UTC #