473,387 Members | 1,691 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,387 software developers and data experts.

Best Practice - XML processing??

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
10 1950
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
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
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
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
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

131
by: Peter Foti | last post by:
Simple question... which is better to use for defining font sizes and why? px and em seem to be the leading candidates. I know what the general answer is going to be, but I'm hoping to ultimately...
11
by: DrUg13 | last post by:
In java, this seems so easy. You need a new object Object test = new Object() gives me exactly what I want. could someone please help me understand the different ways to do the same thing in...
136
by: Matt Kruse | last post by:
http://www.JavascriptToolbox.com/bestpractices/ I started writing this up as a guide for some people who were looking for general tips on how to do things the 'right way' with Javascript. Their...
0
by: Johannes Unfried | last post by:
Problem Best practice needed to marshal STL data from managed code to unmanaged code & vice vers Details managed code is written in managed C++ & accesses the unmanaged code (i.e. lives in a...
5
by: Soren S. Jorgensen | last post by:
Hi, In my app I've got a worker thread (background) doing some calculations based upon user input. A new worker thread might be invoked before the previous worker thread has ended, and I wan't...
2
by: Gordon | last post by:
I am looking for a way to display a waiting page whilst some processing is happening. Depending on the result of that processing I may go back to the original page ( and maintian view state) or go...
5
by: Rich | last post by:
Hello, I have a search application to search data in tables in a database (3 sql server tables). I populate 2 comboboxes with with data from each table. One combobox will contain unique...
9
by: Gummy | last post by:
Hello, I created a user control that has a ListBox and a RadioButtonList (and other stuff). The idea is that I put the user control on the ASPX page multiple times and each user control will...
51
by: bigHairy | last post by:
Hello. I have been teaching myself .NET over the last few months and have had some success. I would like to ask a question though... A number of examples I have followed have the following in...
5
by: Frank Millman | last post by:
Hi all This is not strictly a Python question, but as I am writing in Python, and as I know there are some XML gurus on this list, I hope it is appropriate here. XML-schemas are used to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.