CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Threaded View

  1. #1
    Join Date
    Oct 2005
    Posts
    20

    Help: How do we read such XML file in C++??

    Hi All,
    i have to make Xml Reader class in VC6(MFC) which could read an XML file(mentioned below) and extract information from it and use it for further processing, now the problem is this XML file has nested references within it's nodes....

    (partial XML file..)_______________________________________________________________

    <SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-
    ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-
    ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:clr="http://schemas.microsoft.com/soap/encoding/clr/1.0" SOAP-
    ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <SOAP-ENV:Body>
    <a1lgChildMonoRail id="ref-1"xmlns:a1="http://schemas.microsoft.com/clr/nsassem/EDS_Generator/Adv%2C%20Version%3D1.5.1.26410%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
    <Rail0 href="#ref-3"/>
    <NetworkingModule href="#ref-4"/>
    <Echelle>75</Echelle>
    <IslandParameters href="#ref-5"/>
    <BuildParameters href="#ref-6"/>
    <CanDragDropRailToRail>false</CanDragDropRailToRail>
    <m_Consommations href="#ref-7"/>
    <NbMaxTypeModule href="#ref-8"/>
    <m_TypeConfiguration xsi:type="a1:EnumTypeModule" xmlns:a1="http://schemas.microsoft.com/clr/nsassem/EDS_Generator/Adv%2C%20Version%3D1.5.1.26410%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">CanOpen</m_TypeConfiguration>
    </a1lgChildMonoRail>
    <a1:Rail id="ref-3" xmlns:a1="http://schemas.microsoft.com/clr/nsassem/EDS_Generator/AdvantysLite%2C%20Version%3D1.5.1.26410%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
    <Top>32</Top>
    <Left>10</Left>
    <RailName id="ref-9">Segment </RailName>
    <RailNumber>1</RailNumber>
    <BitmapPath id="ref-10">C:\Program Files\Adv\Bitmap\Rail.jpg</BitmapPath>
    <BitmapVidePath id="ref-11">C:\Program Files\Adv\Bitmap\RailVide.jpg</BitmapVidePath>
    <m_IsRailVide>false</m_IsRailVide>
    <Echelle>75</Echelle>
    <CanDragDropRailToRail>false</CanDragDropRailToRail>
    <IsNetworkingRail>true</IsNetworkingRail>
    <m_nbModuleMax href="#ref-12"/>
    <module0 href="#ref-13"/>
    <module1 href="#ref-14"/>
    <module2 href="#ref-15"/>
    <module3 href="#ref-16"/>
    <module4 href="#ref-17"/>
    <module5 href="#ref-18"/>
    <module6 href="#ref-19"/>
    <module7 href="#ref-4"/>
    </a1:Rail>
    <a1:Module id="ref-4"

    xmlns:a1="http://schemas.microsoft.com/clr/nsassem/EDS_Generator/AdvantysLite%2C%

    20Version%3D1.5.1.26410%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3Dnull">
    <Top>18</Top>
    <Left>0</Left>
    <Height>224</Height>
    <Width>120</Width>
    <Echelle>75</Echelle>
    <PositionOnRail>0</PositionOnRail>
    <RailNumber>1</RailNumber>
    <Module_Name id="ref-20">OTB 1C0 DM9LP</Module_Name>
    <Module_Number>0</Module_Number>
    <BitmapPath id="ref-21">OTB 1C0 DM9LP.jpg</BitmapPath>
    <Vendor_Code id="ref-22">0x0500005a</Vendor_Code>
    <Vendor_Name id="ref-23">Tele</Vendor_Name>
    <Version id="ref-24">255</Version>
    <Help_File href="#ref-25"/>
    <Help_Index href="#ref-26"/>
    <Description id="ref-27">The OTB 1C0 DM9LP is a Network Interface Module (NIM) for

    CANopen with following features:

    12 digital inputs,
    6 relay outputs,
    2 source transistor outputs,
    2 remote Fast Counters (RFC).

    Maximum data in PDO for this module:
    32 words input,
    32 words output.

    Maximum Analog :
    24 input channels,
    24 output channels.
    </Description>
    <TooltipInfo id="ref-28">Head CANopen bus Node</TooltipInfo>
    <CanBeMoved>false</CanBeMoved>
    <IsAtLeastOneColumnRuleInGrid href="#ref-29"/>
    <IdentificationCode>235</IdentificationCode>
    <IsNetworkingModule>true</IsNetworkingModule>
    <IsExtensibleModule>true</IsExtensibleModule>
    <ConfigurationModuleNumber>0</ConfigurationModuleNumber>
    <Revision id="ref-30">255</Revision>
    <Type_Module>1</Type_Module>
    <XmlNameFamily id="ref-31">FAMILY_MODULE_0</XmlNameFamily>
    <XmlNameModule id="ref-32">MODULE_0</XmlNameModule>
    <ConsommationCourant>0</ConsommationCourant>
    <m_Consommations href="#ref-33"/>
    <m_NbMaxTypeModule href="#ref-34"/>
    <ConsommationVoiesIN>0</ConsommationVoiesIN>
    <ConsommationVoiesOUT>0</ConsommationVoiesOUT>
    <AnalogOrTOR xsi:type="xsd:anyType" xsi:null="1"/>
    <m_IsModbus>false</m_IsModbus>
    <m_IsEthernet>false</m_IsEthernet>
    <m_ProductNumber id="ref-35">0xFEFB</m_ProductNumber>
    <m_RevisionNumber id="ref-36">0x10001</m_RevisionNumber>
    <Data href="#ref-37"/>
    <Rules href="#ref-38"/>
    <NbModuleMax href="#ref-39"/>
    <NetworkingModule href="#ref-4"/>
    <m_TabulationAndGridDefinition href="#ref-40"/>
    <m_ArrayTPDO href="#ref-41"/>
    <m_ArrayRPDO href="#ref-42"/>
    <m_ArrayTPDOSelected href="#ref-43"/>
    <m_ArrayRPDOSelected href="#ref-44"/>
    <m_SubObjectsSelectedInPDO href="#ref-45"/>
    <m_EthernetModbusSizeAvailable href="#ref-46"/>
    <m_EthernetModbusUsed href="#ref-47"/>
    <m_PDOHide xsi:type="xsd:anyType" xsi:null="1"/>
    <IOmapCompacted>false</IOmapCompacted>
    <ListSymboles href="#ref-48"/>
    </a1:Module>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    _______________________________________________________________

    As i am a newbee with XML i have no idea how to read such XML and extract data sequentially or from whichver elements required?, if you could provide a tutorial or some help i would really be very thankfull to you, Thanks in Advance!

    Regards,
    Prince
    ______________
    Last edited by princenrj23; August 8th, 2006 at 01:30 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured