-2

Here is my XML code:

<Car>
      <PTY name="XYZ" value="0"></PTY>
</Car>

I want to get the value of attribute value from this XML by using conditions like

if(<Car> == true){
//retrive attribute value
}

PS: i am new to xml!!

  • Possible duplicate of [Read XML Attribute using XmlDocument](https://stackoverflow.com/questions/933687/read-xml-attribute-using-xmldocument) – Dmitry Pavliv Sep 16 '18 at 15:43

1 Answers1

0

You can use XmlSerializer for deserialize you string to Car class and simply check property value

Mixim
  • 972
  • 1
  • 11
  • 37