关于读取XML ( 积分: 50 )

  • 主题发起人 主题发起人 slqbs-gy
  • 开始时间 开始时间
S

slqbs-gy

Unregistered / Unconfirmed
GUEST, unregistred user!
XML格式如下:

<?xml version=&quot;1.0&quot; standalone=&quot;yes&quot;?>
<DocumentElement>
<Sheet>
<Catalog>01</Catalog>
<TableName>01-ASIC</TableName>
<SearchField>Part Type</SearchField>
<SearchField>IC Package</SearchField>
<SearchField>PCB Footprint</SearchField>
<Specification>PCB Footprint</Specification>
<Specification>Maker</Specification>
<Specification>Maker Part Number</Specification>
</Sheet>
<Sheet>
<Catalog>02</Catalog>
<TableName>02-Memory IC</TableName>
<SearchField>Part Type</SearchField>
<SearchField>Address Access Time (Unit : ns)</SearchField>
<SearchField>Package</SearchField>
<SearchField>PCB Footprint</SearchField>
<Specification>PCB Footprint</Specification>
<Specification>Maker</Specification>
<Specification>Maker Part Number</Specification>
</Sheet>
<Sheet>
<Catalog>06</Catalog>
<TableName>06-Virtual Capacitance</TableName>
<Specification>Value</Specification>
<Specification>Temperature Characteristics</Specification>
</Sheet>
</DocumentElement>
采用ReadXml()读取,数据存放到Dataset中便是三个表,格式分别如下:
表一:
Catalog TableName

01 01-ASIC
02 02-Memory IC
06 06-Virtual Capacitance

表二:
SearchField_text

Part Type
IC Package
PCB Footprint
Part Type
Address Access Time (Unit : ns)
Package
PCB Footprint

表三:
Specification_text

PCB Footprint
Maker
Maker Part Number
PCB Footprint
Maker
Maker Part Number
Value
Temperature Characteristics

现在问题是:怎么在这三个表之间建立关系呢?关系如下,当我读取“表一”的“01”时,那么“表二”的“Part Type”,“IC Package”,“PCB Footprint”以及“表三”的“PCB Footprint”,“Maker”,“Maker Part Number”的内容也能够同时获取。
静候佳音......
 
后退
顶部