[XML-SIG] sgmllib has problems with dots in tag names

Sean Mc Grath sean@digitome.com
Fri, 16 Jul 1999 12:45:39 +0100


At 12:52 16/07/99 +0200, you wrote:
>The SGML parsers from the standard sgmllib and the XML sgmllib war both
>unable to parse SGML tags with dots in the tag name like <TI.DOC>. The 
>parsers callback functions only get the first part of the tag name (before
>the dot) as argument (in this case 'TI'). Because the tags are valid SGML
>tags this is a bit annoying. Ok, one could get a workaround by replacing
>all dots in tags with an underscore however that's not a clean solution :-)
>
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:-)

The SAX way is to have a generic element handler to which the
element type name is passed as a String. This gets round the
problem but is sooooo much less convenient than the element
specific callback approach.

<Sean URI="http://www.digitome.com/sean.html">
Developers Day Co-Chair, 9th International World Wide Web Conference
16-19, May, 2000, Amsterdam, The Netherlands http://www9.org
</Sean>