summaryrefslogtreecommitdiff
path: root/packages/fcl-xml
diff options
context:
space:
mode:
authormichael <michael@3ad0048d-3df7-0310-abae-a5850022a9f2>2010-11-26 12:44:23 +0000
committermichael <michael@3ad0048d-3df7-0310-abae-a5850022a9f2>2010-11-26 12:44:23 +0000
commita7440219f180c1c3ddfa1b71f72a16eb411481ac (patch)
tree0c28e54ced5486392ed4a00781c479427e8da6e6 /packages/fcl-xml
parent98129e8e400fd8a7e00786628bb1f3ff67b859ad (diff)
downloadfpc-a7440219f180c1c3ddfa1b71f72a16eb411481ac.tar.gz
* Patch from Graeme Geldenhuys to check for XMLDocument before typecasting it
git-svn-id: http://svn.freepascal.org/svn/fpc/trunk@16443 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'packages/fcl-xml')
-rw-r--r--packages/fcl-xml/src/xmlwrite.pp17
1 files changed, 10 insertions, 7 deletions
diff --git a/packages/fcl-xml/src/xmlwrite.pp b/packages/fcl-xml/src/xmlwrite.pp
index 206388417d..e3ebf66579 100644
--- a/packages/fcl-xml/src/xmlwrite.pp
+++ b/packages/fcl-xml/src/xmlwrite.pp
@@ -681,14 +681,17 @@ begin
wrtStr('?>');
// TODO: now handled as a regular PI, remove this?
- if Length(TXMLDocument(node).StylesheetType) > 0 then
+ if node is TXMLDocument then
begin
- wrtStr(FLineBreak);
- wrtStr('<?xml-stylesheet type="');
- wrtStr(TXMLDocument(node).StylesheetType);
- wrtStr('" href="');
- wrtStr(TXMLDocument(node).StylesheetHRef);
- wrtStr('"?>');
+ if Length(TXMLDocument(node).StylesheetType) > 0 then
+ begin
+ wrtStr(FLineBreak);
+ wrtStr('<?xml-stylesheet type="');
+ wrtStr(TXMLDocument(node).StylesheetType);
+ wrtStr('" href="');
+ wrtStr(TXMLDocument(node).StylesheetHRef);
+ wrtStr('"?>');
+ end;
end;
child := node.FirstChild;