473,569 Members | 2,813 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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>XCOM M</Library>
<ActionCode>A </ActionCode>
<TransDate>20 04-02-03</TransDate>
<TransTime>14.1 8.39.337626</TransTime>
<Details Name="JBMCUS" Value="12345678 90" />
<Details Name="JBALOT" Value="1234" />
<Details Name="JBSEQ2" Value="00856" />
<Details Name="JBLTP" Value="123456.0 0" />
<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>XCOM M</Library>
<ActionCode>A </ActionCode>
<TransDate>20 04-02-03</TransDate>
<TransTime>14.1 8.39.337923</TransTime>
<Details Name="JBMCUS" Value="12345678 90" />
<Details Name="JBALOT" Value="4567" />
<Details Name="JBSEQ2" Value="00856" />
<Details Name="JBLTP" Value="123456.0 0" />
<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>XCOM M</Library>
<ActionCode>A </ActionCode>
<TransDate>20 04-02-03</TransDate>
<TransTime>14.1 8.39.412541</TransTime>
<Details Name="JBMCUS" Value="12345678 90" />
<Details Name="JBALOT" Value="9876" />
<Details Name="JBSEQ2" Value="00856" />
<Details Name="JBLTP" Value="123456.0 0" />
<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 1962
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 "Automagica lly create database schema from XML
dataset" from Fed 2nd for more info.

Steven
Founder, http://venturetogether.com

"Rich Wallace" <as**@qwerty.co m> wrote in message
news:uJ******** *****@TK2MSFTNG P12.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>XCOM M</Library>
<ActionCode>A </ActionCode>
<TransDate>20 04-02-03</TransDate>
<TransTime>14.1 8.39.337626</TransTime>
<Details Name="JBMCUS" Value="12345678 90" />
<Details Name="JBALOT" Value="1234" />
<Details Name="JBSEQ2" Value="00856" />
<Details Name="JBLTP" Value="123456.0 0" />
<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>XCOM M</Library>
<ActionCode>A </ActionCode>
<TransDate>20 04-02-03</TransDate>
<TransTime>14.1 8.39.337923</TransTime>
<Details Name="JBMCUS" Value="12345678 90" />
<Details Name="JBALOT" Value="4567" />
<Details Name="JBSEQ2" Value="00856" />
<Details Name="JBLTP" Value="123456.0 0" />
<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>XCOM M</Library>
<ActionCode>A </ActionCode>
<TransDate>20 04-02-03</TransDate>
<TransTime>14.1 8.39.412541</TransTime>
<Details Name="JBMCUS" Value="12345678 90" />
<Details Name="JBALOT" Value="9876" />
<Details Name="JBSEQ2" Value="00856" />
<Details Name="JBLTP" Value="123456.0 0" />
<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.btintern et.com> wrote in message
news:uT******** ******@TK2MSFTN GP12.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 "Automagica lly create database schema from XML
dataset" from Fed 2nd for more info.

Steven
Founder, http://venturetogether.com

"Rich Wallace" <as**@qwerty.co m> wrote in message
news:uJ******** *****@TK2MSFTNG P12.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>XCOM M</Library>
<ActionCode>A </ActionCode>
<TransDate>20 04-02-03</TransDate>
<TransTime>14.1 8.39.337626</TransTime>
<Details Name="JBMCUS" Value="12345678 90" />
<Details Name="JBALOT" Value="1234" />
<Details Name="JBSEQ2" Value="00856" />
<Details Name="JBLTP" Value="123456.0 0" />
<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>XCOM M</Library>
<ActionCode>A </ActionCode>
<TransDate>20 04-02-03</TransDate>
<TransTime>14.1 8.39.337923</TransTime>
<Details Name="JBMCUS" Value="12345678 90" />
<Details Name="JBALOT" Value="4567" />
<Details Name="JBSEQ2" Value="00856" />
<Details Name="JBLTP" Value="123456.0 0" />
<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>XCOM M</Library>
<ActionCode>A </ActionCode>
<TransDate>20 04-02-03</TransDate>
<TransTime>14.1 8.39.412541</TransTime>
<Details Name="JBMCUS" Value="12345678 90" />
<Details Name="JBALOT" Value="9876" />
<Details Name="JBSEQ2" Value="00856" />
<Details Name="JBLTP" Value="123456.0 0" />
<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.co m> wrote in message
news:Ov******** ******@TK2MSFTN GP09.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.btintern et.com> wrote in message news:uT******** ******@TK2MSFTN GP12.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 "Automagica lly create database schema from XML
dataset" from Fed 2nd for more info.

Steven
Founder, http://venturetogether.com

"Rich Wallace" <as**@qwerty.co m> wrote in message
news:uJ******** *****@TK2MSFTNG P12.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>XCOM M</Library>
<ActionCode>A </ActionCode>
<TransDate>20 04-02-03</TransDate>
<TransTime>14.1 8.39.337626</TransTime>
<Details Name="JBMCUS" Value="12345678 90" />
<Details Name="JBALOT" Value="1234" />
<Details Name="JBSEQ2" Value="00856" />
<Details Name="JBLTP" Value="123456.0 0" />
<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>XCOM M</Library>
<ActionCode>A </ActionCode>
<TransDate>20 04-02-03</TransDate>
<TransTime>14.1 8.39.337923</TransTime>
<Details Name="JBMCUS" Value="12345678 90" />
<Details Name="JBALOT" Value="4567" />
<Details Name="JBSEQ2" Value="00856" />
<Details Name="JBLTP" Value="123456.0 0" />
<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>XCOM M</Library>
<ActionCode>A </ActionCode>
<TransDate>20 04-02-03</TransDate>
<TransTime>14.1 8.39.412541</TransTime>
<Details Name="JBMCUS" Value="12345678 90" />
<Details Name="JBALOT" Value="9876" />
<Details Name="JBSEQ2" Value="00856" />
<Details Name="JBLTP" Value="123456.0 0" />
<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!P LEASEtkachenko. com> wrote in message
news:uk******** ********@TK2MSF TNGP12.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.btintern et.com> wrote in message
news:%2******** ********@TK2MSF TNGP11.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.co m> wrote in message
news:Ov******** ******@TK2MSFTN GP09.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.btintern et.com> wrote in

message
news:uT******** ******@TK2MSFTN GP12.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 "Automagica lly create database schema from XML
dataset" from Fed 2nd for more info.

Steven
Founder, http://venturetogether.com

"Rich Wallace" <as**@qwerty.co m> wrote in message
news:uJ******** *****@TK2MSFTNG P12.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>XCOM M</Library>
> <ActionCode>A </ActionCode>
> <TransDate>20 04-02-03</TransDate>
> <TransTime>14.1 8.39.337626</TransTime>
> <Details Name="JBMCUS" Value="12345678 90" />
> <Details Name="JBALOT" Value="1234" />
> <Details Name="JBSEQ2" Value="00856" />
> <Details Name="JBLTP" Value="123456.0 0" />
> <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>XCOM M</Library>
> <ActionCode>A </ActionCode>
> <TransDate>20 04-02-03</TransDate>
> <TransTime>14.1 8.39.337923</TransTime>
> <Details Name="JBMCUS" Value="12345678 90" />
> <Details Name="JBALOT" Value="4567" />
> <Details Name="JBSEQ2" Value="00856" />
> <Details Name="JBLTP" Value="123456.0 0" />
> <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>XCOM M</Library>
> <ActionCode>A </ActionCode>
> <TransDate>20 04-02-03</TransDate>
> <TransTime>14.1 8.39.412541</TransTime>
> <Details Name="JBMCUS" Value="12345678 90" />
> <Details Name="JBALOT" Value="9876" />
> <Details Name="JBSEQ2" Value="00856" />
> <Details Name="JBLTP" Value="123456.0 0" />
> <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(N ew StringReader(st rDocument))
dsXmlDocIn.Read Xml(oXmlRdr)

'Extract Master Poll Date and Time
Dim sPollDate As String =
dsXmlDocIn.Tabl es("Root").Rows (0).Item("PollD ate")
Dim sPollTime As String =
dsXmlDocIn.Tabl es("Root").Rows (0).Item("PollT ime")

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

'Loop through each datatable and extract the necessary data
For Each drProductData In dtProductData.R ows
sOrigin =
dsXmlDocIn.Tabl es("Product").R ows(iProdDataRo wCnt).Item("Fil e")
sLibrary =
dsXmlDocIn.Tabl es("Product").R ows(iProdDataRo wCnt).Item("Lib rary")
sAction =
dsXmlDocIn.Tabl es("Product").R ows(iProdDataRo wCnt).Item("Act ionCode")
sTranDate =
dsXmlDocIn.Tabl es("Product").R ows(iProdDataRo wCnt).Item("Tra nsDate")
sTranTime =
dsXmlDocIn.Tabl es("Product").R ows(iProdDataRo wCnt).Item("Tra nsTime")

'Write header entry to log tables
iTranID = oTranLog.Insert HeaderInfo(sOri gin, sLibrary,
sAction, sTranDate, sTranTime, Now())

For Each drProductDetail In dtProductDetail .Rows

Select Case
dsXmlDocIn.Tabl es("Details").R ows(iProdDetRow Cnt).Item("Name ")
Case "JBMCUS"
sCostCenter =
dsXmlDocIn.Tabl es("Details").R ows(iProdDetRow Cnt).Item("Valu e")
Case "JBALOT"
sLot =
dsXmlDocIn.Tabl es("Details").R ows(iProdDetRow Cnt).Item("Valu e")
Case "JBLTP"
sPremium =
dsXmlDocIn.Tabl es("Details").R ows(iProdDetRow Cnt).Item("Valu e")
Case "JBADD1"
sStAddr =
dsXmlDocIn.Tabl es("Details").R ows(iProdDetRow Cnt).Item("Valu e")
Case "JBDL01"
sLotLglDesc =
dsXmlDocIn.Tabl es("Details").R ows(iProdDetRow Cnt).Item("Valu e")
Case "JBRDJ"
sSalesRslDt =
dsXmlDocIn.Tabl es("Details").R ows(iProdDetRow Cnt).Item("Valu e")
Case "JBFD01"
sChngAddr =
dsXmlDocIn.Tabl es("Details").R ows(iProdDetRow Cnt).Item("Valu e")
Case "JBUSD1"
sEffDt =
dsXmlDocIn.Tabl es("Details").R ows(iProdDetRow Cnt).Item("Valu e")
oTranLog.Insert F4453(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!P LEASEtkachenko. com> wrote in message
news:uD******** ******@TK2MSFTN GP11.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

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

Similar topics

131
21569
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 get some good real world examples. Fire away! :) Regards, Peter Foti
11
9223
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 C++. I find my self sometimes, trying Object app = Object(); Object *app = Object(); Object app = new Object();
136
9251
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 code was littered with document.all and eval, for example, and I wanted to create a practical list of best practices that they could easily put to...
0
2682
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 mixed mode DLL unmanaged code is written in unmanaged C++ & resides in an unmanaged DL Product used is VS.NET 200 Please tell me what is the best...
5
3531
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 only one worker thread running at any time (if a new worker thread start has been requested, any running worker thread results will be invalid). I'm...
2
1074
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 on to some other page. I have a threaded approach working but when going back to the original page the view state is lost. Does anyone have any...
5
5893
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 CompanyID's. The second combobox will contain unique memberID's. Each of the tables that I have to search contain a CompanyID and a memberID field, and...
9
3173
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 load with different data (locations, departments, etc.).
51
3613
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 their finally statement Try ......
5
2874
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 define the structure of an xml document, and to validate that a particular document conforms to the schema. They can also be used to transform the...
0
7618
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8138
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7679
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7983
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6287
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5223
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3657
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3647
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
946
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.