[XML-SIG] Re: sgmllib has problems with dots in tag names (XML-SIG digest, Vol 1
Mon, 19 Jul 1999 10:17:54 +0200
This is a multi-part message in MIME format.
Content-Type: text/plain; charset=us-ascii
> That's a solution that works with the standard sgmllib from the Python
> distribution. However this solution does not work with sgmllib from
> xml.parsers. I'm not sure if tag names with dots in their names are valid in XML
> or not.
> If you want callbacks named after element types, then there is no way
> out other than to do some name mangling. There are lots of characters
> valid in SGML/XML element type names that are not legal in function/method
> names. Characters like "-" and "." are popular ones:-)
As anyone with a Web browser can verify, version 1.0 of the XML standard
a name (appearing in a start tag or end tag, for example) as "a token
beginning with a letter or one of a few punctuation characters, and
with letters, digits, hyphens, underscores, colons, or full stops,
It is natural to use the element name or tag name as the default name
to generate a function or method name. But in cases where the name space
of the programming language used is not identical to the name space of
XML, some escape mechanism must be in place. One possibility is to
allow the user to specify a map from XML name to function/method name,
and use the value from this map, if it exists, and otherwise use the
default based on the XML name.
Content-Type: text/x-vcard; charset=us-ascii;
Content-Description: Card for N.A.F.M. Poppelier
adr:;;Villawal 21;Nieuwegein;;;The Netherlands
title:project manager SGML/XML
note;quoted-printable:''The new pond=0D=0AA frog jumps in=0D=0ADeadly silence''