XML Validation: CreateRequiredElements with correct namespaces
This commit is contained in:
parent
ede9c97346
commit
96eeb95d17
@ -1579,7 +1579,9 @@ var
|
|||||||
elementSortCount: Integer;
|
elementSortCount: Integer;
|
||||||
elementSortOrder: string;
|
elementSortOrder: string;
|
||||||
elementRequired: string;
|
elementRequired: string;
|
||||||
|
elementNamespaceRequired: string;
|
||||||
elementRequiredCount: Integer;
|
elementRequiredCount: Integer;
|
||||||
|
elementNamespaceRequiredCount: Integer;
|
||||||
attributeRequired: string;
|
attributeRequired: string;
|
||||||
attributeRequiredCount: Integer;
|
attributeRequiredCount: Integer;
|
||||||
|
|
||||||
@ -1610,8 +1612,10 @@ begin
|
|||||||
begin
|
begin
|
||||||
case propertyItem.PropertyType of
|
case propertyItem.PropertyType of
|
||||||
ptSimple:
|
ptSimple:
|
||||||
|
begin
|
||||||
AddArrayElement(elementRequired, elementRequiredCount, QuotedStr(propertyItem.Name));
|
AddArrayElement(elementRequired, elementRequiredCount, QuotedStr(propertyItem.Name));
|
||||||
|
AddArrayElement(elementNamespaceRequired, elementNamespaceRequiredCount, QuotedStr(propertyItem.TargetNamespace));
|
||||||
|
end;
|
||||||
ptItem:
|
ptItem:
|
||||||
{ For Item properties, we call our getter property. This ensures the child element exists,
|
{ For Item properties, we call our getter property. This ensures the child element exists,
|
||||||
but also that it is created using our binding implementation. Otherwise there will be no
|
but also that it is created using our binding implementation. Otherwise there will be no
|
||||||
@ -1627,8 +1631,10 @@ begin
|
|||||||
if elementRequiredCount > 0 then
|
if elementRequiredCount > 0 then
|
||||||
begin
|
begin
|
||||||
Delete(elementRequired, 1, 2);
|
Delete(elementRequired, 1, 2);
|
||||||
|
Delete(elementNamespaceRequired, 1, 2);
|
||||||
AWriter.WriteLineNamedFmt(IfThen(AStrict, XSDValidateStrictMethodImplementationRequired, XSDValidateMethodImplementationRequired),
|
AWriter.WriteLineNamedFmt(IfThen(AStrict, XSDValidateStrictMethodImplementationRequired, XSDValidateMethodImplementationRequired),
|
||||||
['RequiredElements', elementRequired]);
|
['RequiredElements', elementRequired,
|
||||||
|
'RequiredElementNamespaces', elementNamespaceRequired]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
@ -114,7 +114,7 @@ const
|
|||||||
XSDValidateMethodImplementationBegin = 'procedure TXML%<Name>:s.XSDValidate;' + CrLf +
|
XSDValidateMethodImplementationBegin = 'procedure TXML%<Name>:s.XSDValidate;' + CrLf +
|
||||||
'begin';
|
'begin';
|
||||||
|
|
||||||
XSDValidateMethodImplementationRequired = ' CreateRequiredElements(Self, [%<RequiredElements>:s]);';
|
XSDValidateMethodImplementationRequired = ' CreateRequiredElements(Self, [%<RequiredElements>:s], [%<RequiredElementNamespaces>:s]);';
|
||||||
XSDValidateMethodImplementationComplex = ' Get%<Name>:s;';
|
XSDValidateMethodImplementationComplex = ' Get%<Name>:s;';
|
||||||
XSDValidateMethodImplementationAttrib = ' CreateRequiredAttributes(Self, [%<RequiredAttributes>:s]);';
|
XSDValidateMethodImplementationAttrib = ' CreateRequiredAttributes(Self, [%<RequiredAttributes>:s]);';
|
||||||
XSDValidateMethodImplementationSort = ' SortChildNodes(Self, [%<SortOrder>:s]);';
|
XSDValidateMethodImplementationSort = ' SortChildNodes(Self, [%<SortOrder>:s]);';
|
||||||
|
Loading…
Reference in New Issue
Block a user