以文本方式查看主题

-  计算机科学论坛  (http://bbs.xml.org.cn/index.asp)
--  『 XML源码及示例(仅原创和转载) 』  (http://bbs.xml.org.cn/list.asp?boardid=32)
----  [求助]顺序读取XML文件标签的方法  (http://bbs.xml.org.cn/dispbbs.asp?boardid=32&rootid=&id=8356)


--  作者:jiangyuan1228
--  发布时间:6/18/2004 11:56:00 AM

--  [求助]顺序读取XML文件标签的方法
此XML文件的operSymbol标签存取运算符号的内容,operNumber标签存取运算数的内容,怎样顺序读取?有时第一位是运算数(标签内的内容解析出来的),有时第一位是符号(如:“(”)。  
例:怎么顺序读出(Row2Col4+Row2Col5)/2-Row2Col7  
<formula>  
   <operSymbol  ID="1087463962937">(</operSymbol>    
-  <operNumber  ID="1087463966359"  dateZone="year_2002"  deptZone="10000">  
   <tableName>e4e4e417fcfe09b300fcfe1e52a00001</tableName>    
   <baseRow>2</baseRow>    
   <baseCol>4</baseCol>    
   <content>Row2Col4</content>    
   </operNumber>  
   <operSymbol  ID="1087463970906">+</operSymbol>    
-  <operNumber  ID="1087463978921"  dateZone="year_2002"  deptZone="10000">  
   <tableName>e4e4e417fcfe09b300fcfe1e52a00001</tableName>    
   <baseRow>2</baseRow>    
   <baseCol>5</baseCol>    
   <content>Row2Col5</content>    
   </operNumber>  
   <operSymbol  ID="1087463982796">)</operSymbol>    
   <operSymbol  ID="1087463985484">/</operSymbol>    
   <operSymbol  ID="1087463986937">2</operSymbol>    
   <operSymbol  ID="1087464003265">-</operSymbol>    
-  <operNumber  ID="1087464010062"  dateZone="year_2002"  deptZone="10000">  
   <tableName>e4e4e417fcfe09b300fcfe1e52a00001</tableName>    
   <baseRow>2</baseRow>    
   <baseCol>7</baseCol>    
   <content>Row2Col7</content>    
   </operNumber>  
   </formula>  

W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
6,718.750ms