K
Ken Fine
I periodically receive a 5+ MB XML document that I hand-load into SQL Server
using SQLXML running under a DTS process.
Unfortunately, the document is human-created, and (very unfortunately) often
has invalid elements, which breaks the bulk load. I've been managing this
problem by loading the document into Visual Studio and using it to identify
the offending line numbers, and fixing it by hand. Given my truly minimal
coding skills when I designed the app way back when, this was the best
approach.
I'd like to automate this crummy work now.
Using ASP, is there a way to generically test whether a given snippet of XML
is well-formed?
I've mapped out a very crude approach that involves walking through the
document with ASP's regex matching abilities, assigning the contents between
<item> and </item> to a variable, testing that section for well-formedness,
parsing out the pieces of information I want, inserting these pieces to the
database, and looping as necessary to finish the job.
If there are better approaches that can accommodate the occassionally-broken
incoming XML, I'd love to hear suggestions. I do not have a formal CS
background and sometimes what should be obvious is not.
Thanks,
-KF
using SQLXML running under a DTS process.
Unfortunately, the document is human-created, and (very unfortunately) often
has invalid elements, which breaks the bulk load. I've been managing this
problem by loading the document into Visual Studio and using it to identify
the offending line numbers, and fixing it by hand. Given my truly minimal
coding skills when I designed the app way back when, this was the best
approach.
I'd like to automate this crummy work now.
Using ASP, is there a way to generically test whether a given snippet of XML
is well-formed?
I've mapped out a very crude approach that involves walking through the
document with ASP's regex matching abilities, assigning the contents between
<item> and </item> to a variable, testing that section for well-formedness,
parsing out the pieces of information I want, inserting these pieces to the
database, and looping as necessary to finish the job.
If there are better approaches that can accommodate the occassionally-broken
incoming XML, I'd love to hear suggestions. I do not have a formal CS
background and sometimes what should be obvious is not.
Thanks,
-KF