By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,192 Members | 1,784 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,192 IT Pros & Developers. It's quick & easy.

Best Practice - XML processing??

P: n/a
Hey all,

I have an XML doc that I read into a SQL Server database from an integration
feed....

----------------XML snippet ----------------
<?xml version="1.0" encoding="us-ascii"?>
<!--Product data from JDEdwards-->
<Root>
<Root RvcDate="2004-02-03" RcvTime="14.16.03.795135">
<Product>
<File>1234A</File>
<Library>XCOMM</Library>
<ActionCode>A</ActionCode>
<TransDate>2004-02-03</TransDate>
<TransTime>14.18.39.337626</TransTime>
<Details Name="JBMCUS" Value="1234567890" />
<Details Name="JBALOT" Value="1234" />
<Details Name="JBSEQ2" Value="00856" />
<Details Name="JBLTP" Value="123456.00" />
<Details Name="JBADD1" Value="1234 Garrity Way" />
<Details Name="JBDL01" Value="" />
<Details Name="JBRDJ" Value="000000" />
<Details Name="JBFD01" Value="" />
<Details Name="JBUSD1" Value="000000" />
</Product>
<Product>
<File>1234B</File>
<Library>XCOMM</Library>
<ActionCode>A</ActionCode>
<TransDate>2004-02-03</TransDate>
<TransTime>14.18.39.337923</TransTime>
<Details Name="JBMCUS" Value="1234567890" />
<Details Name="JBALOT" Value="4567" />
<Details Name="JBSEQ2" Value="00856" />
<Details Name="JBLTP" Value="123456.00" />
<Details Name="JBADD1" Value="4567 Garrity Way" />
<Details Name="JBDL01" Value="" />
<Details Name="JBRDJ" Value="000000" />
<Details Name="JBFD01" Value="" />
<Details Name="JBUSD1" Value="000000" />
</Product>
<Product>
<File>1234A</File>
<Library>XCOMM</Library>
<ActionCode>A</ActionCode>
<TransDate>2004-02-03</TransDate>
<TransTime>14.18.39.412541</TransTime>
<Details Name="JBMCUS" Value="1234567890" />
<Details Name="JBALOT" Value="9876" />
<Details Name="JBSEQ2" Value="00856" />
<Details Name="JBLTP" Value="123456.00" />
<Details Name="JBADD1" Value="9876 Main St" />
<Details Name="JBDL01" Value="" />
<Details Name="JBRDJ" Value="000000" />
<Details Name="JBFD01" Value="" />
<Details Name="JBUSD1" Value="000000" />
</Product>
</Root>
</Root>
----------------End XML snippet ----------------

Currently, I load the XML into a dataset and loop on each datarow in the
dataset and process each row as an individual transaction. I'm curious to
know if there is a 'standard' approach on completing the goal and if the
path I've selected if efficient or is there a better way?

Suggestions or any kind of feedback would be appreciated.

TIA
-Rich
Nov 12 '05 #1
Share this Question
Share on Google+
10 Replies


P: n/a
Rich - how big does you Xml doc get?
To be honest I was very happy with the SqlXml and Bulk Upload stuff for this
kind of work - mainly as it does a lot of the stuff for you. It also
supports transactions if required and itself runs transactionally when bulk
uploading.
Have you looked at that? It might be overkill if your document isn't too
large, but even for reasonable sized documents i found it to be much better
than writing streams of code.

Have a look at the post "Automagically create database schema from XML
dataset" from Fed 2nd for more info.

Steven
Founder, http://venturetogether.com

"Rich Wallace" <as**@qwerty.com> wrote in message
news:uJ*************@TK2MSFTNGP12.phx.gbl...
Hey all,

I have an XML doc that I read into a SQL Server database from an integration feed....

----------------XML snippet ----------------
<?xml version="1.0" encoding="us-ascii"?>
<!--Product data from JDEdwards-->
<Root>
<Root RvcDate="2004-02-03" RcvTime="14.16.03.795135">
<Product>
<File>1234A</File>
<Library>XCOMM</Library>
<ActionCode>A</ActionCode>
<TransDate>2004-02-03</TransDate>
<TransTime>14.18.39.337626</TransTime>
<Details Name="JBMCUS" Value="1234567890" />
<Details Name="JBALOT" Value="1234" />
<Details Name="JBSEQ2" Value="00856" />
<Details Name="JBLTP" Value="123456.00" />
<Details Name="JBADD1" Value="1234 Garrity Way" />
<Details Name="JBDL01" Value="" />
<Details Name="JBRDJ" Value="000000" />
<Details Name="JBFD01" Value="" />
<Details Name="JBUSD1" Value="000000" />
</Product>
<Product>
<File>1234B</File>
<Library>XCOMM</Library>
<ActionCode>A</ActionCode>
<TransDate>2004-02-03</TransDate>
<TransTime>14.18.39.337923</TransTime>
<Details Name="JBMCUS" Value="1234567890" />
<Details Name="JBALOT" Value="4567" />
<Details Name="JBSEQ2" Value="00856" />
<Details Name="JBLTP" Value="123456.00" />
<Details Name="JBADD1" Value="4567 Garrity Way" />
<Details Name="JBDL01" Value="" />
<Details Name="JBRDJ" Value="000000" />
<Details Name="JBFD01" Value="" />
<Details Name="JBUSD1" Value="000000" />
</Product>
<Product>
<File>1234A</File>
<Library>XCOMM</Library>
<ActionCode>A</ActionCode>
<TransDate>2004-02-03</TransDate>
<TransTime>14.18.39.412541</TransTime>
<Details Name="JBMCUS" Value="1234567890" />
<Details Name="JBALOT" Value="9876" />
<Details Name="JBSEQ2" Value="00856" />
<Details Name="JBLTP" Value="123456.00" />
<Details Name="JBADD1" Value="9876 Main St" />
<Details Name="JBDL01" Value="" />
<Details Name="JBRDJ" Value="000000" />
<Details Name="JBFD01" Value="" />
<Details Name="JBUSD1" Value="000000" />
</Product>
</Root>
</Root>
----------------End XML snippet ----------------

Currently, I load the XML into a dataset and loop on each datarow in the
dataset and process each row as an individual transaction. I'm curious to
know if there is a 'standard' approach on completing the goal and if the
path I've selected if efficient or is there a better way?

Suggestions or any kind of feedback would be appreciated.

TIA
-Rich

Nov 12 '05 #2

P: n/a
Hi Steven,

The XML document that I accept can contain anywhere from 1 <Product> to 500.
Unfortunately, what I need to do isn't as simple as doing a bulk load as I
have to perform several business rules and other checks and balances before
the data gets pushed to SQL. The way I drive the data into the database is
via parameterized stored procedures so I don't actually push XML data into
the table, rather parsed out data from the XML.

I feel that working with datasets are quite fast and efficient but I always
question my selection as the standby 'There has to be a better way!!!"

Thanks for your input.
-Rich

"Steven Livingstone" <s.***********@nospam.btinternet.com> wrote in message
news:uT**************@TK2MSFTNGP12.phx.gbl...
Rich - how big does you Xml doc get?
To be honest I was very happy with the SqlXml and Bulk Upload stuff for this kind of work - mainly as it does a lot of the stuff for you. It also
supports transactions if required and itself runs transactionally when bulk uploading.
Have you looked at that? It might be overkill if your document isn't too
large, but even for reasonable sized documents i found it to be much better than writing streams of code.

Have a look at the post "Automagically create database schema from XML
dataset" from Fed 2nd for more info.

Steven
Founder, http://venturetogether.com

"Rich Wallace" <as**@qwerty.com> wrote in message
news:uJ*************@TK2MSFTNGP12.phx.gbl...
Hey all,

I have an XML doc that I read into a SQL Server database from an

integration
feed....

----------------XML snippet ----------------
<?xml version="1.0" encoding="us-ascii"?>
<!--Product data from JDEdwards-->
<Root>
<Root RvcDate="2004-02-03" RcvTime="14.16.03.795135">
<Product>
<File>1234A</File>
<Library>XCOMM</Library>
<ActionCode>A</ActionCode>
<TransDate>2004-02-03</TransDate>
<TransTime>14.18.39.337626</TransTime>
<Details Name="JBMCUS" Value="1234567890" />
<Details Name="JBALOT" Value="1234" />
<Details Name="JBSEQ2" Value="00856" />
<Details Name="JBLTP" Value="123456.00" />
<Details Name="JBADD1" Value="1234 Garrity Way" />
<Details Name="JBDL01" Value="" />
<Details Name="JBRDJ" Value="000000" />
<Details Name="JBFD01" Value="" />
<Details Name="JBUSD1" Value="000000" />
</Product>
<Product>
<File>1234B</File>
<Library>XCOMM</Library>
<ActionCode>A</ActionCode>
<TransDate>2004-02-03</TransDate>
<TransTime>14.18.39.337923</TransTime>
<Details Name="JBMCUS" Value="1234567890" />
<Details Name="JBALOT" Value="4567" />
<Details Name="JBSEQ2" Value="00856" />
<Details Name="JBLTP" Value="123456.00" />
<Details Name="JBADD1" Value="4567 Garrity Way" />
<Details Name="JBDL01" Value="" />
<Details Name="JBRDJ" Value="000000" />
<Details Name="JBFD01" Value="" />
<Details Name="JBUSD1" Value="000000" />
</Product>
<Product>
<File>1234A</File>
<Library>XCOMM</Library>
<ActionCode>A</ActionCode>
<TransDate>2004-02-03</TransDate>
<TransTime>14.18.39.412541</TransTime>
<Details Name="JBMCUS" Value="1234567890" />
<Details Name="JBALOT" Value="9876" />
<Details Name="JBSEQ2" Value="00856" />
<Details Name="JBLTP" Value="123456.00" />
<Details Name="JBADD1" Value="9876 Main St" />
<Details Name="JBDL01" Value="" />
<Details Name="JBRDJ" Value="000000" />
<Details Name="JBFD01" Value="" />
<Details Name="JBUSD1" Value="000000" />
</Product>
</Root>
</Root>
----------------End XML snippet ----------------

Currently, I load the XML into a dataset and loop on each datarow in the
dataset and process each row as an individual transaction. I'm curious to know if there is a 'standard' approach on completing the goal and if the
path I've selected if efficient or is there a better way?

Suggestions or any kind of feedback would be appreciated.

TIA
-Rich


Nov 12 '05 #3

P: n/a
We had a similar situation on a project i worked on a while back.
We used the following solution.

1. Accept files as Xml.
2. Use XPath's to process our business rules - multiple XPaths were used
typically. Sometimes you had to call out to a custom class, but not often.
3. Transformed our Xml to a Bulk Upload format.
4. Passed it in.

3 and 4 for you could easily be SqlXml and use your Stored Prcos from there.
It is just much easier IMO to push Xml directly to sql - even via SP's,
rather than progratically.

Cool articles here http://sightkeys.com?181 and here
http://sightkeys.com?182

Best of luck with whatever method you choose.

Steven
Founder, http://venturetogether.com
"Rich Wallace" <as**@qwerty.com> wrote in message
news:Ov**************@TK2MSFTNGP09.phx.gbl...
Hi Steven,

The XML document that I accept can contain anywhere from 1 <Product> to 500. Unfortunately, what I need to do isn't as simple as doing a bulk load as I
have to perform several business rules and other checks and balances before the data gets pushed to SQL. The way I drive the data into the database is via parameterized stored procedures so I don't actually push XML data into
the table, rather parsed out data from the XML.

I feel that working with datasets are quite fast and efficient but I always question my selection as the standby 'There has to be a better way!!!"

Thanks for your input.
-Rich

"Steven Livingstone" <s.***********@nospam.btinternet.com> wrote in message news:uT**************@TK2MSFTNGP12.phx.gbl...
Rich - how big does you Xml doc get?
To be honest I was very happy with the SqlXml and Bulk Upload stuff for this
kind of work - mainly as it does a lot of the stuff for you. It also
supports transactions if required and itself runs transactionally when

bulk
uploading.
Have you looked at that? It might be overkill if your document isn't too
large, but even for reasonable sized documents i found it to be much

better
than writing streams of code.

Have a look at the post "Automagically create database schema from XML
dataset" from Fed 2nd for more info.

Steven
Founder, http://venturetogether.com

"Rich Wallace" <as**@qwerty.com> wrote in message
news:uJ*************@TK2MSFTNGP12.phx.gbl...
Hey all,

I have an XML doc that I read into a SQL Server database from an

integration
feed....

----------------XML snippet ----------------
<?xml version="1.0" encoding="us-ascii"?>
<!--Product data from JDEdwards-->
<Root>
<Root RvcDate="2004-02-03" RcvTime="14.16.03.795135">
<Product>
<File>1234A</File>
<Library>XCOMM</Library>
<ActionCode>A</ActionCode>
<TransDate>2004-02-03</TransDate>
<TransTime>14.18.39.337626</TransTime>
<Details Name="JBMCUS" Value="1234567890" />
<Details Name="JBALOT" Value="1234" />
<Details Name="JBSEQ2" Value="00856" />
<Details Name="JBLTP" Value="123456.00" />
<Details Name="JBADD1" Value="1234 Garrity Way" />
<Details Name="JBDL01" Value="" />
<Details Name="JBRDJ" Value="000000" />
<Details Name="JBFD01" Value="" />
<Details Name="JBUSD1" Value="000000" />
</Product>
<Product>
<File>1234B</File>
<Library>XCOMM</Library>
<ActionCode>A</ActionCode>
<TransDate>2004-02-03</TransDate>
<TransTime>14.18.39.337923</TransTime>
<Details Name="JBMCUS" Value="1234567890" />
<Details Name="JBALOT" Value="4567" />
<Details Name="JBSEQ2" Value="00856" />
<Details Name="JBLTP" Value="123456.00" />
<Details Name="JBADD1" Value="4567 Garrity Way" />
<Details Name="JBDL01" Value="" />
<Details Name="JBRDJ" Value="000000" />
<Details Name="JBFD01" Value="" />
<Details Name="JBUSD1" Value="000000" />
</Product>
<Product>
<File>1234A</File>
<Library>XCOMM</Library>
<ActionCode>A</ActionCode>
<TransDate>2004-02-03</TransDate>
<TransTime>14.18.39.412541</TransTime>
<Details Name="JBMCUS" Value="1234567890" />
<Details Name="JBALOT" Value="9876" />
<Details Name="JBSEQ2" Value="00856" />
<Details Name="JBLTP" Value="123456.00" />
<Details Name="JBADD1" Value="9876 Main St" />
<Details Name="JBDL01" Value="" />
<Details Name="JBRDJ" Value="000000" />
<Details Name="JBFD01" Value="" />
<Details Name="JBUSD1" Value="000000" />
</Product>
</Root>
</Root>
----------------End XML snippet ----------------

Currently, I load the XML into a dataset and loop on each datarow in the dataset and process each row as an individual transaction. I'm curious to
know if there is a 'standard' approach on completing the goal and if

the path I've selected if efficient or is there a better way?

Suggestions or any kind of feedback would be appreciated.

TIA
-Rich



Nov 12 '05 #4

P: n/a
Rich Wallace wrote:
I feel that working with datasets are quite fast and efficient but I always
question my selection as the standby 'There has to be a better way!!!"


Well in fact datasets are not the most efficient XML processing
approach. But if you feel confortable with DataSet and happy with perf,
don't worry.
--
Oleg Tkachenko [XML MVP, XmlInsider]
http://blog.tkachenko.com
Nov 12 '05 #5

P: n/a
Oleg,

That's what I'm looking for; what is the most efficient way?? If you can
point me to a sample or other reference, I'd apprecaite it.

Thanks again.
-Rich

"Oleg Tkachenko [MVP]" <oleg@NO!SPAM!PLEASEtkachenko.com> wrote in message
news:uk****************@TK2MSFTNGP12.phx.gbl...
Rich Wallace wrote:
I feel that working with datasets are quite fast and efficient but I always question my selection as the standby 'There has to be a better way!!!"


Well in fact datasets are not the most efficient XML processing
approach. But if you feel confortable with DataSet and happy with perf,
don't worry.
--
Oleg Tkachenko [XML MVP, XmlInsider]
http://blog.tkachenko.com

Nov 12 '05 #6

P: n/a
Thanks Steven,

I'll check out the articles and look over the SqlXml as well.

Thanks again,
-Rich

"Steven Livingstone" <s.***********@nospam.btinternet.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
We had a similar situation on a project i worked on a while back.
We used the following solution.

1. Accept files as Xml.
2. Use XPath's to process our business rules - multiple XPaths were used
typically. Sometimes you had to call out to a custom class, but not often.
3. Transformed our Xml to a Bulk Upload format.
4. Passed it in.

3 and 4 for you could easily be SqlXml and use your Stored Prcos from there. It is just much easier IMO to push Xml directly to sql - even via SP's,
rather than progratically.

Cool articles here http://sightkeys.com?181 and here
http://sightkeys.com?182

Best of luck with whatever method you choose.

Steven
Founder, http://venturetogether.com
"Rich Wallace" <as**@qwerty.com> wrote in message
news:Ov**************@TK2MSFTNGP09.phx.gbl...
Hi Steven,

The XML document that I accept can contain anywhere from 1 <Product> to

500.
Unfortunately, what I need to do isn't as simple as doing a bulk load as I
have to perform several business rules and other checks and balances

before
the data gets pushed to SQL. The way I drive the data into the database

is
via parameterized stored procedures so I don't actually push XML data into the table, rather parsed out data from the XML.

I feel that working with datasets are quite fast and efficient but I

always
question my selection as the standby 'There has to be a better way!!!"

Thanks for your input.
-Rich

"Steven Livingstone" <s.***********@nospam.btinternet.com> wrote in

message
news:uT**************@TK2MSFTNGP12.phx.gbl...
Rich - how big does you Xml doc get?
To be honest I was very happy with the SqlXml and Bulk Upload stuff for
this
kind of work - mainly as it does a lot of the stuff for you. It also
supports transactions if required and itself runs transactionally when

bulk
uploading.
Have you looked at that? It might be overkill if your document isn't

too large, but even for reasonable sized documents i found it to be much

better
than writing streams of code.

Have a look at the post "Automagically create database schema from XML
dataset" from Fed 2nd for more info.

Steven
Founder, http://venturetogether.com

"Rich Wallace" <as**@qwerty.com> wrote in message
news:uJ*************@TK2MSFTNGP12.phx.gbl...
> Hey all,
>
> I have an XML doc that I read into a SQL Server database from an
integration
> feed....
>
> ----------------XML snippet ----------------
> <?xml version="1.0" encoding="us-ascii"?>
> <!--Product data from JDEdwards-->
> <Root>
> <Root RvcDate="2004-02-03" RcvTime="14.16.03.795135">
> <Product>
> <File>1234A</File>
> <Library>XCOMM</Library>
> <ActionCode>A</ActionCode>
> <TransDate>2004-02-03</TransDate>
> <TransTime>14.18.39.337626</TransTime>
> <Details Name="JBMCUS" Value="1234567890" />
> <Details Name="JBALOT" Value="1234" />
> <Details Name="JBSEQ2" Value="00856" />
> <Details Name="JBLTP" Value="123456.00" />
> <Details Name="JBADD1" Value="1234 Garrity Way" />
> <Details Name="JBDL01" Value="" />
> <Details Name="JBRDJ" Value="000000" />
> <Details Name="JBFD01" Value="" />
> <Details Name="JBUSD1" Value="000000" />
> </Product>
> <Product>
> <File>1234B</File>
> <Library>XCOMM</Library>
> <ActionCode>A</ActionCode>
> <TransDate>2004-02-03</TransDate>
> <TransTime>14.18.39.337923</TransTime>
> <Details Name="JBMCUS" Value="1234567890" />
> <Details Name="JBALOT" Value="4567" />
> <Details Name="JBSEQ2" Value="00856" />
> <Details Name="JBLTP" Value="123456.00" />
> <Details Name="JBADD1" Value="4567 Garrity Way" />
> <Details Name="JBDL01" Value="" />
> <Details Name="JBRDJ" Value="000000" />
> <Details Name="JBFD01" Value="" />
> <Details Name="JBUSD1" Value="000000" />
> </Product>
> <Product>
> <File>1234A</File>
> <Library>XCOMM</Library>
> <ActionCode>A</ActionCode>
> <TransDate>2004-02-03</TransDate>
> <TransTime>14.18.39.412541</TransTime>
> <Details Name="JBMCUS" Value="1234567890" />
> <Details Name="JBALOT" Value="9876" />
> <Details Name="JBSEQ2" Value="00856" />
> <Details Name="JBLTP" Value="123456.00" />
> <Details Name="JBADD1" Value="9876 Main St" />
> <Details Name="JBDL01" Value="" />
> <Details Name="JBRDJ" Value="000000" />
> <Details Name="JBFD01" Value="" />
> <Details Name="JBUSD1" Value="000000" />
> </Product>
> </Root>
> </Root>
> ----------------End XML snippet ----------------
>
> Currently, I load the XML into a dataset and loop on each datarow in

the > dataset and process each row as an individual transaction. I'm curious
to
> know if there is a 'standard' approach on completing the goal and if

the > path I've selected if efficient or is there a better way?
>
> Suggestions or any kind of feedback would be appreciated.
>
> TIA
> -Rich
>
>



Nov 12 '05 #7

P: n/a
Rich Wallace wrote:
That's what I'm looking for; what is the most efficient way?? If you can
point me to a sample or other reference, I'd apprecaite it.


What's the most efficient way depends on what do you need to accomplish
with XML. For ordinary reading values from XML the best way is
XmlReader. For sophisticated querying - XPathDocument, for in-memory
editing - XmlDocument.
--
Oleg Tkachenko [XML MVP, XmlInsider]
http://blog.tkachenko.com
Nov 12 '05 #8

P: n/a
Ok, maybe I'm fishing too hard, but can you answer this for me?

Based on the XML I originally sent it, where I may have multiple records to
process, what would be the best approach?

Example of data extration and SP call:

----------Begin Code snippet----------

'Prepare new Dataset for incoming XML
Dim dsXmlDocIn As New DataSet()

'Prepare Product instruction Datatable(s)
Dim dtProductData As New DataTable()
Dim dtProductDetail As New DataTable()
Dim dtProductOption As New DataTable()

'Prepare Product DataTable rows
Dim drProductData As DataRow
Dim drProductDetail As DataRow
Dim drProductOption As DataRow

'Prepare row count containers
Dim iProdDataRowCnt As Integer = 0
Dim iProdDetRowCnt As Integer = 0
Dim iDetailSplitCnt As Integer = 0
Dim iProdOptRowCnt As Integer = 0

'Load incoming XML document
Dim oXmlRdr As New XmlTextReader(New StringReader(strDocument))
dsXmlDocIn.ReadXml(oXmlRdr)

'Extract Master Poll Date and Time
Dim sPollDate As String =
dsXmlDocIn.Tables("Root").Rows(0).Item("PollDate")
Dim sPollTime As String =
dsXmlDocIn.Tables("Root").Rows(0).Item("PollTime")

'Fill Datatables from dataset
dtProductData = dsXmlDocIn.Tables("Product")
dtProductDetail = dsXmlDocIn.Tables("Details")

'Loop through each datatable and extract the necessary data
For Each drProductData In dtProductData.Rows
sOrigin =
dsXmlDocIn.Tables("Product").Rows(iProdDataRowCnt) .Item("File")
sLibrary =
dsXmlDocIn.Tables("Product").Rows(iProdDataRowCnt) .Item("Library")
sAction =
dsXmlDocIn.Tables("Product").Rows(iProdDataRowCnt) .Item("ActionCode")
sTranDate =
dsXmlDocIn.Tables("Product").Rows(iProdDataRowCnt) .Item("TransDate")
sTranTime =
dsXmlDocIn.Tables("Product").Rows(iProdDataRowCnt) .Item("TransTime")

'Write header entry to log tables
iTranID = oTranLog.InsertHeaderInfo(sOrigin, sLibrary,
sAction, sTranDate, sTranTime, Now())

For Each drProductDetail In dtProductDetail.Rows

Select Case
dsXmlDocIn.Tables("Details").Rows(iProdDetRowCnt). Item("Name")
Case "JBMCUS"
sCostCenter =
dsXmlDocIn.Tables("Details").Rows(iProdDetRowCnt). Item("Value")
Case "JBALOT"
sLot =
dsXmlDocIn.Tables("Details").Rows(iProdDetRowCnt). Item("Value")
Case "JBLTP"
sPremium =
dsXmlDocIn.Tables("Details").Rows(iProdDetRowCnt). Item("Value")
Case "JBADD1"
sStAddr =
dsXmlDocIn.Tables("Details").Rows(iProdDetRowCnt). Item("Value")
Case "JBDL01"
sLotLglDesc =
dsXmlDocIn.Tables("Details").Rows(iProdDetRowCnt). Item("Value")
Case "JBRDJ"
sSalesRslDt =
dsXmlDocIn.Tables("Details").Rows(iProdDetRowCnt). Item("Value")
Case "JBFD01"
sChngAddr =
dsXmlDocIn.Tables("Details").Rows(iProdDetRowCnt). Item("Value")
Case "JBUSD1"
sEffDt =
dsXmlDocIn.Tables("Details").Rows(iProdDetRowCnt). Item("Value")
oTranLog.InsertF4453(iTranID,
sCostCenter, sLot, sPremium, sStAddr, sLotLglDesc, sSalesRslDt, sChngAddr,
sEffDt)
End Select

iProdDetRowCnt = iProdDetRowCnt + 1
iDetailSplitCnt = iDetailSplitCnt + 1
If iDetailSplitCnt = 25 Then
iDetailSplitCnt = 0
Exit For
End If
Next drProductDetail

'Pass in extracted values via SP call
... blah blah blah

Next drProductData

----------End Code snippet----------
What do you think??? Ugly as all get out? Any ideas on how I can improve
on this with the options you suggested?

Thank you for your time.
-Rich

"Oleg Tkachenko [MVP]" <oleg@NO!SPAM!PLEASEtkachenko.com> wrote in message
news:uD**************@TK2MSFTNGP11.phx.gbl...
Rich Wallace wrote:
That's what I'm looking for; what is the most efficient way?? If you can point me to a sample or other reference, I'd apprecaite it.


What's the most efficient way depends on what do you need to accomplish
with XML. For ordinary reading values from XML the best way is
XmlReader. For sophisticated querying - XPathDocument, for in-memory
editing - XmlDocument.
--
Oleg Tkachenko [XML MVP, XmlInsider]
http://blog.tkachenko.com

Nov 12 '05 #9

P: n/a
Rich Wallace wrote:

----------End Code snippet----------
What do you think??? Ugly as all get out? Any ideas on how I can improve
on this with the options you suggested?


Not ugly at all. Quite reasonable relational data model centric
approach. But note that this requires the whole document to be loaded
into memory. Using XmlTextReader you can solve it in a streaming manner.
--
Oleg Tkachenko [XML MVP, XmlInsider]
http://blog.tkachenko.com
Nov 12 '05 #10

P: n/a
Makes sense. I'll start playing with that and see what happens. Thanks
again for looking this over for me.

"Oleg Tkachenko [MVP]" <oleg@NO!SPAM!PLEASEtkachenko.com> wrote in message
news:OR**************@TK2MSFTNGP10.phx.gbl...
Rich Wallace wrote:

----------End Code snippet----------
What do you think??? Ugly as all get out? Any ideas on how I can improve on this with the options you suggested?


Not ugly at all. Quite reasonable relational data model centric
approach. But note that this requires the whole document to be loaded
into memory. Using XmlTextReader you can solve it in a streaming manner.
--
Oleg Tkachenko [XML MVP, XmlInsider]
http://blog.tkachenko.com

Nov 12 '05 #11

This discussion thread is closed

Replies have been disabled for this discussion.