[AccessD] xml tables

Ryan W wrwehler at gmail.com
Mon Jun 27 09:55:17 CDT 2022


Well,

   I dug through some code base I have and at one point I did write some
MSXML code:

https://pastebin.com/D0eibb4g (this link will expire in 2 months)


Two different functions depending on XML structure (normal or attribute
based XML).  They match the node or attribute name to a column name in a
table and loads the data into it.  Maybe you like this way more.  Sorry for
the list spam.


On Mon, Jun 27, 2022 at 9:05 AM Ryan W <wrwehler at gmail.com> wrote:

>
> John,
>   Here's an example of shredding using XQuery (my preferred way) vs
> OpenXML:
>
>
> https://dbfiddle.uk/?rdbms=sqlserver_2019&fiddle=33bc1cc4679964acf85fadbca3ba55d4
>
> https://i.imgur.com/ZaTAcZE.png
>
> So if you have a way to shred the XML and stuff into a table (a stored
> procedure for example) to do what you want with the data on the front end I
> find is MUCH easier than trying to parse with Micorosft XML 6.0.
>
>
>
>
>
> On Mon, Jun 27, 2022 at 8:42 AM Ryan W <wrwehler at gmail.com> wrote:
>
>> John,
>>  What's the back end?  If it's SQL Server, why not pull the HTML in and
>> shred it with SQL server and then use the shredded data (now in a table)
>> how you see fit?
>>
>>
>>
>> On Mon, Jun 27, 2022 at 8:16 AM John Colby <jwcolby at gmail.com> wrote:
>>
>>> Does anyone have a good resource on how to work with xml tables?  I have
>>> an
>>> application where I read the html from a web page.  This HTML has a table
>>> of info about a user and I need to parse out specific pieces and pull it
>>> into my database.  The data is in a table, with all of the associated
>>> table
>>> and field tags.
>>>
>>> I do a brute force parse to extract what I want but I just know that
>>> there
>>> is a way to pull the table out and iterate the rows.  I like clean and
>>> brute force parse is NOT clean.
>>>
>>> I am currently referencing the Microsoft XML v6.0 for working with xml. I
>>> don't use it much and have minimal knowledge of it.  Any tips or example
>>> code would be appreciated.
>>>
>>> --
>>> John W. Colby
>>> Colby Consulting
>>> --
>>> AccessD mailing list
>>> AccessD at databaseadvisors.com
>>> https://databaseadvisors.com/mailman/listinfo/accessd
>>> Website: http://www.databaseadvisors.com
>>>
>>


More information about the AccessD mailing list