[l2h] Problems extending \HTMLcode generation

Ross Moore Ross Moore <ross@ics.mq.edu.au>
Mon, 7 Feb 2000 09:43:49 +1100 (EST)

> Hi anybody,
> I have sent this mail before but nobody answere. Since my problem didn't
> solve on its own, I am asking again for your help.

Sorry for not answering sooner Klaus;
other projects have been taking my time.

> <Object type="application/x-oleobject"
> classid="clsid:1e2a7bd0-dab9-11d0-b93a-00
> c04fc99f9e">
>         <param name="Keyword" value="another test">
> What I like to do is wite some perl code, which produces exactly this,
> when a LaTeX command like
> \tetIndex{test} \tetIndex{another test}
> is encountered.
> For LaTeX I have defined the command \tetIndex to work like \index
> For the HTML side I tried to use the command \HTMLcode
> \newcommand{\tetIndex}[1]{\latex{\index{#1}}%
> \html{\HTMLcode[TYPE="application/x-oleobject"
> CLASSID="clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e"]
> {OBJECT}{\HTMLcode[name=Keyword value="#1"]{PARAM}}}}

Do not rely on the ' ' (space) as a delimiter, when your strings
also contain " characters and = signs.
\HTMLcode parses its arguments to check validity.
Since space characters have a special meaning in TeX,
and it is rare in TeX to use space as a delimiter
of a list of items, then it is also dangerous to use it
this way in a complicated listing of arguments.

The following worked correctly for me:
(note the 2 commas added)


If the value for an attribute is a comma-separated list,
then make sure that list is quoted:  "..., ..., ... " .

Hope this helps,

	Ross Moore

BTW, make sure that you are using  -html_version 4.0
(else <OBJECT> is invalid).

The code that LaTeX2HTML uses for pattern-matches within
the arguments to \HTMLcode commands is at the beginning
of  $LATEX2HTMLDIR/versions/html4_0.pl .
For each tag, the valid attributes are given,
and for each tag/attribute combination, there is a regexp
to match valid data values.
Since most of these are similar, there are about a dozen
standard regexp patterns, and most tag/attribute refer to
these, rather than having a primitive specification.

It should not be difficult to extend that portion of Perl code
to cope with other DTDs. 

Oh, another thing:  my mailer has returned to the 21st century
now, I think. Please resond if it still giving an incorrect year.
Thanks to those who previously reported that problem. ;-)