EDN Admin
Well-known member
Using VB.Net, I need to read the following XML from a string variable (not a file) and pull the AuthNo, Client ID, Client Name, Supplier ID, and Supplier Name for each Dispatch contained within the XML. What is the easiest way to do this? I am
using VS 2008 and .Net 2.0.
I have looked at tons of examples on the web using XMLReader but I cant figure out how to pull the separate IDs and match them up with their appropriate Names and also matched up with appropriate AuthNo.
Please help. Thanks, Dennis.
<div style="color:Black;background-color:White; <pre>
<span style="color:Blue; <<span style="color:#A31515; Dispatches<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Dispatch <span style="color:Red; Type<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; DispatchItem<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Identifier <span style="color:Red; Type<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; IdentifierItem<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Id<span style="color:Blue; >9425<span style="color:Blue; </<span style="color:#A31515; Id<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; AuthNo<span style="color:Blue; >11196-0001<span style="color:Blue; </<span style="color:#A31515; AuthNo<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; Identifier<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Client <span style="color:Red; Type<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; ClientItem<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Id<span style="color:Blue; >83921<span style="color:Blue; </<span style="color:#A31515; Id<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Name<span style="color:Blue; >ABC Company<span style="color:Blue; </<span style="color:#A31515; Name<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; Client<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Supplier <span style="color:Red; Type<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; SupplierItem<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Id<span style="color:Blue; >41466643<span style="color:Blue; </<span style="color:#A31515; Id<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Name<span style="color:Blue; >123 Company<span style="color:Blue; </<span style="color:#A31515; Name<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; Supplier<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; VanBase <span style="color:Red; Type<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; VanBaseItem<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Id<span style="color:Blue; >281<span style="color:Blue; </<span style="color:#A31515; Id<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Name<span style="color:Blue; >New York<span style="color:Blue; </<span style="color:#A31515; Name<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; VanBase<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; Dispatch<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Dispatch <span style="color:Red; Type<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; DispatchItem<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Identifier <span style="color:Red; Type<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; IdentifierItem<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Id<span style="color:Blue; >128<span style="color:Blue; </<span style="color:#A31515; Id<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; AuthNo<span style="color:Blue; >22290-0002<span style="color:Blue; </<span style="color:#A31515; AuthNo<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; Identifier<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Client <span style="color:Red; Type<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; ClientItem<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Id<span style="color:Blue; >36569<span style="color:Blue; </<span style="color:#A31515; Id<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Name<span style="color:Blue; >XYZ Company<span style="color:Blue; </<span style="color:#A31515; Name<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; Client<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Supplier <span style="color:Red; Type<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; SupplierItem<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Id<span style="color:Blue; >948<span style="color:Blue; </<span style="color:#A31515; Id<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Name<span style="color:Blue; >999 Company<span style="color:Blue; </<span style="color:#A31515; Name<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; Supplier<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; VanBase <span style="color:Red; Type<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; VanBaseItem<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Id<span style="color:Blue; >83709<span style="color:Blue; </<span style="color:#A31515; Id<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Name<span style="color:Blue; >Kansas City<span style="color:Blue; </<span style="color:#A31515; Name<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; VanBase<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; Dispatch<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; Dispatches<span style="color:Blue; >
[/code]
View the full article
using VS 2008 and .Net 2.0.
I have looked at tons of examples on the web using XMLReader but I cant figure out how to pull the separate IDs and match them up with their appropriate Names and also matched up with appropriate AuthNo.
Please help. Thanks, Dennis.
<div style="color:Black;background-color:White; <pre>
<span style="color:Blue; <<span style="color:#A31515; Dispatches<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Dispatch <span style="color:Red; Type<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; DispatchItem<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Identifier <span style="color:Red; Type<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; IdentifierItem<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Id<span style="color:Blue; >9425<span style="color:Blue; </<span style="color:#A31515; Id<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; AuthNo<span style="color:Blue; >11196-0001<span style="color:Blue; </<span style="color:#A31515; AuthNo<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; Identifier<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Client <span style="color:Red; Type<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; ClientItem<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Id<span style="color:Blue; >83921<span style="color:Blue; </<span style="color:#A31515; Id<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Name<span style="color:Blue; >ABC Company<span style="color:Blue; </<span style="color:#A31515; Name<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; Client<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Supplier <span style="color:Red; Type<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; SupplierItem<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Id<span style="color:Blue; >41466643<span style="color:Blue; </<span style="color:#A31515; Id<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Name<span style="color:Blue; >123 Company<span style="color:Blue; </<span style="color:#A31515; Name<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; Supplier<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; VanBase <span style="color:Red; Type<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; VanBaseItem<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Id<span style="color:Blue; >281<span style="color:Blue; </<span style="color:#A31515; Id<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Name<span style="color:Blue; >New York<span style="color:Blue; </<span style="color:#A31515; Name<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; VanBase<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; Dispatch<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Dispatch <span style="color:Red; Type<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; DispatchItem<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Identifier <span style="color:Red; Type<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; IdentifierItem<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Id<span style="color:Blue; >128<span style="color:Blue; </<span style="color:#A31515; Id<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; AuthNo<span style="color:Blue; >22290-0002<span style="color:Blue; </<span style="color:#A31515; AuthNo<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; Identifier<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Client <span style="color:Red; Type<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; ClientItem<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Id<span style="color:Blue; >36569<span style="color:Blue; </<span style="color:#A31515; Id<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Name<span style="color:Blue; >XYZ Company<span style="color:Blue; </<span style="color:#A31515; Name<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; Client<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Supplier <span style="color:Red; Type<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; SupplierItem<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Id<span style="color:Blue; >948<span style="color:Blue; </<span style="color:#A31515; Id<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Name<span style="color:Blue; >999 Company<span style="color:Blue; </<span style="color:#A31515; Name<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; Supplier<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; VanBase <span style="color:Red; Type<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; VanBaseItem<span style="color:Black; "<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Id<span style="color:Blue; >83709<span style="color:Blue; </<span style="color:#A31515; Id<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; Name<span style="color:Blue; >Kansas City<span style="color:Blue; </<span style="color:#A31515; Name<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; VanBase<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; Dispatch<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; Dispatches<span style="color:Blue; >
[/code]
View the full article