E
Edward W.
after some processing and such I end up with csv data in a string variable.
For example
"023123","abcabc"
"123345","03a-m3"
"239349","amf309"
....
I need to somehow convert this to xml like follows
<root>
<customer><custnum>023123</custnum><custname>abcabc</custname></customer>
<customer><custnum>123345</custnum><custname>03a-m3</custname></customer>
<customer><custnum>239349</custnum><custname>amf309</custname></customer>
</root>
Eventually I need to pass this XML into a stored procedure parameter as a
text datatype.
I need guidiance on how to go from the CSV with commas and quotes to the XML
format. After each row in the string variable is a carriage return. Also,
is it possible to compare the XML to a XSD to see if it meets some standard?
I want to catch if the CSV has errors like this before I send it to sql
server
"023123","" <-- error, the second column is blank
"123345a","03a-m3" <-- error, the first column is 7 characters (6 is the
max) and is not numeric
"239349" <-- error, the second column is totally missing.
thanks!
For example
"023123","abcabc"
"123345","03a-m3"
"239349","amf309"
....
I need to somehow convert this to xml like follows
<root>
<customer><custnum>023123</custnum><custname>abcabc</custname></customer>
<customer><custnum>123345</custnum><custname>03a-m3</custname></customer>
<customer><custnum>239349</custnum><custname>amf309</custname></customer>
</root>
Eventually I need to pass this XML into a stored procedure parameter as a
text datatype.
I need guidiance on how to go from the CSV with commas and quotes to the XML
format. After each row in the string variable is a carriage return. Also,
is it possible to compare the XML to a XSD to see if it meets some standard?
I want to catch if the CSV has errors like this before I send it to sql
server
"023123","" <-- error, the second column is blank
"123345a","03a-m3" <-- error, the first column is 7 characters (6 is the
max) and is not numeric
"239349" <-- error, the second column is totally missing.
thanks!