From 5f79c4a481d7747ad92532d761c62a55c6833f1d Mon Sep 17 00:00:00 2001 From: Ronny Heidenreich Date: Thu, 9 Nov 2023 15:07:24 +0100 Subject: [PATCH] Fix: Documentation Element not recognized anymore since commit b4998a5d SchemaItem.Documentation is a collection that never IsTextElement, but its items are --- Units/XMLDataBindingGenerator.pas | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/Units/XMLDataBindingGenerator.pas b/Units/XMLDataBindingGenerator.pas index 2d32096..6c0c6b7 100644 --- a/Units/XMLDataBindingGenerator.pas +++ b/Units/XMLDataBindingGenerator.pas @@ -1782,7 +1782,10 @@ begin if HasDocumentation then begin for documentationIndex := 0 to Pred(SchemaItem.Documentation.Count) do - Result := Result + SchemaItem.Documentation[documentationIndex].Text + #13#10; + begin + if SchemaItem.Documentation[documentationIndex].IsTextElement then + Result := Result + SchemaItem.Documentation[documentationIndex].Text + #13#10; + end; Result := Trim(Result); end; @@ -1790,10 +1793,16 @@ end; function TXMLDataBindingItem.GetHasDocumentation: Boolean; +var + documentationIndex: Integer; + begin - Result := Assigned(SchemaItem) and - (SchemaItem.Documentation.Count > 0) and - SchemaItem.Documentation.IsTextElement; + Result := False; + if Assigned(SchemaItem) then + begin + for documentationIndex := 0 to Pred(SchemaItem.Documentation.Count) do + Result := Result or SchemaItem.Documentation[documentationIndex].IsTextElement; + end; end;