* Handle xml/xhtml style empty tags by emitting a pair of StartElement/EndElement events with

correct tag name.

Slightly modified patch from Marco van de Voort, resolves #13409.

git-svn-id: trunk@13047 -
This commit is contained in:
sergei 2009-04-26 17:56:21 +00:00
parent b02aededf8
commit b9ad8e3755

View File

@ -380,11 +380,20 @@ begin
if Length(TokenText) > 0 then
begin
Attr := nil;
if TokenText[1] = '/' then
if TokenText[Length(fTokenText)]='/' then // handle xml/xhtml style empty tag
begin
setlength(fTokenText,length(fTokenText)-1);
// Do NOT combine to a single line, as Attr is an output value!
TagName := SplitTagString(TokenText, Attr);
DoStartElement('', TagName, '', Attr);
DoEndElement('', TagName, '');
end
else if TokenText[1] = '/' then
begin
DoEndElement('',
SplitTagString(Copy(TokenText, 2, Length(TokenText)), Attr), '');
end else if TokenText[1] <> '!' then
end
else if TokenText[1] <> '!' then
begin
// Do NOT combine to a single line, as Attr is an output value!
TagName := SplitTagString(TokenText, Attr);