My problem is I want to be able to read through this xml document and populate a winform before validating it and then storing it into a table. This is a snippet of the xml document, it's way too big to put it all here.
- <Applicant>
+ <common:PersonName>
<pdt:PersonNameTitle>Mrs</pdt:PersonNameTitle>
<pdt:PersonGivenName>Helen</pdt:PersonGivenName>
<pdt:PersonFamilyName>Smith</pdt:PersonFamilyName>
</common:PersonName>
<common:OrgName>Royal Borough of Kingston</common:OrgName>
+ <common:ExternalAddress>
- <common:InternationalAddress>
<apd:IntAddressLine>Learning & Children's Services</apd:IntAddressLine>
<apd:IntAddressLine>High Road</apd:IntAddressLine>
<apd:IntAddressLine>Noth London</apd:IntAddressLine>
<apd:IntAddressLine>Edmonton</apd:IntAddressLine>
<apd:IntAddressLine />
<apd:Country />
<apd:InternationalPostCode>JT1 1EU</apd:InternationalPostCode>
</common:InternationalAddress>
</common:ExternalAddress>
- <common:ContactDetails PreferredContactMedium="Telephone">
- <common:Email EmailPreferred="no" EmailUsage="work">
<apd:EmailAddress>helen.smith@someemail.com</apd:EmailAddress>
</common:Email>
- <common:Telephone TelMobile="no" TelPreferred="yes" TelUse="work">
<apd:TelNationalNumber>020 888 8888</apd:TelNationalNumber>
</common:Telephone>
- <common:Telephone TelMobile="yes" TelPreferred="no" TelUse="work">
<apd:TelNationalNumber />
</common:Telephone>
- <common:Fax FaxMobile="no" FaxPreferred="no" FaxUse="work">
<apd:FaxNationalNumber />
</common:Fax>
</common:ContactDetails>
</Applicant>
<FileAttachments>
+ <common:FileAttachment>
<common:Identifier>3893714</common:Identifier>
<common:Size>128705</common:Size>
<common:MimeType>application/pdf</common:MimeType>
<common:FileName>5254_091211-hp-nl.pdf</common:FileName>
- <common:PrintInformation>
- <common:PaperSize>
<common:StandardSize>A4</common:StandardSize>
</common:PaperSize>
<common:HasBeenPrinted>true</common:HasBeenPrinted>
<common:HasScale>false</common:HasScale>
</common:PrintInformation>
<common:Reference>5254/091211-hp-nl</common:Reference>
</common:FileAttachment>
+ <common:FileAttachment>
<common:Identifier>3893394</common:Identifier>
<common:Size>237683</common:Size>
<common:MimeType>application/pdf</common:MimeType>
<common:FileName>5254_1000a_091214170715217.pdf</common:FileName>
- <common:PrintInformation>
- <common:PaperSize>
<common:StandardSize>A3</common:StandardSize>
</common:PaperSize>
<common:HasBeenPrinted>true</common:HasBeenPrinted>
<common:HasScale>true</common:HasScale>
</common:PrintInformation>
<common:Reference>5254/1000a</common:Reference>
</common:FileAttachment>
+ <common:FileAttachment>
So far to retrieve the code this is how I have been doing it
Dim elm = _doc.DocumentElement
Dim nl = elm.ChildNodes
Dim rootElement As XmlElement, xmlList As XmlNodeList
Dim nsmr As New XmlNamespaceManager(_doc.NameTable)
nsmr.AddNamespace("common", "http://www.mywebsite")
nsmr.AddNamespace("xsd", "http://www.w3.org/2001/XMLSchema")
nsmr.AddNamespace("apd", "http://www.Mywebsite/AddressAndPersonalDetails")
nsmr.AddNamespace("bs7666", "http://www.Mywebsite/people/bs7666")
nsmr.AddNamespace("core", "http://www.Mywebsite/core")
nsmr.AddNamespace("glm", "http://www.Mywebsite/gml")
nsmr.AddNamespace("mdc", "http://www.Mywebsite/mdces-2006")
nsmr.AddNamespace("org", "www.Mywebsite/financial/OrganisationIdentifiers")
nsmr.AddNamespace("xlink", "http://www.w3.org/1999/xlink")
If (_doc.GetElementsByTagName("ProposalDescription").Count > 0) Then
Dim nlAppData = _doc.GetElementsByTagName("ProposalDescription")
txtPropDesc.Text = nlAppData(0).ChildNodes(0).FirstChild.InnerText
txtPropStarted.Text = nlAppData(0).ChildNodes(1).FirstChild.InnerText
txtPropCompleted.Text = nlAppData(0).ChildNodes(1).ChildNodes(0).FirstChild.InnerText()
End If
What I want to do is something like
dim faList as List of common:FileAttachment
For Each Dim cfa as common:FileAttachment in FileAttachments
faList.add(cfa)
next
'Then
DataGridView1.Datasource = faList
Please, please please help guide me in the right direction