* Patch from Graeme Geldenhuys to check for XMLDocument before typecasting it

git-svn-id: trunk@16443 -
This commit is contained in:
michael 2010-11-26 12:44:23 +00:00
parent 3650944d9e
commit a8e4234aca

View File

@ -681,14 +681,17 @@ begin
wrtStr('?>'); wrtStr('?>');
// TODO: now handled as a regular PI, remove this? // TODO: now handled as a regular PI, remove this?
if Length(TXMLDocument(node).StylesheetType) > 0 then if node is TXMLDocument then
begin begin
wrtStr(FLineBreak); if Length(TXMLDocument(node).StylesheetType) > 0 then
wrtStr('<?xml-stylesheet type="'); begin
wrtStr(TXMLDocument(node).StylesheetType); wrtStr(FLineBreak);
wrtStr('" href="'); wrtStr('<?xml-stylesheet type="');
wrtStr(TXMLDocument(node).StylesheetHRef); wrtStr(TXMLDocument(node).StylesheetType);
wrtStr('"?>'); wrtStr('" href="');
wrtStr(TXMLDocument(node).StylesheetHRef);
wrtStr('"?>');
end;
end; end;
child := node.FirstChild; child := node.FirstChild;