473,320 Members | 1,920 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Looking for some guidance...XML loop and process

Hi all,

I have an XML document that my app will accept and the document may have
more than one 'record' in the document (bear with me, I'm fairly new to XML
lingo).

Incoming document:
-----------Beginning of XML-----------
<?xml version="1.0" encoding="us-ascii"?>
<!--Product data from JDEdwards-->
<Root>
<Data PollDate="2003-10-21" PollTime="00.00.00">
<Product>
<File>F4450</File>
<Library>CODATA73</Library>
<ActionCode>C</ActionCode>
<TransDate>2003-10-21</TransDate>
<TransTime>05.28.56.612330</TransTime>
<Details Name="JDMCUS" Value=" 4014160000" />
<Details Name="JDALOT" Value="0110" />
<Details Name="JDSLKF" Value="C" />
<Details Name="JDCPJ" Value="103289" />
<Details Name="JDUSD5" Value="103112" />
<Details Name="JDUSD6" Value="103276" />
<Details Name="JDHSTY" Value="B" />
<Details Name="JDBYR" Value="187362" />
<OptionText Name="" Value="" />
</Product>
<Product>
<File>F4450</File>
<Library>CODATA73</Library>
<ActionCode>C</ActionCode>
<TransDate>2003-10-21</TransDate>
<TransTime>05.28.57.309718</TransTime>
<Details Name="JDMCUS" Value=" 4014200000" />
<Details Name="JDALOT" Value="4116" />
<Details Name="JDSLKF" Value="C" />
<Details Name="JDCPJ" Value="103289" />
<Details Name="JDUSD5" Value="103097" />
<Details Name="JDUSD6" Value="103261" />
<Details Name="JDHSTY" Value="B" />
<Details Name="JDBYR" Value="160291" />
<OptionText Name="" Value="" />
</Product>
</Data>
</Root>
-----------End of XML-----------

What I need to do is extract the data from the XML and process as
accordingly. Values I need to extract:

Record 1 -
sFile = "F4450"
sLibrary = "CODATA73"
sAction = "C"
sTranDate = "2003-10-21"
sTranTime = "05.28.56.612330"
sCenter = " 4014160000"
sNumber = "0110"
sArea = "C"
sDate1 = "103289"
sDate2 = "103112"
sDate3 = "103276"
sStatus = "B"
sResident = "187362"

I need to process the information from Record 1, once the processing is
complete, I need to loop and grab the next record values and process that
information.

Record 2 -
sFile = "F4450"
sLibrary = "CODATA73"
sAction = "C"
sTranDate = "2003-10-21"
sTranTime = "05.28.57.309718"
sCenter = " 4014200000"
sNumber = "4116"
sArea = "C"
sDate1 = "103289"
sDate2 = "103097"
sDate3 = "103261"
sStatus = "B"
sResident = "160291"

I've thought about bring the XML into a dataset and managing the extractions
that way but if there are any faster/more efficient ways to read XML, please
let me know.

TIA
-Rich
Nov 12 '05 #1
1 1499
Rich Wallace wrote:
I've thought about bring the XML into a dataset and managing the extractions
that way but if there are any faster/more efficient ways to read XML, please
let me know.


Usually the most efficient way to read XML is to keep the lowest
processing level - XmlReader. If you don't need complex queries (when
piece of information you need depends on some others) XMLReader is the
best tool.
--
Oleg Tkachenko
XmlInsider
http://blog.tkachenko.com
Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: fdsl ysnh | last post by:
--- python-list-request@python.orgдµÀ: > Send Python-list mailing list submissions to > python-list@python.org > > To subscribe or unsubscribe via the World Wide Web, > visit >...
11
by: Lues | last post by:
Hi, I'm trying to protect some data in tables with encription (you know why, don't you ;)) I must confess that I'm not very expirienced in writing code, especially encription code. Can any...
8
by: Cider123 | last post by:
I ran into a situation where my Window Service had to process 100,000+ files, when I first noticed I needed to tweak various routines. Everything runs fine, but here's what I ran into: In the...
5
by: Realtime | last post by:
How do I go about writing a php application that will alert people in a database from different RSS news feeds from different sites. So lets say we have a database and user A has a list of news...
6
by: Bob Alston | last post by:
I am looking for others who have built systems to scan documents, index them and then make them accessible from an Access database. My environment is a nonprofit with about 20-25 case workers who...
11
by: Cliff Martin | last post by:
Hi, I am reading a fairly large file a line at a time, doing some processing, and filtering out bits of the line. I am storing the interesting information in a struct and then printing it out....
0
by: darius | last post by:
Hi, having gps navigation web pages I am still curious about voice guidance algorithms/ applications incorporated into navigation systems. I would appreciate your guidance in accessing the...
2
by: Stephen Plotnick | last post by:
I'm looking for the best way to do a new project. I'm fairly good at VB 2005. I'm really good at Excel, including 2007. I've never done macros in Excel but if that is the option needed I would...
16
by: graham.keellings | last post by:
hi, I'm looking for an open source memory pool. It's for use on an embedded system, if that makes any difference. Something with garbage collection/defragmentation would be nice. It should have...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.