Hi,
first I want to excuse me if I post in wrong section.
I need some help, I don't have experience in parsing XML's.
I have this type of XML
I want to know how to extract in one string the value from attribute "Comment", the "smart and hard worker", I work in VB.NET
I want in this way, DIM xmlvalue AS STRING and in this variable to put "smart and hard worker"
I tried something in this way but for sure I'm not doing what must to do
Thanks in advance
first I want to excuse me if I post in wrong section.
I need some help, I don't have experience in parsing XML's.
I have this type of XML
HTML:
<MainInfo>
<info name="ABCD"/>
<InfoDetails>
<Detail Attribute="age" Value="12" />
<Detail Attribute="gender" Value="male" />
<Detail Attribute="country" Value="england" />
<Detail Attribute="Comment" Value="smart and hard worker" />
</InfoDetails>
</MainInfo>
I want in this way, DIM xmlvalue AS STRING and in this variable to put "smart and hard worker"
I tried something in this way but for sure I'm not doing what must to do
Dim myXMLString As String = " <MainInfo> <info name="ABCD"/> <InfoDetails> <Detail Attribute="age" Value="12" /> <Detail Attribute="gender" Value="male" /> <Detail Attribute="country" Value="england" /> <Detail Attribute="Comment" Value="smart and hard worker" /> </InfoDetails> </MainInfo>" Dim doc As New XmlDocument() doc.LoadXml(myXMLString) Dim xmlvalue As String Dim items = doc.GetElementsByTagName("InfoDetails") xmlvalue = ?
Thanks in advance
Last edited by a moderator: