help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sgml-validate


From: William F Hammond
Subject: Re: sgml-validate
Date: Wed, 16 Feb 2011 19:56:00 -0500
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.4 (usg-unix-v)

>> onsgmls is a very reliable tool.  In general, however, it requires
>> complicated command lines.
>
> Agreed.  I have given up since I was not able to figure out how to have
> it "not validate" and xmllint has that ability.  The validation adds
> minutes to the test so needs to be used sparingly.

If it's adding minutes, then it's probably because external entities
are being loaded from across the network.  With most tools there are
ways to avoid this, and one should avoid it.

For a non-validating parse with onsgmls use something like this shell
script:

------
#!/bin/sh
# interface to "onsgmls" for non-validating XML parse
pname=`basename "$0"`
SP_CHARSET_FIXED=YES
export SP_CHARSET_FIXED
SP_ENCODING=XML
export SP_ENCODING
SGML_CATALOG_FILES=/usr/local/xml/pubtext/myFavoriteCatalog
export SGML_CATALOG_FILES
if [ -f "$1" -a -r "$1" ] ; then
  fname="$1"
else
  fname="${1}.xml"
fi
if [ -f "$fname" ] ; then
  onsgmls -wxml -wno-valid -c "$SGML_CATALOG_FILES" "$fname"
else
  echo "${pname}: Cannot find $fname"
fi
------

For a non-validating parse the specified catalog should contain
the line

SGMLDECL "xml.dcl"

where "xml.dcl" is James Clark's sgml declaration for xml, usually
distributed with opensp, which should be located parallel to the
catalog or else referenced in the catalog with a pathname relative to
the location of the catalog.

> The only annoyance is that xmllint keeps telling me that
> ≥ et al are not valid entities.

Correct.  The only such entities that are available by default are
'&amp;' for '&', '&lt;' for '<', annd '&gt;' for '>'.

Something like '&ge;' (which I imagine to be U-2265, "greater than or
equal to") can be defined for in-house use but will not work well
across the network.  For publication on the network use the character
itself if the XML instance is given a suitable content-encoding, e.g.,
utf-8, or use '&#x2265;'.

                                    -- Bill



reply via email to

[Prev in Thread] Current Thread [Next in Thread]