R
rajesh
Hi,
I am trying to parse a xmldocument and to get value of a name tag
"techlanguage" is "vbdotnet".
Here i need to select the propername tag which is "techlanguage" and
the propervalue which is "vbdotnet"
Here is the structure of my XML
<?xml version="1.0" encoding="utf-8" ?>
<filters>
<filter customFilterType="">
<name>techdatabase</name>
<value>sqlserver</value>
</filter>
<filter customFilterType="">
<name>techlanguage</name>
<value>vbdotnet</value>
</filter>
<filter customFilterType="">
<name>techjava</name>
<value>j2ee</value>
</filter>
</filters>
Here is the code that tries to get the techlanguage as vbdotnet
Dim XMLValidateDoc As New XmlDocument
Dim Selectedtechlanguage As
System.Xml.XmlNode
Dim techlanguage As String
Try
XMLValidateDoc.Load(New
StringReader(Me.ucFilterSelector1.FilterXML.ToString()))
Selectedtechlanguage =
XMLValidateDoc.SelectSingleNode("///name[@name=techlanguage ]")
If Not Selectedtechlanguage Is Nothing
Then
'here i need to assign vbdotnet as
the techlanguage
' techlanguage = "vbdotnet" this is
what i exactly want
techlanguage =
Selectedtechlanguage.InnerText
End If
' bla bla
What is exact XPATH query i need to make to get the techlanguage valus
which is vbdotnet.please let me know what is the right code to do
this..
thanks
satish
I am trying to parse a xmldocument and to get value of a name tag
"techlanguage" is "vbdotnet".
Here i need to select the propername tag which is "techlanguage" and
the propervalue which is "vbdotnet"
Here is the structure of my XML
<?xml version="1.0" encoding="utf-8" ?>
<filters>
<filter customFilterType="">
<name>techdatabase</name>
<value>sqlserver</value>
</filter>
<filter customFilterType="">
<name>techlanguage</name>
<value>vbdotnet</value>
</filter>
<filter customFilterType="">
<name>techjava</name>
<value>j2ee</value>
</filter>
</filters>
Here is the code that tries to get the techlanguage as vbdotnet
Dim XMLValidateDoc As New XmlDocument
Dim Selectedtechlanguage As
System.Xml.XmlNode
Dim techlanguage As String
Try
XMLValidateDoc.Load(New
StringReader(Me.ucFilterSelector1.FilterXML.ToString()))
Selectedtechlanguage =
XMLValidateDoc.SelectSingleNode("///name[@name=techlanguage ]")
If Not Selectedtechlanguage Is Nothing
Then
'here i need to assign vbdotnet as
the techlanguage
' techlanguage = "vbdotnet" this is
what i exactly want
techlanguage =
Selectedtechlanguage.InnerText
End If
' bla bla
What is exact XPATH query i need to make to get the techlanguage valus
which is vbdotnet.please let me know what is the right code to do
this..
thanks
satish