Delphi Pages Forums

Delphi Pages Forums (
-   General (
-   -   [SOLVED] String Parsing of XML document (

FreakaZoid2 08-23-2019 03:08 PM

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
<APPSD LastUpdateUser="NA" LastUpdateTime="00000000" LastUpdateDate="00000000" Release="r" Patch="ppp" Version="VVVVV" Licensed="false" Application="AA" />
<APPSD LastUpdateUser="uuu" LastUpdateTime="11000615" LastUpdateDate="20171201" Release="rr" Patch="ppp" Version="vvvvv" Licensed="true" Application="AB" />
<APPSD LastUpdateUser="NA" LastUpdateTime="00000000" LastUpdateDate="00000000" Release="rrr" Patch="ppp" Version="vvvvv" Licensed="false" Application="AC" />
<AA_RECORD UseDMS="false" NotificationEMail="" NotificationLevel="None" AllowEMail="false" ImageType="iiiii" />
<AA_RECORD UseDMS="false" NotificationEMail="" NotificationLevel="None" AllowEMail="false" ImageType="iiiii" />
<AB_SYSTEM title=tttttt Interface="none" Footer4="" Footer3="" Footer2="" Footer1="" Phone="111-222-3333" Zip="99999" State="ss" City="cccccc" Address2="" Address1="101 Main" Number="9999999" />
<AB_AA Auto="false" Used="true" />
<AB_AB Auto="false" Used="true" />
<AB_METHOD AB_Type="NA" Type="tttt" Description="ddddddd" Code="c1" />
<AB_METHOD AB_Type="Online" Type="ttttt" Description="dddddddd" Code="c2" />
<AB_CODE Description="dddddd" Code="abab" Account="aaaaa" />

FreakaZoid2 08-23-2019 03:12 PM

HTML Code:

  <DateTime>2017-12-01 11:00:45</DateTime>
    <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" />
        <AA_Record ImageType="iiiii" AllowEMail="false" NotificationLevel="None" NotificationEMail="" UseDMS="false" />
        <AA_Record ImageType="iiiii" AllowEMail="false" NotificationLevel="None" NotificationEMail="" UseDMS="false" />
      <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_aa Used="true" Auto="false" />
        <AB_ab Used="true" Auto="false" />
        <AB_Method Code="c1" Description="ddddddd" Type="tttt" AB_Type="NA" />
        <AB_Method Code="c2" Description="dddddddd" Type="ttttt" AB_Type="Online" />
        <AB_Code Code="abab" Description="dddddd" Account="aaaaa" />

rojam 08-23-2019 06:14 PM

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:

You'll probably need to prep the data by using TXMLTransform.

FreakaZoid2 08-23-2019 09:37 PM

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.

All times are GMT. The time now is 04:49 AM.

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