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

Threaded View

  1. #1
    Join Date
    Aug 2001
    Location
    New York, USA
    Posts
    169

    Parsing XML Files

    I'm trying to parse every element/data out of some XML files (i.e. caseid, caseType, etc. shown below), but I'm stuck. I have tried several sample code/projects, but they don't work. The XML files I have to parse are similar to this:

    <ExampleXML>
    <CaseGroup>
    <clientid="client999"/>
    <clientid="client888"/>
    <datetime>02-12-2001 15:55</datetime>
    <case caseid="999999" caseType="Hard">

    <Result>
    <Value>ReceiptID</Value>
    <Data>12345</Data>
    </Result>
    <Result>
    <Value>WorkOrder</Value>
    <Data>54321</Data>
    </Result>
    <Result>
    <Value>ContactID</Value>
    <Data>666666</Data>
    </Result>
    <Result>
    <Value>Other</Value>
    <Data>888888</Data>
    </Result>
    <Extra>Extra data</Extra>
    <Other>Other Information</Other>
    </case>

    <NEWa>11111111111111111</NEWa>
    <NEWb>222222222222222222</NEWb>
    <NEWc>3333333333333333333</NEWc>
    </CaseGroup>



    <client clientid="client999">
    <FirstName>John</FirstName>
    <MiddleName>M.</MiddleName>
    <LastName>Smith</LastName>

    <ADDRESS>
    <Address1>999 Street<Address1>
    <City>CityName</City>
    <State>StateName</State>
    <PostalCode>111111</PostalCode>
    <Extra>XXXXXXXX</Extra>
    </ADDRESS>

    <OtherAddress>NONE</OtherAddress>
    <OtherLocation>NONE</OtherLocation>
    <CONTACTDETAIL>
    <CONTACTPOINT ContactPointRoleType="Home" ContactPointType="Phone">
    <ContactPointValue>9999999999</ContactPointValue>
    </CONTACTPOINT>
    <CONTACTPOINT ContactPointRoleType="Work" ContactPointType="Phone">
    <ContactPointValue>8888888888</ContactPointValue>
    </CONTACTPOINT>
    <CONTACTPOINT ContactPointRoleType="Work" ContactPointType="Fax">
    <ContactPointValue>6666666666</ContactPointValue>
    </CONTACTPOINT>
    <CONTACTPOINT ContactPointRoleType="Home" ContactPointType="Fax">
    <ContactPointValue>5555555555</ContactPointValue>
    </CONTACTPOINT>
    <CONTACTPOINT ContactPointRoleType="Work" ContactPointType="Cell">
    <ContactPointValue>4444444444</ContactPointValue>
    </CONTACTPOINT>
    <OtherFName>Joe</OtherFName>
    <OtherMName>M.</OtherMName>
    <OtherLName>Leverage</OtherLName>
    </CONTACTDETAIL>
    <OtherExtra>EmergencyContact</OtherExtra>
    </client>
    </ExampleXML>

    THANKS!!!!
    Last edited by enigmaos; September 29th, 2005 at 08:00 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