首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

Delphi使用NativeXml处理XML(三)

TXmlNode = class(TPersistent)   该TXmlNode代表在XML文件中的元素。每个TNativeXml拥有一个根(Root)元素。在根元素下面,子元素可以嵌套(没有限制有多深)。ElementType属性定义这个节点是什么类型的元素。 4.1.16.1.AttributeByName   property AttributeByName [const AName: UTF8String]: UTF8String;   AttributeByName返回的指定属性名称AName的属性的值。设置AttributeByName可以添加这个属性到属性列表,或取代现有的属性。 4.1.16.2.AttributeByNameWide   property AttributeByNameWide [const AName: UTF8String]: UnicodeString;   AttributeByName返回的指定属性名称AName的属性的UnicodeString类型值。设置AttributeByName可以添加这个属性到属性列表,或取代现有的属性。 4.1.16.3.AttributeCount   property AttributeCount: integer;   返回当前节点的属性数量。 4.1.16.4.AttributeName   property AttributeName [Index: integer]: UTF8String;   根据索引(Index)读属性的名字。注意,属性索引是从0开始的,索引(Index)值从0到AttributeCount – 1。 4.1.16.5.AttributePair   property AttributePair [Index: integer]: UTF8String;   根据索引(Index)读属性的名字与值,这个返回的UTF8String字符串中的名字(Name)与值(Value)用TAB符号(#9)分割。 注:实际上是用等号(=)分割的。这个值中的转义字符(escape)没有转换。 4.1.16.6.AttributeValue   property AttributeValue [Index: integer]: UTF8String;   根据索引(Index)读这个属性,返回UTF8String类型的属性值;写这个属性,则设置UTF8String类型的属性值。 4.1.16.7.AttributeValueAsInteger   property AttributeValueAsInteger [Index: integer]: integer;   根据索引(Index)读这个属性,返回Integer类型的属性值,如果这个值不能转换,返回0;写这个属性,则设置Integer类型的属性值。 4.1.16.8.AttributeValueAsUnicodeString   property AttributeValueAsUnicodeString [Index: integer]: UnicodeString;   根据索引(Index)读这个属性,返回UnicodeString类型的属性值;写这个属性,则设置UnicodeString类型的属性值。 4.1.16.9.AttributeValueDirect   property AttributeValueDirect [Index: integer]: UTF8String;   设置或获取这个原始属性值,可以回避转义字符转换(escape)函数。你不能在这个值中设置&和引用(quote)Ansi字符,或者XML不支持的字符。 注:这个值中的转义(escape)字符不会被转换。 4.1.16.10.BinaryEncoding   property BinaryEncoding: TBinaryEncodingType;   BinaryEncoding 属性值用于返回或设置父文档(Parent Document)的BinaryEncoding 属性值。 4.1.16.11.BinaryString   property BinaryString: RawByteString;   使用BinaryString可以读写Base64编码格式的节点值。如果是标准的文本信息,不使用这个方法,而是ValueAsString。 4.1.16.12.CascadedName   property CascadedName: UTF8String;   这个属性返回当前节点的名字及索引,并级联递归上层节点到根节点。各节点信息利用下划线(_)分割。 注:很奇怪,根节点竟然有一个父节点,而且那个节点没有写入文件。这个属性会返回那个奇怪节点的索引0。 4.1.16.1

02
您找到你想要的搜索结果了吗?
是的
没有找到
领券