以文本方式查看主题

-  计算机科学论坛  (http://bbs.xml.org.cn/index.asp)
--  『 DOM/SAX/XPath 』  (http://bbs.xml.org.cn/list.asp?boardid=11)
----  怎么样用C实现xml中子节点的遍历,并把XML转化成数据结构(结构体)的形式  (http://bbs.xml.org.cn/dispbbs.asp?boardid=11&rootid=&id=65523)


--  作者:dzj19800516
--  发布时间:8/7/2008 10:46:00 AM

--  怎么样用C实现xml中子节点的遍历,并把XML转化成数据结构(结构体)的形式
怎么样用C实现xml中子节点的遍历,并把XML转化成数据结构(结构体)的形式,如
<?xml version="1.0" encoding="UTF-8"?>

<UU_RRC_CONN_SETUP_CMP_UNION type="union">
   <sRrcConnSetupCmpR8 type="struct">
      <ucSelectedPlmnId type="UINT8">1</ucSelectedPlmnId >
      <bIsRegisteredMmePresent type="UINT8">2</bIsRegisteredMmePresent>

      <sRegisteredMme type="struct">
         <sMcc type="struct">
            <aucItem arraylength="3" type="UINT8">333</aucItem>
         </sMcc>

         <sMnc type="struct">
            <ucCnt type="UINT8">4</ucCnt>
            <aucItem arraylength="3" type="UINT8">123</aucItem>
         </sMnc>

         <sMmeGropuId type="struct">
            <aucItem arraylength="2" type="UINT8">34</aucItem>
         </sMmeGropuId>

         <sMmeCode type="struct">
            <aucItem arraylength="1" type="UINT8">5</aucItem>
         </sMmeCode>
      </sRegisteredMme>

      <sNasDedicatedInfo type="struct">
         <usCnt type="UINT16">24</usCnt>
         <aucItem arraylength="4095" type="UINT8">1234567890</aucItem>
      </sNasDedicatedInfo>
   </sRrcConnSetupCmpR8>

   <sCriticalExt type="UINT8"/>
</UU_RRC_CONN_SETUP_CMP_UNION>
把它转成数据结构的形式。


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