Delphi操作XML:变量与常量
4.4.变量(Variables)
Unit
NativeXml;
cDefaultBinaryEncoding:
TBinaryEncodingType = xbeBase64;
cDefaultDropCommentsOnParse:
boolean = False;
cDefaultEncodingString:
UTF8String = 'UTF-8';
cDefaultExternalEncoding:
TStringEncodingType = seUTF8;
cDefaultFloatAllowScientific:
boolean = True;
cDefaultFloatSignificantDigits:
integer = 6;
cDefaultIndentString:
UTF8String = ' ';
cDefaultUseFullNodes:
boolean = False;
cDefaultUseLocalBias:
boolean = False;
cDefaultVersionString:
UTF8String = '1.0';
cDefaultWriteOnDefault:
boolean = True;
cDefaultXmlFormat:
TXmlFormatType = xfCompact;
4.5.常量(Constants)
4.5.1.Unit: NativeXml
cBase64Char:
array[0..63] of AnsiChar =
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
这些Ansi符号用于从数据缓冲区生成BASE64字符时使用。
cBase64PadChar:
AnsiChar = '=';
cBomInfoCount
= 15;
cBomInfo:
array[0..cBomInfoCount - 1] of TBomInfo =
( (BOM: ($00,$00,$FE,$FF); Len: 4; Encoding: seUCS4BE; HasBOM:
true),
(BOM: ($FF,$FE,$00,$00); Len: 4; Encoding: seUCS4LE; HasBOM:
true),
(BOM: ($00,$00,$FF,$FE); Len: 4; Encoding: seUCS4_2143; HasBOM:
true),
(BOM: ($FE,$FF,$00,$00); Len: 4; Encoding: seUCS4_3412;
HasBOM: true),
(BOM: ($FE,$FF,$00,$00); Len: 2; Encoding: seUTF16BE;
HasBOM: true),
(BOM: ($FF,$FE,$00,$00); Len: 2; Encoding: seUTF16LE;
HasBOM: true),
(BOM: ($EF,$BB,$BF,$00); Len: 3; Encoding: seUTF8; HasBOM:
true),
(BOM: ($00,$00,$00,$3C); Len: 4; Encoding: seUCS4BE; HasBOM: false),
(BOM: ($3C,$00,$00,$00);
Len: 4; Encoding: seUCS4LE; HasBOM: false),
(BOM: ($00,$00,$3C,$00);
Len: 4; Encoding: seUCS4_2143; HasBOM: false),
(BOM: ($00,$3C,$00,$00);
Len: 4; Encoding: seUCS4_3412; HasBOM: false),
(BOM: ($00,$3C,$00,$3F); Len: 4; Encoding: seUTF16BE; HasBOM:
false),
(BOM: ($3C,$00,$3F,$00); Len: 4; Encoding: seUTF16LE; HasBOM:
false),
(BOM: ($3C,$3F,$78,$6D); Len: 4; Encoding: seAnsi;
HasBOM: false),
(BOM: ($4C,$6F,$A7,$94); Len: 4; Encoding: seEBCDIC;
HasBOM: false) );
cControlChars:
set of AnsiChar = [#9, #10, #13, #32];
Tab, LF, CR,
Space
cEscapeCount
= 5;
不同的转义字符数
cEscapes:
array[0..cEscapeCount - 1] of UTF8String = ('&', '<', '>',
'''', '"');
这些都是必须转义字符。
cHexChar:
array[0..15] of AnsiChar = '0123456789ABCDEF';
这些常数用于从数据缓冲区生成hex字符
cHexCharLoCase:
array[0..15] of AnsiChar = '0123456789abcdef';
cMaxBufferSize
= $10000;
65536字节的缓冲区
cNativeXmlVersion
= '3.10';
NativeXml单元的当前版本
cNodeValueBuf
= 2048;
在每个值的缓冲区增加分配的字节数
cQuoteChars:
set of AnsiChar = ['"', ''''];
cReplaces:
array[0..cEscapeCount - 1] of UTF8String = ('&', '<',
'>', ''', '"');
这些字符串替换转义字符
- 相同的顺序
cTags:
array[0..cTagCount - 1] of TTagType = ( (FClose: '>]]'; FStart:
'[ATADC[!<'), (FClose: '>--'; FStart: '--!<'), (FClose: '>?';
FStart: '?<'), (FClose: '>'; FStart: '<') );
sxeCannotConverToBool
= 'Cannot convert value to bool';
sxeCannotConvertToFloat
= 'Cannot convert value to float';
sxeDeclarationMustBeFirstElem
= 'Xml declaration must be first element';
sxeDoctypeAfterRootElement
= 'Doctype declaration found after root element';
sxeIllegalElementType
= 'Illegal element type';
sxeMoreThanOneDeclaration
= 'More than one xml declaration found in xml';
sxeMoreThanOneDoctype
= 'More than one doctype declaration found in root';
sxeSignificantDigitsOutOfRange
= 'Significant digits out of range';
sxeXm
= 'XML Node is not assigned';lNodeNotAssigned
xcAll:
TXmlCompareOptions = [xcNodeName, xcNodeType, xcNodeValue, xcAttribCount,
xcAttribNames, xcAttribValues, xcChildCount, xcChildNames, xcChildValues,
xcRecursive];
4.5.2.Unit:NativeXmlObjectStorage
sxrInvalidPropertyValue =
'Invalid property value';
sxrUnregisteredClassType =
'Unregistered classtype encountered in ';
sxwIllegalVarType =
'Illegal variant type';
sxwInvalidMethodName =
'Invalid method name';