Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Closed Thread
 
Thread Tools Display Modes
  #1  
Old 08-23-2019, 03:08 PM
FreakaZoid2 FreakaZoid2 is offline
Senior Member
 
Join Date: Jul 2009
Posts: 361
Default String Parsing of XML document

I have about 200,000 plus XML documents to parse that contain client details. so data is not repeating nodes. same node structure from file to file. I have it working with the xmldocument interface/parsing but it is taking a long time to read/parse those files and am wanting to rewrite using stringlist/string to parse the data. but I am writing a bunch of if position, copy(…) type of commands and figured someone has got to have a better idea of how to parse these xml files



























  #2  
Old 08-23-2019, 03:12 PM
FreakaZoid2 FreakaZoid2 is offline
Senior Member
 
Join Date: Jul 2009
Posts: 361
Default

HTML Code:
<ClientInfo>
  <CityID>CCCCCCCCCCCCCCCCCC</CityID>
  <CityName>NNNNNNNNNNNNNNN</CityName>
  <UserName>uuuuuuuu</UserName>
  <DateTime>2017-12-01 11:00:45</DateTime>
  <OpSystem>WIN/NT</OpSystem>
  <Apps>
    <AppsD Application="AA" Licensed="false" Version="VVVVV" Patch="ppp" Release="r" LastUpdateDate="00000000" LastUpdateTime="00000000" LastUpdateUser="NA" />
    <AppsD Application="AB" Licensed="true" Version="vvvvv" Patch="ppp" Release="rr" LastUpdateDate="20171201" LastUpdateTime="11000615" LastUpdateUser="uuu" />
    <AppsD Application="AC" Licensed="false" Version="vvvvv" Patch="ppp" Release="rrr" LastUpdateDate="00000000" LastUpdateTime="00000000" LastUpdateUser="NA" />
  </Apps>
  <AppsInfo>
    <AA>
      <AA_Records>
        <AA_Record ImageType="iiiii" AllowEMail="false" NotificationLevel="None" NotificationEMail="" UseDMS="false" />
        <AA_Record ImageType="iiiii" AllowEMail="false" NotificationLevel="None" NotificationEMail="" UseDMS="false" />
      </AA_Records>
    </AA>
    <AB>
      <AB_System Number="9999999" Title="tttttt" Address1="101 Main" Address2="" City="cccccc" State="ss" Zip="99999" Phone="111-222-3333" Footer1="" Footer2="" Footer3="" Footer4="" Interface="none" />
      <AB_Apps>
        <AB_aa Used="true" Auto="false" />
        <AB_ab Used="true" Auto="false" />
      </AB_Apps>
      <AB_Methods>
        <AB_Method Code="c1" Description="ddddddd" Type="tttt" AB_Type="NA" />
        <AB_Method Code="c2" Description="dddddddd" Type="ttttt" AB_Type="Online" />
      </AB_Methods>
      <AB_Codes>
        <AB_Code Code="abab" Description="dddddd" Account="aaaaa" />
      </AB_Codes>
    </AB>
  </AppsInfo>
</ClientInfo>
  #3  
Old 08-23-2019, 06:14 PM
rojam rojam is offline
Senior Member
 
Join Date: Jun 2015
Posts: 198
Default

Have you tried using TClientDataSet? I believe it can read and write to an XML file and you get the benefit of being able to hit the data as a table.
Check out: http://docs.embarcadero.com/products...dFromFile.html

You'll probably need to prep the data by using TXMLTransform.
  #4  
Old 08-23-2019, 09:37 PM
FreakaZoid2 FreakaZoid2 is offline
Senior Member
 
Join Date: Jul 2009
Posts: 361
Default my stupidity

the xml parsing is plenty fast, its the select, (insert/update) that is taking so long. I will see about testing/implement clientdatasets.


Thanks everyone.
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 10:47 AM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.