Subject: Re: CVS commit: htdocs/guide/en
To: None <mishka@apk.od.ua>
From: Hiroki Sato <hrs@NetBSD.org>
List: netbsd-docs
Date: 05/06/2005 02:26:24
----Security_Multipart(Fri_May__6_02_26_24_2005_258)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
"Mike M. Volokhov" <mishka@apk.od.ua> wrote
in <20050505165459.484d3fc1.mishka@apk.od.ua>:
mi> On Thu, 5 May 2005 12:21:23 +0000 (UTC)
mi> Hiroki Sato <hrs@NetBSD.org> wrote:
mi>
mi> [snip commit messages]
mi> > XML markup police:
mi> > - normalize indent and whitespaces.
mi> > - remove trailing-whitespaces.
mi>
mi> Hiroki-san,
mi>
mi> How do you done XML normalization? Is this was powered by some tools or
mi> it was achieved by hand work?
Unfortunately, some are by psgml-mode and some are by hand.
The most part of the indent normalization is done by psgml-mode and
an additional function like this:
(defun sgml-normalize-buffer ()
""
(interactive)
(beginning-of-buffer)
(delete-trailing-whitespace)
(while (not (eobp))
(beginning-of-line)
(if (not (looking-at "^$"))
(let ((elem (split-string (funcall sgml-show-context-function (sgml-last-element)) " *in +"))
(elem-found 0))
(while elem
(if (or (string= (car elem) "PROGRAMLISTING")
(string= (car elem) "SCREEN")
(string= (car elem) "LITERALLAYOUT"))
(setq elem-found 1))
(setq elem (cdr elem)))
(if (= elem-found 0)
(sgml-indent-or-tab))))
(forward-line 1)))
The newline and whitespace normalization can partially be done by
xmlformat but needs some additional tweaks by hand because xmlformat
cannot control line-breaks of inline element and indentation of
#PCDATA.
--
| Hiroki SATO
----Security_Multipart(Fri_May__6_02_26_24_2005_258)--
Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (FreeBSD)
iD8DBQBCeldATyzT2CeTzy0RAqNeAJ9KJMmaKco10L4HFplAyFaFPJyn/wCgpojV
REUeJCZPhieu2FEuqYosJ+8=
=AOvx
-----END PGP SIGNATURE-----
----Security_Multipart(Fri_May__6_02_26_24_2005_258)----