TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Chandra Sekhar
NA
41
3.5k
Find the Xpath of the xml and loop through the records.
Oct 23 2019 10:48 PM
<
server
>
<
responses
>
<
Session.loginRs
status
=
"success"
sessionID
=
"A3786008:DB8D4E58:96A1B82A:E606D2BC:7A35D91D:48E90C41"
expiredPassword
=
"0"
fullName
=
"Express Admin"
roleBasedSecurity
=
"1"
entityID
=
"1"
userID
=
"1"
partyID
=
"0"
consumerID
=
"0"
/>
<
IntegrationCBO.ProcessWCFServiceRs
status
=
"success"
>
<
Payload
xmlns:xsd
=
"http://www.w3.org/2001/XMLSchema"
xmlns:xsi
=
"http://www.w3.org/2001/XMLSchema-instance"
>
<
request
xmlns
=
"http://abr.business.gov.au/ABRXMLSearch/"
>
<
nameSearchRequest
>
<
authenticationGUID
>
88bf33e2-96a6-402c-a870-47c03af2a80b
</
authenticationGUID
>
<
name
>
ANZ
</
name
>
<
filters
>
<
nameType
>
<
tradingName
>
Y
</
tradingName
>
<
legalName
>
Y
</
legalName
>
</
nameType
>
<
postcode
xsi:nil
=
"true"
/>
<
stateCode
>
<
QLD
>
Y
</
QLD
>
<
NT
>
Y
</
NT
>
<
SA
>
Y
</
SA
>
<
WA
>
Y
</
WA
>
<
VIC
>
Y
</
VIC
>
<
ACT
>
Y
</
ACT
>
<
TAS
>
Y
</
TAS
>
<
NSW
>
Y
</
NSW
>
</
stateCode
>
</
filters
>
</
nameSearchRequest
>
</
request
>
<
response
xmlns
=
"http://abr.business.gov.au/ABRXMLSearch/"
>
<
usageStatement
>
The Registrar of the ABR monitors the quality of the information available on this website and updates the information regularly. However, neither the Registrar of the ABR nor the Commonwealth guarantee that the information available through this service (including search results) is accurate, up to date, complete or accept any liability arising from the use of or reliance upon this site.
</
usageStatement
>
<
dateRegisterLastUpdated
>
2019-10-22
</
dateRegisterLastUpdated
>
<
dateTimeRetrieved
>
2019-10-22T14:03:33.3141574+05:30
</
dateTimeRetrieved
>
<
searchResultsList
>
<
numberOfRecords
>
201
</
numberOfRecords
>
<
exceedsMaximum
>
N
</
exceedsMaximum
>
<
searchResultsRecord
>
<
ABN
>
<
identifierValue
>
11005357522
</
identifierValue
>
<
identifierStatus
>
Active
</
identifierStatus
>
</
ABN
>
<
businessName
>
<
organisationName
>
ANZ
</
organisationName
>
<
score
>
100
</
score
>
<
isCurrentIndicator
>
Y
</
isCurrentIndicator
>
</
businessName
>
<
mainBusinessPhysicalAddress
>
<
stateCode
>
VIC
</
stateCode
>
<
postcode
>
3008
</
postcode
>
<
isCurrentIndicator
>
Y
</
isCurrentIndicator
>
</
mainBusinessPhysicalAddress
>
</
searchResultsRecord
>
<
searchResultsRecord
>
<
ABN
>
<
identifierValue
>
30146899103
</
identifierValue
>
<
identifierStatus
>
Cancelled
</
identifierStatus
>
</
ABN
>
<
mainName
>
<
organisationName
>
ANZ COMPANIES PTY LIMITED
</
organisationName
>
<
score
>
100
</
score
>
<
isCurrentIndicator
>
Y
</
isCurrentIndicator
>
</
mainName
>
<
mainBusinessPhysicalAddress
>
<
stateCode
>
NSW
</
stateCode
>
<
postcode
>
2134
</
postcode
>
<
isCurrentIndicator
>
Y
</
isCurrentIndicator
>
</
mainBusinessPhysicalAddress
>
</
searchResultsRecord
>
<
searchResultsRecord
>
<
ABN
>
<
identifierValue
>
22169448220
</
identifierValue
>
<
identifierStatus
>
Active
</
identifierStatus
>
</
ABN
>
<
mainName
>
<
organisationName
>
ANZ CORPORATION PTY LTD
</
organisationName
>
<
score
>
100
</
score
>
<
isCurrentIndicator
>
Y
</
isCurrentIndicator
>
</
mainName
>
<
mainBusinessPhysicalAddress
>
<
stateCode
>
NSW
</
stateCode
>
<
postcode
>
2009
</
postcode
>
<
isCurrentIndicator
>
Y
</
isCurrentIndicator
>
</
mainBusinessPhysicalAddress
>
</
searchResultsRecord
>
I need to fetch searchResultsRecord node for 50 times
XmlNodeList nodesInfo = responseXml.SelectNodes(
"./searchResultsList/searchResultsRecord"
);
foreach
(XmlNode result
in
responseXml.SelectNodes(
"Payload"
))
{
XmlDocument doc1 =
new
XmlDocument();
result.AppendChild(doc1);
}
My xpath is wrong it seems. How can i get proper xpath after the payload everynode is null.
Reply
Answers (
2
)
Difference between stack and queue
How to learn Dot Net Based DevOps And Azure DevOps