Browse Source

xmlwrite.pp: c14n compliance: write whitespace after PI name only if its data is not empty

git-svn-id: trunk@13856 -
sergei 16 years ago
parent
commit
ea85a7ec11
1 changed files with 5 additions and 2 deletions
  1. 5 2
      packages/fcl-xml/src/xmlwrite.pp

+ 5 - 2
packages/fcl-xml/src/xmlwrite.pp

@@ -516,8 +516,11 @@ begin
   if not FInsideTextNode then wrtIndent;
   if not FInsideTextNode then wrtIndent;
   wrtStr('<?');
   wrtStr('<?');
   wrtStr(TDOMProcessingInstruction(node).Target);
   wrtStr(TDOMProcessingInstruction(node).Target);
-  wrtChr(' ');
-  wrtStr(TDOMProcessingInstruction(node).Data);
+  if TDOMProcessingInstruction(node).Data <> '' then
+  begin
+    wrtChr(' ');
+    wrtStr(TDOMProcessingInstruction(node).Data);
+  end;
   wrtStr('?>');
   wrtStr('?>');
 end;
 end;