1
0
mirror of synced 2024-11-21 05:33:50 +00:00

Merge pull request #8 from HeRoSofty/XmlSchemaDocumentation

Fix: Documentation Element not recognized anymore
This commit is contained in:
Mark van Renswoude 2023-11-09 18:22:12 +01:00 committed by GitHub
commit f3d832b1fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1782,7 +1782,18 @@ begin
if HasDocumentation then if HasDocumentation then
begin begin
for documentationIndex := 0 to Pred(SchemaItem.Documentation.Count) do for documentationIndex := 0 to Pred(SchemaItem.Documentation.Count) do
Result := Result + SchemaItem.Documentation[documentationIndex].Text + #13#10; begin
if SchemaItem.Documentation[documentationIndex].IsTextElement then
begin
if SchemaItem.Documentation[documentationIndex].HasAttribute('xml:lang') then
Result := Result + '[' + SchemaItem.Documentation[documentationIndex].Attributes['xml:lang'] + '] ';
if SchemaItem.Documentation[documentationIndex].HasAttribute('source') then
Result := Result + '(' + SchemaItem.Documentation[documentationIndex].Attributes['source'] + ') ';
Result := Result + SchemaItem.Documentation[documentationIndex].Text + #13#10;
end;
end;
Result := Trim(Result); Result := Trim(Result);
end; end;
@ -1790,10 +1801,16 @@ end;
function TXMLDataBindingItem.GetHasDocumentation: Boolean; function TXMLDataBindingItem.GetHasDocumentation: Boolean;
var
documentationIndex: Integer;
begin begin
Result := Assigned(SchemaItem) and Result := False;
(SchemaItem.Documentation.Count > 0) and if Assigned(SchemaItem) then
SchemaItem.Documentation.IsTextElement; begin
for documentationIndex := 0 to Pred(SchemaItem.Documentation.Count) do
Result := Result or SchemaItem.Documentation[documentationIndex].IsTextElement;
end;
end; end;