2008-04-22 15:36:55 +02:00
|
|
|
{
|
2008-04-24 16:37:05 +02:00
|
|
|
X2Software XML Data Binding
|
|
|
|
|
2017-09-06 17:12:15 +02:00
|
|
|
Generated on: 6-9-2017 16:58:58
|
2017-07-21 09:38:17 +02:00
|
|
|
Generated from: P:\x2xmldatabinding\XSD\DataBindingSettings.xsd
|
2008-04-22 15:36:55 +02:00
|
|
|
}
|
|
|
|
unit DataBindingSettingsXML;
|
|
|
|
|
|
|
|
interface
|
|
|
|
uses
|
|
|
|
Classes,
|
2017-07-21 09:38:17 +02:00
|
|
|
SysUtils,
|
2008-04-22 15:36:55 +02:00
|
|
|
XMLDoc,
|
2017-07-21 09:38:17 +02:00
|
|
|
XMLIntf,
|
|
|
|
XMLDataBindingUtils;
|
2008-04-22 15:36:55 +02:00
|
|
|
|
|
|
|
type
|
|
|
|
{ Forward declarations for DataBindingSettings }
|
|
|
|
IXMLDataBindingSettings = interface;
|
|
|
|
IXMLDataBindingOutput = interface;
|
|
|
|
IXMLOutputSingle = interface;
|
|
|
|
IXMLOutputMultiple = interface;
|
2017-07-21 09:38:17 +02:00
|
|
|
TXMLDataBindingOutputType = (DataBindingOutputType_Single,
|
|
|
|
DataBindingOutputType_Multiple);
|
2008-04-22 15:36:55 +02:00
|
|
|
|
|
|
|
{ Interfaces for DataBindingSettings }
|
|
|
|
{
|
|
|
|
Contains the settings and hints for the Delphi XML Data Binding.
|
|
|
|
}
|
|
|
|
IXMLDataBindingSettings = interface(IXMLNode)
|
2017-09-06 17:12:15 +02:00
|
|
|
['{90C0CA10-A7AD-4418-98B6-D03469DB8913}']
|
2017-07-21 09:38:17 +02:00
|
|
|
procedure XSDValidateDocument(AStrict: Boolean = False);
|
2008-04-22 15:36:55 +02:00
|
|
|
function GetHasOutput: Boolean;
|
|
|
|
function GetOutput: IXMLDataBindingOutput;
|
|
|
|
|
|
|
|
property HasOutput: Boolean read GetHasOutput;
|
|
|
|
property Output: IXMLDataBindingOutput read GetOutput;
|
|
|
|
end;
|
|
|
|
|
|
|
|
{
|
|
|
|
Contains the user-defined output settings last used
|
|
|
|
}
|
|
|
|
IXMLDataBindingOutput = interface(IXMLNode)
|
2017-09-06 17:12:15 +02:00
|
|
|
['{166F0975-2D2F-4CDB-B911-005163A0761F}']
|
2017-07-21 09:38:17 +02:00
|
|
|
procedure XSDValidate;
|
|
|
|
procedure XSDValidateStrict(AResult: IXSDValidateStrictResult);
|
|
|
|
|
2008-04-22 15:36:55 +02:00
|
|
|
function GetOutputTypeText: WideString;
|
2017-07-21 09:38:17 +02:00
|
|
|
function GetOutputType: TXMLDataBindingOutputType;
|
2008-04-22 15:36:55 +02:00
|
|
|
function GetHasOutputSingle: Boolean;
|
|
|
|
function GetOutputSingle: IXMLOutputSingle;
|
|
|
|
function GetHasOutputMultiple: Boolean;
|
|
|
|
function GetOutputMultiple: IXMLOutputMultiple;
|
2017-07-21 09:38:17 +02:00
|
|
|
function GetHasHasChecksEmpty: Boolean;
|
|
|
|
function GetHasChecksEmpty: Boolean;
|
2017-09-06 17:12:15 +02:00
|
|
|
function GetHasGenerateGetOptionalOrDefault: Boolean;
|
|
|
|
function GetGenerateGetOptionalOrDefault: Boolean;
|
2008-04-22 15:36:55 +02:00
|
|
|
|
|
|
|
procedure SetOutputTypeText(const Value: WideString);
|
2017-07-21 09:38:17 +02:00
|
|
|
procedure SetOutputType(const Value: TXMLDataBindingOutputType);
|
|
|
|
procedure SetHasChecksEmpty(const Value: Boolean);
|
2017-09-06 17:12:15 +02:00
|
|
|
procedure SetGenerateGetOptionalOrDefault(const Value: Boolean);
|
2008-04-22 15:36:55 +02:00
|
|
|
|
|
|
|
property OutputTypeText: WideString read GetOutputTypeText write SetOutputTypeText;
|
2017-07-21 09:38:17 +02:00
|
|
|
property OutputType: TXMLDataBindingOutputType read GetOutputType write SetOutputType;
|
2008-04-22 15:36:55 +02:00
|
|
|
property HasOutputSingle: Boolean read GetHasOutputSingle;
|
|
|
|
property OutputSingle: IXMLOutputSingle read GetOutputSingle;
|
|
|
|
property HasOutputMultiple: Boolean read GetHasOutputMultiple;
|
|
|
|
property OutputMultiple: IXMLOutputMultiple read GetOutputMultiple;
|
2017-07-21 09:38:17 +02:00
|
|
|
property HasHasChecksEmpty: Boolean read GetHasHasChecksEmpty;
|
|
|
|
property HasChecksEmpty: Boolean read GetHasChecksEmpty write SetHasChecksEmpty;
|
2017-09-06 17:12:15 +02:00
|
|
|
property HasGenerateGetOptionalOrDefault: Boolean read GetHasGenerateGetOptionalOrDefault;
|
|
|
|
property GenerateGetOptionalOrDefault: Boolean read GetGenerateGetOptionalOrDefault write SetGenerateGetOptionalOrDefault;
|
2008-04-22 15:36:55 +02:00
|
|
|
end;
|
|
|
|
|
|
|
|
IXMLOutputSingle = interface(IXMLNode)
|
2017-09-06 17:12:15 +02:00
|
|
|
['{77AE2C19-333F-4335-872E-659AE17C4701}']
|
2017-07-21 09:38:17 +02:00
|
|
|
procedure XSDValidate;
|
|
|
|
procedure XSDValidateStrict(AResult: IXSDValidateStrictResult);
|
|
|
|
|
2008-04-22 15:36:55 +02:00
|
|
|
function GetFileName: WideString;
|
|
|
|
|
|
|
|
procedure SetFileName(const Value: WideString);
|
|
|
|
|
|
|
|
property FileName: WideString read GetFileName write SetFileName;
|
|
|
|
end;
|
|
|
|
|
|
|
|
IXMLOutputMultiple = interface(IXMLNode)
|
2017-09-06 17:12:15 +02:00
|
|
|
['{8C1E7817-DBF1-4125-B29A-F7279006C7FB}']
|
2017-07-21 09:38:17 +02:00
|
|
|
procedure XSDValidate;
|
|
|
|
procedure XSDValidateStrict(AResult: IXSDValidateStrictResult);
|
|
|
|
|
2008-04-22 15:36:55 +02:00
|
|
|
function GetPath: WideString;
|
|
|
|
function GetPrefix: WideString;
|
|
|
|
function GetPostfix: WideString;
|
|
|
|
|
|
|
|
procedure SetPath(const Value: WideString);
|
|
|
|
procedure SetPrefix(const Value: WideString);
|
|
|
|
procedure SetPostfix(const Value: WideString);
|
|
|
|
|
|
|
|
property Path: WideString read GetPath write SetPath;
|
|
|
|
property Prefix: WideString read GetPrefix write SetPrefix;
|
|
|
|
property Postfix: WideString read GetPostfix write SetPostfix;
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
{ Classes for DataBindingSettings }
|
2017-07-21 09:38:17 +02:00
|
|
|
TXMLDataBindingSettings = class(TX2XMLNode, IXMLDataBindingSettings)
|
2008-04-22 15:36:55 +02:00
|
|
|
public
|
|
|
|
procedure AfterConstruction; override;
|
|
|
|
protected
|
2017-07-21 09:38:17 +02:00
|
|
|
procedure XSDValidateDocument(AStrict: Boolean = False);
|
2008-04-22 15:36:55 +02:00
|
|
|
function GetHasOutput: Boolean;
|
|
|
|
function GetOutput: IXMLDataBindingOutput;
|
|
|
|
end;
|
|
|
|
|
2017-07-21 09:38:17 +02:00
|
|
|
TXMLDataBindingOutput = class(TX2XMLNode, IXSDValidate, IXSDValidateStrict, IXMLDataBindingOutput)
|
2008-04-22 15:36:55 +02:00
|
|
|
public
|
|
|
|
procedure AfterConstruction; override;
|
|
|
|
protected
|
2017-07-21 09:38:17 +02:00
|
|
|
procedure XSDValidate;
|
|
|
|
procedure XSDValidateStrict(AResult: IXSDValidateStrictResult);
|
|
|
|
|
2008-04-22 15:36:55 +02:00
|
|
|
function GetOutputTypeText: WideString;
|
2017-07-21 09:38:17 +02:00
|
|
|
function GetOutputType: TXMLDataBindingOutputType;
|
2008-04-22 15:36:55 +02:00
|
|
|
function GetHasOutputSingle: Boolean;
|
|
|
|
function GetOutputSingle: IXMLOutputSingle;
|
|
|
|
function GetHasOutputMultiple: Boolean;
|
|
|
|
function GetOutputMultiple: IXMLOutputMultiple;
|
2017-07-21 09:38:17 +02:00
|
|
|
function GetHasHasChecksEmpty: Boolean;
|
|
|
|
function GetHasChecksEmpty: Boolean;
|
2017-09-06 17:12:15 +02:00
|
|
|
function GetHasGenerateGetOptionalOrDefault: Boolean;
|
|
|
|
function GetGenerateGetOptionalOrDefault: Boolean;
|
2008-04-22 15:36:55 +02:00
|
|
|
|
|
|
|
procedure SetOutputTypeText(const Value: WideString);
|
2017-07-21 09:38:17 +02:00
|
|
|
procedure SetOutputType(const Value: TXMLDataBindingOutputType);
|
|
|
|
procedure SetHasChecksEmpty(const Value: Boolean);
|
2017-09-06 17:12:15 +02:00
|
|
|
procedure SetGenerateGetOptionalOrDefault(const Value: Boolean);
|
2008-04-22 15:36:55 +02:00
|
|
|
end;
|
|
|
|
|
2017-07-21 09:38:17 +02:00
|
|
|
TXMLOutputSingle = class(TX2XMLNode, IXSDValidate, IXSDValidateStrict, IXMLOutputSingle)
|
2008-04-22 15:36:55 +02:00
|
|
|
protected
|
2017-07-21 09:38:17 +02:00
|
|
|
procedure XSDValidate;
|
|
|
|
procedure XSDValidateStrict(AResult: IXSDValidateStrictResult);
|
|
|
|
|
2008-04-22 15:36:55 +02:00
|
|
|
function GetFileName: WideString;
|
|
|
|
|
|
|
|
procedure SetFileName(const Value: WideString);
|
|
|
|
end;
|
|
|
|
|
2017-07-21 09:38:17 +02:00
|
|
|
TXMLOutputMultiple = class(TX2XMLNode, IXSDValidate, IXSDValidateStrict, IXMLOutputMultiple)
|
2008-04-22 15:36:55 +02:00
|
|
|
protected
|
2017-07-21 09:38:17 +02:00
|
|
|
procedure XSDValidate;
|
|
|
|
procedure XSDValidateStrict(AResult: IXSDValidateStrictResult);
|
|
|
|
|
2008-04-22 15:36:55 +02:00
|
|
|
function GetPath: WideString;
|
|
|
|
function GetPrefix: WideString;
|
|
|
|
function GetPostfix: WideString;
|
|
|
|
|
|
|
|
procedure SetPath(const Value: WideString);
|
|
|
|
procedure SetPrefix(const Value: WideString);
|
|
|
|
procedure SetPostfix(const Value: WideString);
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
{ Document functions }
|
2017-07-21 09:38:17 +02:00
|
|
|
function GetDataBindingSettings(ADocument: XMLIntf.IXMLDocument): IXMLDataBindingSettings;
|
2008-04-22 15:36:55 +02:00
|
|
|
function LoadDataBindingSettings(const AFileName: String): IXMLDataBindingSettings;
|
|
|
|
function LoadDataBindingSettingsFromStream(AStream: TStream): IXMLDataBindingSettings;
|
2017-07-21 09:38:17 +02:00
|
|
|
function LoadDataBindingSettingsFromString(const AString: String{$IF CompilerVersion >= 20}; AEncoding: TEncoding = nil; AOwnsEncoding: Boolean = True{$IFEND}): IXMLDataBindingSettings;
|
2008-04-22 15:36:55 +02:00
|
|
|
function NewDataBindingSettings: IXMLDataBindingSettings;
|
|
|
|
|
|
|
|
|
|
|
|
const
|
2008-04-24 16:37:05 +02:00
|
|
|
TargetNamespace = 'http://www.x2software.net/xsd/databinding/DataBindingSettings.xsd';
|
2008-04-22 15:36:55 +02:00
|
|
|
|
|
|
|
|
|
|
|
const
|
2017-07-21 09:38:17 +02:00
|
|
|
DataBindingOutputTypeValues: array[TXMLDataBindingOutputType] of WideString =
|
|
|
|
(
|
|
|
|
'Single',
|
|
|
|
'Multiple'
|
|
|
|
);
|
2008-04-22 15:36:55 +02:00
|
|
|
|
|
|
|
{ Enumeration conversion helpers }
|
2017-07-21 09:38:17 +02:00
|
|
|
function StringToDataBindingOutputType(const AValue: WideString): TXMLDataBindingOutputType;
|
2008-04-22 15:36:55 +02:00
|
|
|
|
|
|
|
implementation
|
|
|
|
uses
|
2017-07-21 09:38:17 +02:00
|
|
|
Variants;
|
2008-04-22 15:36:55 +02:00
|
|
|
|
|
|
|
{ Document functions }
|
2017-07-21 09:38:17 +02:00
|
|
|
function GetDataBindingSettings(ADocument: XMLIntf.IXMLDocument): IXMLDataBindingSettings;
|
2008-04-22 15:36:55 +02:00
|
|
|
begin
|
|
|
|
Result := ADocument.GetDocBinding('DataBindingSettings', TXMLDataBindingSettings, TargetNamespace) as IXMLDataBindingSettings
|
|
|
|
end;
|
|
|
|
|
|
|
|
function LoadDataBindingSettings(const AFileName: String): IXMLDataBindingSettings;
|
|
|
|
begin
|
|
|
|
Result := LoadXMLDocument(AFileName).GetDocBinding('DataBindingSettings', TXMLDataBindingSettings, TargetNamespace) as IXMLDataBindingSettings
|
|
|
|
end;
|
|
|
|
|
|
|
|
function LoadDataBindingSettingsFromStream(AStream: TStream): IXMLDataBindingSettings;
|
|
|
|
var
|
2017-07-21 09:38:17 +02:00
|
|
|
doc: XMLIntf.IXMLDocument;
|
2008-04-22 15:36:55 +02:00
|
|
|
|
|
|
|
begin
|
|
|
|
doc := NewXMLDocument;
|
|
|
|
doc.LoadFromStream(AStream);
|
|
|
|
Result := GetDataBindingSettings(doc);
|
|
|
|
end;
|
|
|
|
|
2017-07-21 09:38:17 +02:00
|
|
|
function LoadDataBindingSettingsFromString(const AString: String{$IF CompilerVersion >= 20}; AEncoding: TEncoding; AOwnsEncoding: Boolean{$IFEND}): IXMLDataBindingSettings;
|
|
|
|
var
|
|
|
|
stream: TStringStream;
|
|
|
|
|
|
|
|
begin
|
|
|
|
{$IF CompilerVersion >= 20}
|
|
|
|
if Assigned(AEncoding) then
|
|
|
|
stream := TStringStream.Create(AString, AEncoding, AOwnsEncoding)
|
|
|
|
else
|
|
|
|
{$IFEND}
|
|
|
|
stream := TStringStream.Create(AString);
|
|
|
|
try
|
|
|
|
Result := LoadDataBindingSettingsFromStream(stream);
|
|
|
|
finally
|
|
|
|
FreeAndNil(stream);
|
|
|
|
end;
|
|
|
|
end;
|
|
|
|
|
2008-04-22 15:36:55 +02:00
|
|
|
function NewDataBindingSettings: IXMLDataBindingSettings;
|
|
|
|
begin
|
|
|
|
Result := NewXMLDocument.GetDocBinding('DataBindingSettings', TXMLDataBindingSettings, TargetNamespace) as IXMLDataBindingSettings
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ Enumeration conversion helpers }
|
2017-07-21 09:38:17 +02:00
|
|
|
function StringToDataBindingOutputType(const AValue: WideString): TXMLDataBindingOutputType;
|
2008-04-22 15:36:55 +02:00
|
|
|
var
|
2017-07-21 09:38:17 +02:00
|
|
|
enumValue: TXMLDataBindingOutputType;
|
2008-04-22 15:36:55 +02:00
|
|
|
|
|
|
|
begin
|
2017-07-21 09:38:17 +02:00
|
|
|
Result := TXMLDataBindingOutputType(-1);
|
|
|
|
for enumValue := Low(TXMLDataBindingOutputType) to High(TXMLDataBindingOutputType) do
|
|
|
|
if DataBindingOutputTypeValues[enumValue] = AValue then
|
2008-04-22 15:36:55 +02:00
|
|
|
begin
|
|
|
|
Result := enumValue;
|
|
|
|
break;
|
|
|
|
end;
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
{ Implementation for DataBindingSettings }
|
|
|
|
procedure TXMLDataBindingSettings.AfterConstruction;
|
|
|
|
begin
|
|
|
|
RegisterChildNode('Output', TXMLDataBindingOutput);
|
|
|
|
inherited;
|
|
|
|
end;
|
|
|
|
|
2017-07-21 09:38:17 +02:00
|
|
|
procedure TXMLDataBindingSettings.XSDValidateDocument(AStrict: Boolean);
|
|
|
|
begin
|
|
|
|
if AStrict then
|
|
|
|
XMLDataBindingUtils.XSDValidateStrict(Self)
|
|
|
|
else
|
|
|
|
XMLDataBindingUtils.XSDValidate(Self);
|
|
|
|
end;
|
|
|
|
|
2008-04-22 15:36:55 +02:00
|
|
|
function TXMLDataBindingSettings.GetHasOutput: Boolean;
|
|
|
|
begin
|
|
|
|
Result := Assigned(ChildNodes.FindNode('Output'));
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
function TXMLDataBindingSettings.GetOutput: IXMLDataBindingOutput;
|
|
|
|
begin
|
|
|
|
Result := (ChildNodes['Output'] as IXMLDataBindingOutput);
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TXMLDataBindingOutput.AfterConstruction;
|
|
|
|
begin
|
|
|
|
RegisterChildNode('OutputSingle', TXMLOutputSingle);
|
|
|
|
RegisterChildNode('OutputMultiple', TXMLOutputMultiple);
|
|
|
|
inherited;
|
|
|
|
end;
|
|
|
|
|
2017-07-21 09:38:17 +02:00
|
|
|
procedure TXMLDataBindingOutput.XSDValidate;
|
|
|
|
begin
|
|
|
|
GetOutputType;
|
2017-09-06 17:12:15 +02:00
|
|
|
SortChildNodes(Self, ['OutputType', 'OutputSingle', 'OutputMultiple', 'HasChecksEmpty', 'GenerateGetOptionalOrDefault']);
|
2017-07-21 09:38:17 +02:00
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TXMLDataBindingOutput.XSDValidateStrict(AResult: IXSDValidateStrictResult);
|
|
|
|
begin
|
|
|
|
GetOutputType;
|
2017-09-06 17:12:15 +02:00
|
|
|
SortChildNodes(Self, ['OutputType', 'OutputSingle', 'OutputMultiple', 'HasChecksEmpty', 'GenerateGetOptionalOrDefault']);
|
2017-07-21 09:38:17 +02:00
|
|
|
end;
|
|
|
|
|
2008-04-22 15:36:55 +02:00
|
|
|
function TXMLDataBindingOutput.GetOutputTypeText: WideString;
|
|
|
|
begin
|
2008-04-24 16:37:05 +02:00
|
|
|
Result := ChildNodes['OutputType'].Text;
|
2008-04-22 15:36:55 +02:00
|
|
|
end;
|
|
|
|
|
|
|
|
|
2017-07-21 09:38:17 +02:00
|
|
|
function TXMLDataBindingOutput.GetOutputType: TXMLDataBindingOutputType;
|
2008-04-22 15:36:55 +02:00
|
|
|
begin
|
2017-07-21 09:38:17 +02:00
|
|
|
Result := StringToDataBindingOutputType(GetOutputTypeText);
|
2008-04-22 15:36:55 +02:00
|
|
|
end;
|
|
|
|
|
|
|
|
function TXMLDataBindingOutput.GetHasOutputSingle: Boolean;
|
|
|
|
begin
|
|
|
|
Result := Assigned(ChildNodes.FindNode('OutputSingle'));
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
function TXMLDataBindingOutput.GetOutputSingle: IXMLOutputSingle;
|
|
|
|
begin
|
|
|
|
Result := (ChildNodes['OutputSingle'] as IXMLOutputSingle);
|
|
|
|
end;
|
|
|
|
|
|
|
|
function TXMLDataBindingOutput.GetHasOutputMultiple: Boolean;
|
|
|
|
begin
|
|
|
|
Result := Assigned(ChildNodes.FindNode('OutputMultiple'));
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
function TXMLDataBindingOutput.GetOutputMultiple: IXMLOutputMultiple;
|
|
|
|
begin
|
|
|
|
Result := (ChildNodes['OutputMultiple'] as IXMLOutputMultiple);
|
|
|
|
end;
|
|
|
|
|
2017-07-21 09:38:17 +02:00
|
|
|
function TXMLDataBindingOutput.GetHasHasChecksEmpty: Boolean;
|
|
|
|
begin
|
|
|
|
Result := Assigned(ChildNodes.FindNode('HasChecksEmpty'));
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
function TXMLDataBindingOutput.GetHasChecksEmpty: Boolean;
|
|
|
|
begin
|
|
|
|
Result := ChildNodes['HasChecksEmpty'].NodeValue;
|
|
|
|
end;
|
|
|
|
|
2017-09-06 17:12:15 +02:00
|
|
|
function TXMLDataBindingOutput.GetHasGenerateGetOptionalOrDefault: Boolean;
|
|
|
|
begin
|
|
|
|
Result := Assigned(ChildNodes.FindNode('GenerateGetOptionalOrDefault'));
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
function TXMLDataBindingOutput.GetGenerateGetOptionalOrDefault: Boolean;
|
|
|
|
begin
|
|
|
|
Result := ChildNodes['GenerateGetOptionalOrDefault'].NodeValue;
|
|
|
|
end;
|
|
|
|
|
2008-04-22 15:36:55 +02:00
|
|
|
procedure TXMLDataBindingOutput.SetOutputTypeText(const Value: WideString);
|
|
|
|
begin
|
|
|
|
ChildNodes['OutputType'].NodeValue := Value;
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
2017-07-21 09:38:17 +02:00
|
|
|
procedure TXMLDataBindingOutput.SetOutputType(const Value: TXMLDataBindingOutputType);
|
2008-04-22 15:36:55 +02:00
|
|
|
begin
|
2017-07-21 09:38:17 +02:00
|
|
|
ChildNodes['OutputType'].NodeValue := DataBindingOutputTypeValues[Value];
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TXMLDataBindingOutput.SetHasChecksEmpty(const Value: Boolean);
|
|
|
|
begin
|
|
|
|
ChildNodes['HasChecksEmpty'].NodeValue := BoolToXML(Value);
|
|
|
|
end;
|
|
|
|
|
2017-09-06 17:12:15 +02:00
|
|
|
procedure TXMLDataBindingOutput.SetGenerateGetOptionalOrDefault(const Value: Boolean);
|
|
|
|
begin
|
|
|
|
ChildNodes['GenerateGetOptionalOrDefault'].NodeValue := BoolToXML(Value);
|
|
|
|
end;
|
|
|
|
|
2017-07-21 09:38:17 +02:00
|
|
|
procedure TXMLOutputSingle.XSDValidate;
|
|
|
|
begin
|
|
|
|
CreateRequiredElements(Self, ['FileName']);
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TXMLOutputSingle.XSDValidateStrict(AResult: IXSDValidateStrictResult);
|
|
|
|
begin
|
|
|
|
ValidateRequiredElements(AResult, Self, ['FileName']);
|
2008-04-22 15:36:55 +02:00
|
|
|
end;
|
|
|
|
|
|
|
|
function TXMLOutputSingle.GetFileName: WideString;
|
|
|
|
begin
|
|
|
|
Result := ChildNodes['FileName'].Text;
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TXMLOutputSingle.SetFileName(const Value: WideString);
|
|
|
|
begin
|
2017-07-21 09:38:17 +02:00
|
|
|
ChildNodes['FileName'].NodeValue := GetValidXMLText(Value);
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TXMLOutputMultiple.XSDValidate;
|
|
|
|
begin
|
|
|
|
CreateRequiredElements(Self, ['Path', 'Prefix', 'Postfix']);
|
|
|
|
SortChildNodes(Self, ['Path', 'Prefix', 'Postfix']);
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TXMLOutputMultiple.XSDValidateStrict(AResult: IXSDValidateStrictResult);
|
|
|
|
begin
|
|
|
|
ValidateRequiredElements(AResult, Self, ['Path', 'Prefix', 'Postfix']);
|
|
|
|
SortChildNodes(Self, ['Path', 'Prefix', 'Postfix']);
|
2008-04-22 15:36:55 +02:00
|
|
|
end;
|
|
|
|
|
|
|
|
function TXMLOutputMultiple.GetPath: WideString;
|
|
|
|
begin
|
|
|
|
Result := ChildNodes['Path'].Text;
|
|
|
|
end;
|
|
|
|
|
|
|
|
function TXMLOutputMultiple.GetPrefix: WideString;
|
|
|
|
begin
|
|
|
|
Result := ChildNodes['Prefix'].Text;
|
|
|
|
end;
|
|
|
|
|
|
|
|
function TXMLOutputMultiple.GetPostfix: WideString;
|
|
|
|
begin
|
|
|
|
Result := ChildNodes['Postfix'].Text;
|
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TXMLOutputMultiple.SetPath(const Value: WideString);
|
|
|
|
begin
|
2017-07-21 09:38:17 +02:00
|
|
|
ChildNodes['Path'].NodeValue := GetValidXMLText(Value);
|
2008-04-22 15:36:55 +02:00
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TXMLOutputMultiple.SetPrefix(const Value: WideString);
|
|
|
|
begin
|
2017-07-21 09:38:17 +02:00
|
|
|
ChildNodes['Prefix'].NodeValue := GetValidXMLText(Value);
|
2008-04-22 15:36:55 +02:00
|
|
|
end;
|
|
|
|
|
|
|
|
procedure TXMLOutputMultiple.SetPostfix(const Value: WideString);
|
|
|
|
begin
|
2017-07-21 09:38:17 +02:00
|
|
|
ChildNodes['Postfix'].NodeValue := GetValidXMLText(Value);
|
2008-04-22 15:36:55 +02:00
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
end.
|