diff --git a/packages/fcl-xml/src/xmlwrite.pp b/packages/fcl-xml/src/xmlwrite.pp index e3ebf66579..ee1ff72c4f 100644 --- a/packages/fcl-xml/src/xmlwrite.pp +++ b/packages/fcl-xml/src/xmlwrite.pp @@ -130,7 +130,7 @@ end; ---------------------------------------------------------------------} const - AttrSpecialChars = ['<', '"', '&', #9, #10, #13]; + AttrSpecialChars = ['<', '>', '"', '&', #9, #10, #13]; TextSpecialChars = ['<', '>', '&', #10, #13]; CDSectSpecialChars = [']']; LineEndingChars = [#13, #10]; @@ -312,6 +312,12 @@ begin '"': Sender.wrtStr(QuotStr); '&': Sender.wrtStr(AmpStr); '<': Sender.wrtStr(ltStr); + // This is *only* to interoperate with broken parsers out there, + // Delphi ClientDataset parser being one of them. + '>': if not Sender.FCanonical then + Sender.wrtStr(gtStr) + else + Sender.wrtChr('>'); // Escape whitespace using CharRefs to be consistent with W3 spec § 3.3.3 #9: Sender.wrtStr(' '); #10: Sender.wrtStr(' ');