mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-07-06 21:07:11 +02:00
* fcl-xml, replacing more occurrences of WideString with XMLString.
git-svn-id: trunk@20396 -
This commit is contained in:
parent
67f4886cde
commit
042f5264bb
@ -73,12 +73,12 @@ type
|
|||||||
FDefault: TAttrDefault;
|
FDefault: TAttrDefault;
|
||||||
FTag: Cardinal;
|
FTag: Cardinal;
|
||||||
FIsNamespaceDecl: Boolean;
|
FIsNamespaceDecl: Boolean;
|
||||||
FEnumeration: array of WideString;
|
FEnumeration: array of XMLString;
|
||||||
public
|
public
|
||||||
constructor Create(aName: PHashItem; aColonPos: Integer);
|
constructor Create(aName: PHashItem; aColonPos: Integer);
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
function AddEnumToken(Buf: PWideChar; Len: Integer): Boolean;
|
function AddEnumToken(Buf: PWideChar; Len: Integer): Boolean;
|
||||||
function HasEnumToken(const aValue: WideString): Boolean;
|
function HasEnumToken(const aValue: XMLString): Boolean;
|
||||||
property Data: PNodeData read FData;
|
property Data: PNodeData read FData;
|
||||||
property Default: TAttrDefault read FDefault write FDefault;
|
property Default: TAttrDefault read FDefault write FDefault;
|
||||||
property DataType: TAttrDataType read FDataType write FDataType;
|
property DataType: TAttrDataType read FDataType write FDataType;
|
||||||
@ -115,14 +115,14 @@ type
|
|||||||
|
|
||||||
TEntityDecl = class(TDTDObject)
|
TEntityDecl = class(TDTDObject)
|
||||||
public
|
public
|
||||||
FName: WideString; // TODO: change to PHashItem
|
FName: XMLString; // TODO: change to PHashItem
|
||||||
FInputEncoding: WideString;
|
FInputEncoding: XMLString;
|
||||||
FXMLEncoding: WideString;
|
FXMLEncoding: XMLString;
|
||||||
FPublicID: WideString;
|
FPublicID: XMLString;
|
||||||
FSystemID: WideString;
|
FSystemID: XMLString;
|
||||||
FNotationName: WideString;
|
FNotationName: XMLString;
|
||||||
FURI: WideString;
|
FURI: XMLString;
|
||||||
FReplacementText: WideString;
|
FReplacementText: XMLString;
|
||||||
FXMLVersion: TXMLVersion;
|
FXMLVersion: TXMLVersion;
|
||||||
FPrefetched: Boolean;
|
FPrefetched: Boolean;
|
||||||
FResolved: Boolean;
|
FResolved: Boolean;
|
||||||
@ -135,9 +135,9 @@ type
|
|||||||
|
|
||||||
TNotationDecl = class(TDTDObject)
|
TNotationDecl = class(TDTDObject)
|
||||||
public
|
public
|
||||||
FName: WideString;
|
FName: XMLString;
|
||||||
FPublicID: WideString;
|
FPublicID: XMLString;
|
||||||
FSystemID: WideString;
|
FSystemID: XMLString;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TDTDModel = class
|
TDTDModel = class
|
||||||
@ -149,10 +149,10 @@ type
|
|||||||
function GetEntities: THashTable;
|
function GetEntities: THashTable;
|
||||||
function GetNotations: THashTable;
|
function GetNotations: THashTable;
|
||||||
public
|
public
|
||||||
FName: WideString;
|
FName: XMLString;
|
||||||
FSystemID: WideString;
|
FSystemID: XMLString;
|
||||||
FPublicID: WideString;
|
FPublicID: XMLString;
|
||||||
FInternalSubset: WideString;
|
FInternalSubset: XMLString;
|
||||||
constructor Create(aNameTable: THashTable);
|
constructor Create(aNameTable: THashTable);
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
function Reference: TDTDModel;
|
function Reference: TDTDModel;
|
||||||
@ -391,7 +391,7 @@ begin
|
|||||||
FData^.FColonPos := aColonPos;
|
FData^.FColonPos := aColonPos;
|
||||||
FData^.FTypeInfo := Self;
|
FData^.FTypeInfo := Self;
|
||||||
FIsNamespaceDecl := ((Length(aName^.Key) = 5) or (aColonPos = 6)) and
|
FIsNamespaceDecl := ((Length(aName^.Key) = 5) or (aColonPos = 6)) and
|
||||||
(Pos(WideString('xmlns'), aName^.Key) = 1);
|
(Pos(XMLString('xmlns'), aName^.Key) = 1);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TAttributeDef.Destroy;
|
destructor TAttributeDef.Destroy;
|
||||||
@ -426,7 +426,7 @@ begin
|
|||||||
Result := True;
|
Result := True;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TAttributeDef.HasEnumToken(const aValue: WideString): Boolean;
|
function TAttributeDef.HasEnumToken(const aValue: XMLString): Boolean;
|
||||||
var
|
var
|
||||||
I: Integer;
|
I: Integer;
|
||||||
begin
|
begin
|
||||||
|
@ -37,7 +37,7 @@ procedure WriteHTML(Element: TDOMNode; AStream: TStream);
|
|||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses SysUtils, HTMLDefs;
|
uses SysUtils, HTMLDefs, xmlutils;
|
||||||
|
|
||||||
type
|
type
|
||||||
TSpecialCharCallback = procedure(c: WideChar) of object;
|
TSpecialCharCallback = procedure(c: WideChar) of object;
|
||||||
@ -51,11 +51,11 @@ type
|
|||||||
FCapacity: Integer;
|
FCapacity: Integer;
|
||||||
FLineBreak: string;
|
FLineBreak: string;
|
||||||
procedure wrtChars(Src: PWideChar; Length: Integer);
|
procedure wrtChars(Src: PWideChar; Length: Integer);
|
||||||
procedure wrtStr(const ws: WideString); {$IFDEF HAS_INLINE} inline; {$ENDIF}
|
procedure wrtStr(const ws: XMLString); {$IFDEF HAS_INLINE} inline; {$ENDIF}
|
||||||
procedure wrtChr(c: WideChar); {$IFDEF HAS_INLINE} inline; {$ENDIF}
|
procedure wrtChr(c: WideChar); {$IFDEF HAS_INLINE} inline; {$ENDIF}
|
||||||
procedure wrtIndent; {$IFDEF HAS_INLINE} inline; {$ENDIF}
|
procedure wrtIndent; {$IFDEF HAS_INLINE} inline; {$ENDIF}
|
||||||
procedure wrtQuotedLiteral(const ws: WideString);
|
procedure wrtQuotedLiteral(const ws: XMLString);
|
||||||
procedure ConvWrite(const s: WideString; const SpecialChars: TSetOfChar;
|
procedure ConvWrite(const s: XMLString; const SpecialChars: TSetOfChar;
|
||||||
const SpecialCharCallback: TSpecialCharCallback);
|
const SpecialCharCallback: TSpecialCharCallback);
|
||||||
procedure AttrSpecialCharCallback(c: WideChar);
|
procedure AttrSpecialCharCallback(c: WideChar);
|
||||||
procedure TextNodeSpecialCharCallback(c: WideChar);
|
procedure TextNodeSpecialCharCallback(c: WideChar);
|
||||||
@ -199,7 +199,7 @@ begin
|
|||||||
FBufPos := pb;
|
FBufPos := pb;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure THTMLWriter.wrtStr(const ws: WideString); { inline }
|
procedure THTMLWriter.wrtStr(const ws: XMLString); { inline }
|
||||||
begin
|
begin
|
||||||
wrtChars(PWideChar(ws), Length(ws));
|
wrtChars(PWideChar(ws), Length(ws));
|
||||||
end;
|
end;
|
||||||
@ -216,7 +216,7 @@ begin
|
|||||||
wrtChars(#10, 1);
|
wrtChars(#10, 1);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure THTMLWriter.wrtQuotedLiteral(const ws: WideString);
|
procedure THTMLWriter.wrtQuotedLiteral(const ws: XMLString);
|
||||||
var
|
var
|
||||||
Quote: WideChar;
|
Quote: WideChar;
|
||||||
begin
|
begin
|
||||||
@ -235,7 +235,7 @@ const
|
|||||||
AttrSpecialChars = ['<', '"', '&'];
|
AttrSpecialChars = ['<', '"', '&'];
|
||||||
TextSpecialChars = ['<', '>', '&'];
|
TextSpecialChars = ['<', '>', '&'];
|
||||||
|
|
||||||
procedure THTMLWriter.ConvWrite(const s: WideString; const SpecialChars: TSetOfChar;
|
procedure THTMLWriter.ConvWrite(const s: XMLString; const SpecialChars: TSetOfChar;
|
||||||
const SpecialCharCallback: TSpecialCharCallback);
|
const SpecialCharCallback: TSpecialCharCallback);
|
||||||
var
|
var
|
||||||
StartPos, EndPos: Integer;
|
StartPos, EndPos: Integer;
|
||||||
|
@ -23,7 +23,7 @@ unit XMLRead;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
SysUtils, Classes, DOM;
|
SysUtils, Classes, DOM, xmlutils;
|
||||||
|
|
||||||
type
|
type
|
||||||
TErrorSeverity = (esWarning, esError, esFatal);
|
TErrorSeverity = (esWarning, esError, esFatal);
|
||||||
@ -98,18 +98,18 @@ type
|
|||||||
private
|
private
|
||||||
FStream: TStream;
|
FStream: TStream;
|
||||||
FStringData: string;
|
FStringData: string;
|
||||||
FBaseURI: WideString;
|
FBaseURI: XMLString;
|
||||||
FSystemID: WideString;
|
FSystemID: XMLString;
|
||||||
FPublicID: WideString;
|
FPublicID: XMLString;
|
||||||
// FEncoding: string;
|
// FEncoding: string;
|
||||||
public
|
public
|
||||||
constructor Create(AStream: TStream); overload;
|
constructor Create(AStream: TStream); overload;
|
||||||
constructor Create(const AStringData: string); overload;
|
constructor Create(const AStringData: string); overload;
|
||||||
property Stream: TStream read FStream;
|
property Stream: TStream read FStream;
|
||||||
property StringData: string read FStringData;
|
property StringData: string read FStringData;
|
||||||
property BaseURI: WideString read FBaseURI write FBaseURI;
|
property BaseURI: XMLString read FBaseURI write FBaseURI;
|
||||||
property SystemID: WideString read FSystemID write FSystemID;
|
property SystemID: XMLString read FSystemID write FSystemID;
|
||||||
property PublicID: WideString read FPublicID write FPublicID;
|
property PublicID: XMLString read FPublicID write FPublicID;
|
||||||
// property Encoding: string read FEncoding write FEncoding;
|
// property Encoding: string read FEncoding write FEncoding;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -121,7 +121,7 @@ type
|
|||||||
constructor Create;
|
constructor Create;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
procedure Parse(Src: TXMLInputSource; out ADoc: TXMLDocument);
|
procedure Parse(Src: TXMLInputSource; out ADoc: TXMLDocument);
|
||||||
procedure ParseUri(const URI: WideString; out ADoc: TXMLDocument);
|
procedure ParseUri(const URI: XMLString; out ADoc: TXMLDocument);
|
||||||
function ParseWithContext(Src: TXMLInputSource; Context: TDOMNode;
|
function ParseWithContext(Src: TXMLInputSource; Context: TDOMNode;
|
||||||
Action: TXMLContextAction): TDOMNode;
|
Action: TXMLContextAction): TDOMNode;
|
||||||
property Options: TDOMParseOptions read FOptions;
|
property Options: TDOMParseOptions read FOptions;
|
||||||
@ -143,7 +143,7 @@ procedure RegisterDecoder(Proc: TGetDecoderProc);
|
|||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses
|
uses
|
||||||
UriParser, xmlutils, dtdmodel;
|
UriParser, dtdmodel;
|
||||||
|
|
||||||
const
|
const
|
||||||
PubidChars: TSetOfChar = [' ', #13, #10, 'a'..'z', 'A'..'Z', '0'..'9',
|
PubidChars: TSetOfChar = [' ', #13, #10, 'a'..'z', 'A'..'Z', '0'..'9',
|
||||||
@ -172,25 +172,25 @@ type
|
|||||||
FLineNo: Integer;
|
FLineNo: Integer;
|
||||||
LFPos: PWideChar;
|
LFPos: PWideChar;
|
||||||
FXML11Rules: Boolean;
|
FXML11Rules: Boolean;
|
||||||
FSystemID: WideString;
|
FSystemID: XMLString;
|
||||||
FCharCount: Cardinal;
|
FCharCount: Cardinal;
|
||||||
FStartNesting: Integer;
|
FStartNesting: Integer;
|
||||||
FXMLVersion: TXMLVersion;
|
FXMLVersion: TXMLVersion;
|
||||||
FXMLEncoding: WideString;
|
FXMLEncoding: XMLString;
|
||||||
function GetSystemID: WideString;
|
function GetSystemID: XMLString;
|
||||||
protected
|
protected
|
||||||
function Reload: Boolean; virtual;
|
function Reload: Boolean; virtual;
|
||||||
public
|
public
|
||||||
Kind: TXMLSourceKind;
|
Kind: TXMLSourceKind;
|
||||||
constructor Create(const AData: WideString);
|
constructor Create(const AData: XMLString);
|
||||||
procedure NextChar;
|
procedure NextChar;
|
||||||
procedure NewLine; virtual;
|
procedure NewLine; virtual;
|
||||||
function SkipUntil(var ToFill: TWideCharBuf; const Delim: TSetOfChar;
|
function SkipUntil(var ToFill: TWideCharBuf; const Delim: TSetOfChar;
|
||||||
wsflag: PBoolean = nil): WideChar; virtual;
|
wsflag: PBoolean = nil): WideChar; virtual;
|
||||||
procedure Initialize; virtual;
|
procedure Initialize; virtual;
|
||||||
function SetEncoding(const AEncoding: string): Boolean; virtual;
|
function SetEncoding(const AEncoding: string): Boolean; virtual;
|
||||||
function Matches(const arg: WideString): Boolean;
|
function Matches(const arg: XMLString): Boolean;
|
||||||
property SystemID: WideString read GetSystemID write FSystemID;
|
property SystemID: XMLString read GetSystemID write FSystemID;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
TXMLDecodingSource = class(TXMLCharSource)
|
TXMLDecodingSource = class(TXMLCharSource)
|
||||||
@ -241,7 +241,7 @@ type
|
|||||||
|
|
||||||
PForwardRef = ^TForwardRef;
|
PForwardRef = ^TForwardRef;
|
||||||
TForwardRef = record
|
TForwardRef = record
|
||||||
Value: WideString;
|
Value: XMLString;
|
||||||
Loc: TLocation;
|
Loc: TLocation;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -324,7 +324,7 @@ type
|
|||||||
procedure XML11_BuildTables;
|
procedure XML11_BuildTables;
|
||||||
function ParseQuantity: TCPQuant;
|
function ParseQuantity: TCPQuant;
|
||||||
procedure StoreLocation(out Loc: TLocation);
|
procedure StoreLocation(out Loc: TLocation);
|
||||||
function ValidateAttrSyntax(AttrDef: TAttributeDef; const aValue: WideString): Boolean;
|
function ValidateAttrSyntax(AttrDef: TAttributeDef; const aValue: XMLString): Boolean;
|
||||||
procedure ValidateAttrValue(AttrDef: TAttributeDef; attrData: PNodeData);
|
procedure ValidateAttrValue(AttrDef: TAttributeDef; attrData: PNodeData);
|
||||||
procedure AddForwardRef(Buf: PWideChar; Length: Integer);
|
procedure AddForwardRef(Buf: PWideChar; Length: Integer);
|
||||||
procedure ClearForwardRefs;
|
procedure ClearForwardRefs;
|
||||||
@ -373,7 +373,7 @@ type
|
|||||||
procedure RaiseNameNotFound;
|
procedure RaiseNameNotFound;
|
||||||
function CheckName(aFlags: TCheckNameFlags = []): Boolean;
|
function CheckName(aFlags: TCheckNameFlags = []): Boolean;
|
||||||
procedure CheckNCName;
|
procedure CheckNCName;
|
||||||
function ExpectName: WideString; // [5]
|
function ExpectName: XMLString; // [5]
|
||||||
function ParseLiteral(var ToFill: TWideCharBuf; aType: TLiteralType;
|
function ParseLiteral(var ToFill: TWideCharBuf; aType: TLiteralType;
|
||||||
Required: Boolean): Boolean;
|
Required: Boolean): Boolean;
|
||||||
procedure ExpectAttValue(attrData: PNodeData; NonCDATA: Boolean); // [10]
|
procedure ExpectAttValue(attrData: PNodeData; NonCDATA: Boolean); // [10]
|
||||||
@ -402,7 +402,7 @@ type
|
|||||||
function PrefetchEntity(AEntity: TEntityDecl): Boolean;
|
function PrefetchEntity(AEntity: TEntityDecl): Boolean;
|
||||||
procedure StartPE;
|
procedure StartPE;
|
||||||
function ParseRef(var ToFill: TWideCharBuf): Boolean; // [67]
|
function ParseRef(var ToFill: TWideCharBuf): Boolean; // [67]
|
||||||
function ParseExternalID(out SysID, PubID: WideString; // [75]
|
function ParseExternalID(out SysID, PubID: XMLString; // [75]
|
||||||
SysIdOptional: Boolean): Boolean;
|
SysIdOptional: Boolean): Boolean;
|
||||||
|
|
||||||
procedure BadPENesting(S: TErrorSeverity = esError);
|
procedure BadPENesting(S: TErrorSeverity = esError);
|
||||||
@ -411,7 +411,7 @@ type
|
|||||||
procedure ExpectChoiceOrSeq(CP: TContentParticle; MustEndIn: TObject);
|
procedure ExpectChoiceOrSeq(CP: TContentParticle; MustEndIn: TObject);
|
||||||
procedure ParseElementDecl;
|
procedure ParseElementDecl;
|
||||||
procedure ParseNotationDecl;
|
procedure ParseNotationDecl;
|
||||||
function ResolveResource(const ASystemID, APublicID, ABaseURI: WideString; out Source: TXMLCharSource): Boolean;
|
function ResolveResource(const ASystemID, APublicID, ABaseURI: XMLString; out Source: TXMLCharSource): Boolean;
|
||||||
procedure ProcessDefaultAttributes(ElDef: TElementDecl);
|
procedure ProcessDefaultAttributes(ElDef: TElementDecl);
|
||||||
procedure ProcessNamespaceAtts;
|
procedure ProcessNamespaceAtts;
|
||||||
function AddBinding(attrData: PNodeData): Boolean;
|
function AddBinding(attrData: PNodeData): Boolean;
|
||||||
@ -425,7 +425,7 @@ type
|
|||||||
procedure DTDReloadHook;
|
procedure DTDReloadHook;
|
||||||
procedure ConvertSource(SrcIn: TXMLInputSource; out SrcOut: TXMLCharSource);
|
procedure ConvertSource(SrcIn: TXMLInputSource; out SrcOut: TXMLCharSource);
|
||||||
function DoCDSect(ch: PWideChar; Count: Integer): TDOMNode;
|
function DoCDSect(ch: PWideChar; Count: Integer): TDOMNode;
|
||||||
procedure DoNotationDecl(const aName, aPubID, aSysID: WideString);
|
procedure DoNotationDecl(const aName, aPubID, aSysID: XMLString);
|
||||||
public
|
public
|
||||||
doc: TDOMDocument;
|
doc: TDOMDocument;
|
||||||
constructor Create; overload;
|
constructor Create; overload;
|
||||||
@ -548,7 +548,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TDOMParser.ParseUri(const URI: WideString; out ADoc: TXMLDocument);
|
procedure TDOMParser.ParseUri(const URI: XMLString; out ADoc: TXMLDocument);
|
||||||
var
|
var
|
||||||
Src: TXMLCharSource;
|
Src: TXMLCharSource;
|
||||||
begin
|
begin
|
||||||
@ -611,7 +611,7 @@ end;
|
|||||||
|
|
||||||
{ TXMLCharSource }
|
{ TXMLCharSource }
|
||||||
|
|
||||||
constructor TXMLCharSource.Create(const AData: WideString);
|
constructor TXMLCharSource.Create(const AData: XMLString);
|
||||||
begin
|
begin
|
||||||
inherited Create;
|
inherited Create;
|
||||||
FLineNo := 1;
|
FLineNo := 1;
|
||||||
@ -630,7 +630,7 @@ begin
|
|||||||
Result := True; // always succeed
|
Result := True; // always succeed
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TXMLCharSource.GetSystemID: WideString;
|
function TXMLCharSource.GetSystemID: XMLString;
|
||||||
begin
|
begin
|
||||||
if FSystemID <> '' then
|
if FSystemID <> '' then
|
||||||
Result := FSystemID
|
Result := FSystemID
|
||||||
@ -674,7 +674,7 @@ begin
|
|||||||
wsflag^ := wsflag^ or nonws;
|
wsflag^ := wsflag^ or nonws;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TXMLCharSource.Matches(const arg: WideString): Boolean;
|
function TXMLCharSource.Matches(const arg: XMLString): Boolean;
|
||||||
begin
|
begin
|
||||||
Result := False;
|
Result := False;
|
||||||
if (FBufEnd >= FBuf + Length(arg)) or Reload then
|
if (FBufEnd >= FBuf + Length(arg)) or Reload then
|
||||||
@ -983,9 +983,9 @@ begin
|
|||||||
Loc.LinePos := FSource.FBuf-FSource.LFPos;
|
Loc.LinePos := FSource.FBuf-FSource.LFPos;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TXMLTextReader.ResolveResource(const ASystemID, APublicID, ABaseURI: WideString; out Source: TXMLCharSource): Boolean;
|
function TXMLTextReader.ResolveResource(const ASystemID, APublicID, ABaseURI: XMLString; out Source: TXMLCharSource): Boolean;
|
||||||
var
|
var
|
||||||
AbsSysID: WideString;
|
AbsSysID: XMLString;
|
||||||
Filename: string;
|
Filename: string;
|
||||||
Stream: TStream;
|
Stream: TStream;
|
||||||
fd: THandle;
|
fd: THandle;
|
||||||
@ -1047,7 +1047,7 @@ end;
|
|||||||
|
|
||||||
procedure TXMLTextReader.ValidationErrorWithName(const Msg: string; LineOffs: Integer);
|
procedure TXMLTextReader.ValidationErrorWithName(const Msg: string; LineOffs: Integer);
|
||||||
var
|
var
|
||||||
ws: WideString;
|
ws: XMLString;
|
||||||
begin
|
begin
|
||||||
SetString(ws, FName.Buffer, FName.Length);
|
SetString(ws, FName.Buffer, FName.Length);
|
||||||
ValidationError(Msg, [ws], LineOffs);
|
ValidationError(Msg, [ws], LineOffs);
|
||||||
@ -1076,7 +1076,7 @@ end;
|
|||||||
procedure TXMLTextReader.DoErrorPos(Severity: TErrorSeverity; const descr: string; const ErrPos: TLocation);
|
procedure TXMLTextReader.DoErrorPos(Severity: TErrorSeverity; const descr: string; const ErrPos: TLocation);
|
||||||
var
|
var
|
||||||
E: EXMLReadError;
|
E: EXMLReadError;
|
||||||
sysid: WideString;
|
sysid: XMLString;
|
||||||
begin
|
begin
|
||||||
if Assigned(FSource) then
|
if Assigned(FSource) then
|
||||||
begin
|
begin
|
||||||
@ -1464,7 +1464,7 @@ begin
|
|||||||
FatalError('Name starts with invalid character');
|
FatalError('Name starts with invalid character');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TXMLTextReader.ExpectName: WideString;
|
function TXMLTextReader.ExpectName: XMLString;
|
||||||
begin
|
begin
|
||||||
CheckName;
|
CheckName;
|
||||||
SetString(Result, FName.Buffer, FName.Length);
|
SetString(Result, FName.Buffer, FName.Length);
|
||||||
@ -1709,7 +1709,7 @@ end;
|
|||||||
|
|
||||||
function TXMLTextReader.EntityCheck(NoExternals: Boolean): TEntityDecl;
|
function TXMLTextReader.EntityCheck(NoExternals: Boolean): TEntityDecl;
|
||||||
var
|
var
|
||||||
RefName: WideString;
|
RefName: XMLString;
|
||||||
cnt: Integer;
|
cnt: Integer;
|
||||||
begin
|
begin
|
||||||
Result := nil;
|
Result := nil;
|
||||||
@ -1923,7 +1923,7 @@ end;
|
|||||||
|
|
||||||
function TXMLTextReader.CreatePINode: TDOMNode;
|
function TXMLTextReader.CreatePINode: TDOMNode;
|
||||||
var
|
var
|
||||||
NameStr, ValueStr: WideString;
|
NameStr, ValueStr: DOMString;
|
||||||
begin
|
begin
|
||||||
SetString(NameStr, FName.Buffer, FName.Length);
|
SetString(NameStr, FName.Buffer, FName.Length);
|
||||||
SetString(ValueStr, FValue.Buffer, FValue.Length);
|
SetString(ValueStr, FValue.Buffer, FValue.Length);
|
||||||
@ -2267,7 +2267,7 @@ end;
|
|||||||
|
|
||||||
procedure TXMLTextReader.ParseNotationDecl; // [82]
|
procedure TXMLTextReader.ParseNotationDecl; // [82]
|
||||||
var
|
var
|
||||||
NameStr, SysID, PubID: WideString;
|
NameStr, SysID, PubID: XMLString;
|
||||||
begin
|
begin
|
||||||
ExpectWhitespace;
|
ExpectWhitespace;
|
||||||
NameStr := ExpectName;
|
NameStr := ExpectName;
|
||||||
@ -2280,7 +2280,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
const
|
const
|
||||||
AttrDataTypeNames: array[TAttrDataType] of WideString = (
|
AttrDataTypeNames: array[TAttrDataType] of XMLString = (
|
||||||
'CDATA',
|
'CDATA',
|
||||||
'ID',
|
'ID',
|
||||||
'IDREF',
|
'IDREF',
|
||||||
@ -3536,7 +3536,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TXMLTextReader.ParseExternalID(out SysID, PubID: WideString; // [75]
|
function TXMLTextReader.ParseExternalID(out SysID, PubID: XMLString; // [75]
|
||||||
SysIdOptional: Boolean): Boolean;
|
SysIdOptional: Boolean): Boolean;
|
||||||
var
|
var
|
||||||
I: Integer;
|
I: Integer;
|
||||||
@ -3569,7 +3569,7 @@ begin
|
|||||||
Result := True;
|
Result := True;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TXMLTextReader.ValidateAttrSyntax(AttrDef: TAttributeDef; const aValue: WideString): Boolean;
|
function TXMLTextReader.ValidateAttrSyntax(AttrDef: TAttributeDef; const aValue: XMLString): Boolean;
|
||||||
begin
|
begin
|
||||||
case AttrDef.DataType of
|
case AttrDef.DataType of
|
||||||
dtId, dtIdRef, dtEntity: Result := IsXmlName(aValue, FXML11) and
|
dtId, dtIdRef, dtEntity: Result := IsXmlName(aValue, FXML11) and
|
||||||
@ -3639,7 +3639,7 @@ end;
|
|||||||
|
|
||||||
function TXMLTextReader.DoCDSect(ch: PWideChar; Count: Integer): TDOMNode;
|
function TXMLTextReader.DoCDSect(ch: PWideChar; Count: Integer): TDOMNode;
|
||||||
var
|
var
|
||||||
s: WideString;
|
s: XMLString;
|
||||||
begin
|
begin
|
||||||
Assert(not FCDSectionsAsText, 'Should not be called when CDSectionsAsText=True');
|
Assert(not FCDSectionsAsText, 'Should not be called when CDSectionsAsText=True');
|
||||||
|
|
||||||
@ -3647,7 +3647,7 @@ begin
|
|||||||
result := doc.CreateCDATASection(s);
|
result := doc.CreateCDATASection(s);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TXMLTextReader.DoNotationDecl(const aName, aPubID, aSysID: WideString);
|
procedure TXMLTextReader.DoNotationDecl(const aName, aPubID, aSysID: XMLString);
|
||||||
var
|
var
|
||||||
Notation: TNotationDecl;
|
Notation: TNotationDecl;
|
||||||
Entry: PHashItem;
|
Entry: PHashItem;
|
||||||
|
@ -55,12 +55,12 @@ type
|
|||||||
FStream: TStream;
|
FStream: TStream;
|
||||||
FInsideTextNode: Boolean;
|
FInsideTextNode: Boolean;
|
||||||
FCanonical: Boolean;
|
FCanonical: Boolean;
|
||||||
FIndent: WideString;
|
FIndent: XMLString;
|
||||||
FIndentCount: Integer;
|
FIndentCount: Integer;
|
||||||
FBuffer: PChar;
|
FBuffer: PChar;
|
||||||
FBufPos: PChar;
|
FBufPos: PChar;
|
||||||
FCapacity: Integer;
|
FCapacity: Integer;
|
||||||
FLineBreak: WideString;
|
FLineBreak: XMLString;
|
||||||
FNSHelper: TNSSupport;
|
FNSHelper: TNSSupport;
|
||||||
FAttrFixups: TFPList;
|
FAttrFixups: TFPList;
|
||||||
FScratch: TFPList;
|
FScratch: TFPList;
|
||||||
@ -68,11 +68,11 @@ type
|
|||||||
procedure wrtChars(Src: PWideChar; Length: Integer);
|
procedure wrtChars(Src: PWideChar; Length: Integer);
|
||||||
procedure IncIndent;
|
procedure IncIndent;
|
||||||
procedure DecIndent; {$IFDEF HAS_INLINE} inline; {$ENDIF}
|
procedure DecIndent; {$IFDEF HAS_INLINE} inline; {$ENDIF}
|
||||||
procedure wrtStr(const ws: WideString); {$IFDEF HAS_INLINE} inline; {$ENDIF}
|
procedure wrtStr(const ws: XMLString); {$IFDEF HAS_INLINE} inline; {$ENDIF}
|
||||||
procedure wrtChr(c: WideChar); {$IFDEF HAS_INLINE} inline; {$ENDIF}
|
procedure wrtChr(c: WideChar); {$IFDEF HAS_INLINE} inline; {$ENDIF}
|
||||||
procedure wrtIndent; {$IFDEF HAS_INLINE} inline; {$ENDIF}
|
procedure wrtIndent; {$IFDEF HAS_INLINE} inline; {$ENDIF}
|
||||||
procedure wrtQuotedLiteral(const ws: WideString);
|
procedure wrtQuotedLiteral(const ws: XMLString);
|
||||||
procedure ConvWrite(const s: WideString; const SpecialChars: TSetOfChar;
|
procedure ConvWrite(const s: XMLString; const SpecialChars: TSetOfChar;
|
||||||
const SpecialCharCallback: TSpecialCharCallback);
|
const SpecialCharCallback: TSpecialCharCallback);
|
||||||
procedure WriteNSDef(B: TBinding);
|
procedure WriteNSDef(B: TBinding);
|
||||||
procedure NamespaceFixup(Element: TDOMElement);
|
procedure NamespaceFixup(Element: TDOMElement);
|
||||||
@ -247,7 +247,7 @@ begin
|
|||||||
FBufPos := pb;
|
FBufPos := pb;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TXMLWriter.wrtStr(const ws: WideString); { inline }
|
procedure TXMLWriter.wrtStr(const ws: XMLString); { inline }
|
||||||
begin
|
begin
|
||||||
wrtChars(PWideChar(ws), Length(ws));
|
wrtChars(PWideChar(ws), Length(ws));
|
||||||
end;
|
end;
|
||||||
@ -284,7 +284,7 @@ begin
|
|||||||
if FIndentCount>0 then dec(FIndentCount);
|
if FIndentCount>0 then dec(FIndentCount);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TXMLWriter.ConvWrite(const s: WideString; const SpecialChars: TSetOfChar;
|
procedure TXMLWriter.ConvWrite(const s: XMLString; const SpecialChars: TSetOfChar;
|
||||||
const SpecialCharCallback: TSpecialCharCallback);
|
const SpecialCharCallback: TSpecialCharCallback);
|
||||||
var
|
var
|
||||||
StartPos, EndPos: Integer;
|
StartPos, EndPos: Integer;
|
||||||
@ -381,7 +381,7 @@ const
|
|||||||
@TextnodeCanonicalCallback
|
@TextnodeCanonicalCallback
|
||||||
);
|
);
|
||||||
|
|
||||||
procedure TXMLWriter.wrtQuotedLiteral(const ws: WideString);
|
procedure TXMLWriter.wrtQuotedLiteral(const ws: XMLString);
|
||||||
var
|
var
|
||||||
Quote: WideChar;
|
Quote: WideChar;
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user