diff --git a/Units/DelphiXMLDataBindingGenerator.pas b/Units/DelphiXMLDataBindingGenerator.pas index 00adf6d..14ddbbb 100644 --- a/Units/DelphiXMLDataBindingGenerator.pas +++ b/Units/DelphiXMLDataBindingGenerator.pas @@ -609,7 +609,6 @@ begin { In ye olde days this is where we checked if XMLDataBindingUtils was required. With the introduction of the IXSDValidate, this is practically always the case. } AWriter.WriteLine('uses'); - AWriter.WriteLine(' SysUtils,'); AWriter.WriteLine(' Variants;'); AWriter.WriteLine; end; diff --git a/Units/DelphiXMLDataBindingResources.pas b/Units/DelphiXMLDataBindingResources.pas index ddc7ed2..c3e8b97 100644 --- a/Units/DelphiXMLDataBindingResources.pas +++ b/Units/DelphiXMLDataBindingResources.pas @@ -27,6 +27,7 @@ const 'uses' + CrLf + '%:s' + ' Classes,' + CrLf + + ' SysUtils,' + CrLf + ' XMLDoc,' + CrLf + ' XMLIntf,' + CrLf + ' XMLDataBindingUtils;' + CrLf + @@ -45,7 +46,7 @@ const DocumentFunctionsInterface = ' function Get%:s(ADocument: XMLIntf.IXMLDocument): IXML%:s;' + CrLf + ' function Load%:s(const AFileName: String): IXML%:s;' + CrLf + ' function Load%:sFromStream(AStream: TStream): IXML%:s;' + CrLf + - ' function Load%:sFromString(const AString: String): IXML%:s;' + CrLf + + ' function Load%:sFromString(const AString: String{$IF CompilerVersion >= 20}; AEncoding: TEncoding = nil; AOwnsEncoding: Boolean = True{$IFEND}): IXML%:s;' + CrLf + ' function New%:s: IXML%:s;' + CrLf; DocumentFunctionsImplementation = 'function Get%:s(ADocument: XMLIntf.IXMLDocument): IXML%:s;' + CrLf + @@ -68,12 +69,12 @@ const ' Result := Get%:s(doc);' + CrLf + 'end;' + CrLf + '' + CrLf + - 'function Load%:sFromString(const AString: String): IXML%:s;' + CrLf + + 'function Load%:sFromString(const AString: String{$IF CompilerVersion >= 20}; AEncoding: TEncoding; AOwnsEncoding: Boolean{$IFEND}): IXML%:s;' + CrLf + 'var' + CrLf + ' stream: TStringStream;' + CrLf + '' + CrLf + 'begin' + CrLf + - ' stream := TStringStream.Create(AString);' + CrLf + + ' stream := TStringStream.Create(AString{$IF CompilerVersion >= 20}, AEncoding, AOwnsEncoding{$IFEND});' + CrLf + ' try' + CrLf + ' Result := Load%:sFromStream(stream);' + CrLf + ' finally' + CrLf + diff --git a/Units/XMLDataBindingGenerator.pas b/Units/XMLDataBindingGenerator.pas index 9031a16..5b17019 100644 --- a/Units/XMLDataBindingGenerator.pas +++ b/Units/XMLDataBindingGenerator.pas @@ -704,7 +704,6 @@ var schemaDef: IXMLSchemaDef; attributeIndex: Integer; attribute: IXMLAttributeDef; - item: TXMLDataBindingItem; begin schemaDef := ASchema.SchemaDef;