Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SharpDevelop program coverting an XML file to desired layout

Status
Not open for further replies.

brialex

Technical User
Jan 6, 2004
26
US
I am using a SharpDevelop program that takes an XML file and converts it to the format I need for data upload. The
client is send the XML file with <test/> as the closing tag when a data field is empty instead of <test></test>.
Does anyone know of a way I can change those tags to a well
fromed XML file. The program I am using doesn't seem to recognize the database fiels that have <test/> as the tag. Here's and example of how their file looks

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<lines>
<line>
<pub_code>YES</pub_code>
<customer_number/>
<rte_cde/>
<rate>17</rate>
<key_code>DYS1569X</key_code>
<bil_cde>B</bil_cde>
<donor_number/>
<strt_dte>20070101</strt_dte>
<term_offer_1>5</term_offer_1>
<amount_paid/>
<cc_info/>
<gro_rate/>
<card_to/>
<gft_msg/>
<atn_1st>Carly</atn_1st>
<atn_mid/>
<atn_end>Thomas</atn_end>
<cmp_nme/>
<str_1st>168 Clinton St</str_1st>
<str_2nd/>
<str_3rd/>
<ctm_cty>Columbus</ctm_cty>
<ctm_ste>OH</ctm_ste>
<cun_typ/>
<zip_cde>43202</zip_cde>
<pho_nbr/>
<pho_nbr2/>
<adr_email/>
<promo/>
</line>
</lines>

The program works fine is all empty fields appear lik my example below:

<customer_number></customer_number>

Thanks
Trisha

 
To clarify.

Someone gives you an XML file with empty tags in it like <rte_cde/>. You process that file with an application named SharpDevelop, which does not recognize <rte_cde/> as an empty tag.

Perhaps there is a switch, setting, or configuration in SharpDevelop which would enable it to handle the empty tag.

Or, you need to write your own pre-processor to convert the empty tags from <rte_cde/> to <rte_cde></rte_cde> .

I believe that documents containing tags like <rte_cde/> are "well formed" according to the XML specification, therefore an application representing itself as an XML tool ought to be able to handle them. Which suggests getting another tool.

In any case, this does not seem to be a MS SQL programming question, rather a question for a SharpDevelop forum.

Sorry.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top