我正在使用eclipse在TTCN-3中编写测试用例。在测试案例之一,我从模拟器的响应,其包括多条记录的XML字符串,如下:解析TTCN中的XML字符串
<Templates><Template><Id>1001</Id><Category>refill</Category><Description>Template description</Description><ApplicationId>AIR</ApplicationId><Name>Template name</Name><SchemaVersion>3.3.14</SchemaVersion></Template><Template><Id>1002</Id><Category>refill</Category><Description>Template Description 1</Description><ApplicationId>AIR</ApplicationId><Name>Template name</Name><SchemaVersion>3.3.14</SchemaVersion></Template></Templates>
现在,我需要解析这个XML字符串并获得模板对象出来的在测试用例中进一步使用它们。
这里是模板对象的定义:
public type record Template
{
charstring id,
charstring category,
charstring description,
charstring applicationId,
charstring name,
charstring schemaVersion
}
public type record of Template Templates;
我是新来的TTCN,所以任何的帮助深表感谢。谢谢。