Rather than
<!ELEMENT BIDI - - (%text)+>
<!ATTLIST BIDI
%attrs;
force (ltr|rtl) #IMPLIED
dir (ltr|rtl) #IMPLIED
>
We would need something like:
<!ATTLIST BIDI
%attrs;
force (left|right) #IMPLIED
dir (ltr|rtl) #IMPLIED
>
Alternatively, we could have two new element types:
<!ELEMENT (BIDIEMB|BIDIOVR) - - (%text)+>
<!ATTLIST (BIDIEMB|BIDIOVR)
%attrs;
dir (ltr|rtl) #IMPLIED
>
However, this last would be problematic in terms of using
shortrefs to translate &#PDF; to an end tag. In this case
we would have to use either USEMAP or use minimized end tags
as follows:
(1) using usemap
<!ENTITY lretag "<BIDIEMB DIR=LTR>" >
<!ENTITY rletag "<BIDIEMB DIR=RTL>" >
<!ENTITY lrotag "<BIDIOVR DIR=LTR>" >
<!ENTITY rlotag "<BIDIOVR DIR=RTL>" >
<!ENTITY embtag "</BIDIEMB>" >
<!ENTITY ovrtag "</BIDIOVR>" >
<!SHORTREF bidi "&#LRE;" lretag
"&#RLE;" rletag
"&#LRO;" lrotag
"&#RLO;" rlotag
>
<!SHORTREF emb "&#PDF;" embtag >
<!SHORTREF ovr "&#PDF;" ovrtag >
<!USEMAP emb lretag >
<!USEMAP emb rletag >
<!USEMAP ovr lrotag >
<!USEMAP ovr rlotag >
(2) using minimized end tag
<!ENTITY lretag "<BIDIEMB DIR=LTR>" >
<!ENTITY rletag "<BIDIEMB DIR=RTL>" >
<!ENTITY lrotag "<BIDIOVR DIR=LTR>" >
<!ENTITY rlotag "<BIDIOVR DIR=RTL>" >
<!ENTITY pdftag "</>" >
<!SHORTREF bidi "&#LRE;" lretag
"&#RLE;" rletag
"&#LRO;" lrotag
"&#RLO;" rlotag
"&#PDF;" pdftag
>
Given that few HTML parsers support shortref/usemap and/or minimized
end tags, both of the latter are unattractive options. [Though I wouldn't
have any problems with either of these in our parser.]
Glenn