|
 |
aspx_beginners thread: xml creation problem
Message #1 by "Abby Lee" <abbylee26@h...> on Mon, 17 Mar 2003 20:31:44
|
|
Is there a way to make my .aspx script to force tags even if the Access DB
field is empty. Here's why...My script created the following xml.
<vendors>
<fein>11-1111111</fein>
<company>Mac Zone</company>
<attention>Joe</attention>
<phone>555-5555</phone>
</vendors>
<vendors>
<fein>11-2267222</fein>
<company>Joe's Pub</company>
<phone>555-3333</phone>
</vendors>
<vendors>
<fein>11-3333355</fein>
<company>IGA</company>
<attention>Debbie</attention>
<phone>555-5343</phone>
</vendors>
Now I use JavaScrip on HTML pages to create arrays....fein_array,
company_array, attention_array, phone_array
I do a search to find fein 1-1-2267222 which is #2 on the list...i=2
Company(i) = Joe's Pub
Phone(i) = 555-3333
Attention(i) = Debbie
Here's the problem...Debbie does not go with Joe's Pub but because there
is not <attention> </attention> with a blank in it...Debbie from IGA
becomes the contact (attention) person.
How do I make it so ever organization has a <attention> element even if it
is blank?
Message #2 by "Colin MacKenzie" <colin@t...> on Mon, 17 Mar 2003 14:15:16 -0700
|
|
I believe this should work...
In your select from your access db, instead of just:
Select fein, company, attention, phone from table
Do this:
Select fein, company, isnull(attention, 'N/A'), phone from table
That SHOULD work, or at least something close to that...
Cheers
Colin MacKenzie
-----Original Message-----
From: Abby Lee [mailto:abbylee26@h...]
Sent: Monday, March 17, 2003 8:32 PM
To: aspx_beginners
Subject: [aspx_beginners] xml creation problem
Is there a way to make my .aspx script to force tags even if the Access DB
field is empty. Here's why...My script created the following xml.
<vendors>
<fein>11-1111111</fein>
<company>Mac Zone</company>
<attention>Joe</attention>
<phone>555-5555</phone>
</vendors>
<vendors>
<fein>11-2267222</fein>
<company>Joe's Pub</company>
<phone>555-3333</phone>
</vendors>
<vendors>
<fein>11-3333355</fein>
<company>IGA</company>
<attention>Debbie</attention>
<phone>555-5343</phone>
</vendors>
Now I use JavaScrip on HTML pages to create arrays....fein_array,
company_array, attention_array, phone_array
I do a search to find fein 1-1-2267222 which is #2 on the list...i=2
Company(i) = Joe's Pub
Phone(i) = 555-3333
Attention(i) = Debbie
Here's the problem...Debbie does not go with Joe's Pub but because there
is not <attention> </attention> with a blank in it...Debbie from IGA
becomes the contact (attention) person.
How do I make it so ever organization has a <attention> element even if it
is blank?
Message #3 by "Rohit Arora" <rohit_arora@i...> on Tue, 18 Mar 2003 03:39:54 +0530
|
|
I have a similar kinda problem.
I am populating dataset from database and firing xpath on the
xmldatadocument generated from dataset. Now if a row doesn't have all the
values(if some are null) they don't appear in xmlnodelist for that row..how
can i bring those fields also whose values are null for some fields.
Regards
Rohit Arora
Intersolutions (P) Ltd
B - 21, Sector 58,
Noida - 201301
Tel : 91-2585703/04/05 Extn: 229
"Desire means never Quit. It may be near when it seems far, so stick to the
fight when you are hardest hit.Its when things go wrong, that u must not
Quit."
-----Original Message-----
From: Colin MacKenzie [mailto:colin@t...]
Sent: Tuesday, March 18, 2003 2:45 AM
To: aspx_beginners
Subject: [aspx_beginners] RE: xml creation problem
I believe this should work...
In your select from your access db, instead of just:
Select fein, company, attention, phone from table
Do this:
Select fein, company, isnull(attention, 'N/A'), phone from table
That SHOULD work, or at least something close to that...
Cheers
Colin MacKenzie
-----Original Message-----
From: Abby Lee [mailto:abbylee26@h...]
Sent: Monday, March 17, 2003 8:32 PM
To: aspx_beginners
Subject: [aspx_beginners] xml creation problem
Is there a way to make my .aspx script to force tags even if the Access DB
field is empty. Here's why...My script created the following xml.
<vendors>
<fein>11-1111111</fein>
<company>Mac Zone</company>
<attention>Joe</attention>
<phone>555-5555</phone>
</vendors>
<vendors>
<fein>11-2267222</fein>
<company>Joe's Pub</company>
<phone>555-3333</phone>
</vendors>
<vendors>
<fein>11-3333355</fein>
<company>IGA</company>
<attention>Debbie</attention>
<phone>555-5343</phone>
</vendors>
Now I use JavaScrip on HTML pages to create arrays....fein_array,
company_array, attention_array, phone_array
I do a search to find fein 1-1-2267222 which is #2 on the list...i=2
Company(i) = Joe's Pub
Phone(i) = 555-3333
Attention(i) = Debbie
Here's the problem...Debbie does not go with Joe's Pub but because there
is not <attention> </attention> with a blank in it...Debbie from IGA
becomes the contact (attention) person.
How do I make it so ever organization has a <attention> element even if it
is blank?
|
|
 |