Click here to Skip to main content
15,897,518 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: message box with YES/NO button Pin
Richard MacCutchan28-Feb-12 22:39
mveRichard MacCutchan28-Feb-12 22:39 
AnswerRe: message box with YES/NO button Pin
Not Active29-Feb-12 1:06
mentorNot Active29-Feb-12 1:06 
QuestionLimiting Users Download Size Pin
Majid Shahabfar28-Feb-12 21:16
Majid Shahabfar28-Feb-12 21:16 
AnswerRe: Limiting Users Download Size Pin
Not Active29-Feb-12 1:09
mentorNot Active29-Feb-12 1:09 
Questionhow to clear textbox when page is refreshed asp.net c# Pin
crisjala28-Feb-12 20:00
crisjala28-Feb-12 20:00 
AnswerRe: how to clear textbox when page is refreshed asp.net c# Pin
Abhinav S28-Feb-12 22:09
Abhinav S28-Feb-12 22:09 
QuestionTest Cases for web.config encryption Pin
Jaison Peter28-Feb-12 17:44
Jaison Peter28-Feb-12 17:44 
QuestionReading Values from XML optional node in huge xml file Pin
yvrmurari28-Feb-12 12:14
yvrmurari28-Feb-12 12:14 
SQL
I have a huge XML file and some of the nodes in that are optional. I am not able to pull the bidder info from that, can anyone please help with this. The first 2 records of xml file are given below

<reports>
<report>

<xml-report>
<summary>
<dr-nbr>2012004</dr-nbr>
</summary>
<data>
<proj-title>
<title-code>
<title ci = "N">District 321</title>
</title-code>
</proj-title>
<p-location>
<project-location>
<title-code>
<p-county-name ci = "N">BOOLE</p-county-name>
<p-fips-county>MT101</p-fips-county>
<p-city-name ci = "N">MTELBY</p-city-name>
<p-state-id ci = "N">MT</p-state-id>
<p-zip-code ci = "N">69474</p-zip-code>
<p-zip-code5 ci = "N">69474</p-zip-code5>
<p-country-id ci = "N">USA</p-country-id>
</title-code>
</project-location>
<pct-project-county>
<title-code>
<p-county-name ci = "N">TOOLE</p-county-name>
<p-fips-county>MT101</p-fips-county>
<p-state-id>MT</p-state-id>
<p-country-id>USA</p-country-id>
</title-code>
</pct-project-county>
</p-location>
<status>
<title-code>
<status-proj-dlvry-sys ci = "N">Design-Bid-Build</status-proj-dlvry-sys>
</title-code>
</status>
</data>
</xml-report>
</report>

<report>
<xml-report>
<summary>
<dr-nbr>2011005</dr-nbr>
</summary>
<data>
<proj-title>
<title-code>
<title ci = "N">Plane Pitch</title>
</title-code>
</proj-title>
<p-location>
<project-location>
<title-code>
<p-county-name ci = "A">SUMMIT</p-county-name>
<p-fips-county>MI153</p-fips-county>
<p-city-name ci = "A">AVON</p-city-name>
<p-state-id ci = "A">MI</p-state-id>
<p-zip-code ci = "C">44308</p-zip-code>
<p-zip-code5 ci = "C">44308</p-zip-code5>
<p-country-id ci = "A">USA</p-country-id>
</title-code>
</project-location>
<pct-project-county>
<title-code>
<p-county-name ci = "A">SUMMIT</p-county-name>
<p-fips-county>OH153</p-fips-county>
<p-state-id>OH</p-state-id>
<p-country-id>USA</p-country-id>
</title-code>
</pct-project-county>
</p-location>

<project-bidder-information>
<title-code>
<bid-header>
<bid-header-desc ci = "N">Low Bidders</bid-header-desc>
<bid-title>
<bid-details>
<contact-information>
<firm-name>Many Stocks</firm-name>
<contact-name>Many Moree</contact-name>
</contact-information>
</bid-details>
<bid-details>
<contact-information>
<firm-name>Who Constrcution</firm-name>
</contact-information>
</bid-details>
</bid-title>
</bid-header>
</title-code>
</project-bidder-information>
</data>
</xml-report>
</report>

</reports>


my Code ************

Dim xtr As New XmlTextReader("C:\Test2.xml")
xtr.WhitespaceHandling = WhitespaceHandling.None

Dim X As New XmlDocument()
X.Load(xtr)

If Not (X Is Nothing) Then
Try
Dim ArticleList As XmlNodeList = X.SelectNodes("reports/report/xml-report")
For Each Article As XmlNode In ArticleList

Response.Write("**************New Record**********")
Response.Write("<br />")

Try
Dim CatNodesList As XmlNodeList = Article.SelectNodes("summary/dr-nbr")
Dim ProjectID As String
For Each category As XmlNode In CatNodesList
If category IsNot Nothing Then
Response.Write("Project No:" & category.InnerText)
ProjectID = category.InnerText
Response.Write("<br />")

End If
Next

Dim ProjectBidCompanyNodsList As XmlNodeList = Article.SelectNodes("data/project-bidder-informaton/title-code/bid-header/bid-title/bid-details/contact-information/firm-name")
For Each ProjCompanyNode As XmlNode In ProjectBidCompanyNodsList

If ProjCompanyNode IsNot Nothing Then
Response.Write("Bid Company:" & ProjCompanyNode.Value)
Response.Write("<br />")
End If
Next

Catch ex As Exception
Response.Write(ex)
Response.Write("<br />")
End Try
Next
Catch ex As Exception
Response.Write(ex)
End Try
End If


I am able to pull the Project No(dr-nbr) but not the bid companies that are in second row, what am i doing wrong. Thanks in advance
Thanks
Murari

QuestionHi pls help me to do this? Pin
LekshmiM27-Feb-12 22:16
LekshmiM27-Feb-12 22:16 
AnswerRe: Hi pls help me to do this? Pin
Richard MacCutchan27-Feb-12 22:46
mveRichard MacCutchan27-Feb-12 22:46 
AnswerRe: Hi pls help me to do this? Pin
Abhinav S27-Feb-12 23:55
Abhinav S27-Feb-12 23:55 
AnswerRe: Hi pls help me to do this? Pin
R. Giskard Reventlov28-Feb-12 5:17
R. Giskard Reventlov28-Feb-12 5:17 
AnswerRe: Hi pls help me to do this? Pin
thatraja28-Feb-12 6:51
professionalthatraja28-Feb-12 6:51 
GeneralRe: Hi pls help me to do this? Pin
LekshmiM28-Feb-12 8:32
LekshmiM28-Feb-12 8:32 
QuestionAccess page controls in static method Pin
cocoonwls27-Feb-12 19:08
cocoonwls27-Feb-12 19:08 
AnswerRe: Access page controls in static method Pin
Parwej Ahamad27-Feb-12 19:30
professionalParwej Ahamad27-Feb-12 19:30 
GeneralRe: Access page controls in static method Pin
cocoonwls27-Feb-12 22:04
cocoonwls27-Feb-12 22:04 
GeneralRe: Access page controls in static method Pin
cocoonwls27-Feb-12 22:26
cocoonwls27-Feb-12 22:26 
Questionmultiline property of textbox Pin
MalarGayu27-Feb-12 14:23
MalarGayu27-Feb-12 14:23 
AnswerRe: multiline property of textbox Pin
Shameel27-Feb-12 23:26
professionalShameel27-Feb-12 23:26 
Questionworking with subdomain Pin
apadana_198926-Feb-12 8:22
apadana_198926-Feb-12 8:22 
AnswerRe: working with subdomain Pin
Shameel28-Feb-12 0:10
professionalShameel28-Feb-12 0:10 
Questionvideo gallery Pin
piya1825-Feb-12 5:53
piya1825-Feb-12 5:53 
AnswerRe: video gallery Pin
R. Giskard Reventlov25-Feb-12 6:01
R. Giskard Reventlov25-Feb-12 6:01 
AnswerRe: video gallery Pin
Abhinav S25-Feb-12 17:22
Abhinav S25-Feb-12 17:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.