Validating docbook articles...
Chuck Swiger
chuck at pkix.net
Mon Feb 16 21:30:04 UTC 2004
Ceri Davies wrote:
> On Tue, Jan 20, 2004 at 07:12:50PM -0500, Chuck Swiger wrote:
[ ...questions about validating articles... ]
> If I recall correctly, DocBook actually does generate them in lower
> case, and then the W3C's tidy changes them to uppercase, which seemed
> rather perverse to me. It's been some time since I looked at this
> though, so I could be mistaken.
A quick test (replacing tidy with /bin/cat) suggests that attributes are being
generated in uppercase, although I would agree with you that tidy ought to do
something when working in -asxml mode. :-)
For what it's worth, there's a new version of W3C tidy which does generate the
attributes in lower case and when used with docproj articles will validate
properly. The www/tidy-devel port isn't quite a drop-in workaround, because:
[ ... ]
/usr/local/bin/tidy -wrap 90 -m -raw -preserve -f /dev/null -asxml article.html
HTML Tidy: unknown option: p
HTML Tidy: unknown option: r
HTML Tidy: unknown option: s
HTML Tidy: unknown option: r
HTML Tidy: unknown option: v
*** Error code 1 (ignored)
...tidy-devel doesn't understand the -preserve option. Something like the
following, as www/tidy-devel/files/patch-console-tidy.c:
--- console/tidy.c_orig Mon Feb 16 16:17:54 2004
+++ console/tidy.c Mon Feb 16 16:21:29 2004
@@ -440,6 +440,9 @@
if ( strcasecmp(arg, "xml") == 0)
tidyOptSetBool( tdoc, TidyXmlTags, yes );
+ else if (strcmp(arg, "preserve") == 0);
+ /* no-op for backwards compatibility */
+
else if ( strcasecmp(arg, "asxml") == 0 ||
strcasecmp(arg, "asxhtml") == 0 )
{
...seems to do the trick.
--
-Chuck
More information about the freebsd-doc
mailing list