-1

I have the next xml file and I want to display the element from first

for example : when I select the with value Xp I want to display the version 1.9 2.0 or if I selected the system Win 10 to dispay the values 3.0 and 3.1 How can I parse this tag to extract the numbers using javascript ?

<system> Xp
  <version>1.9</version>
  <version>2.0</version>
</system>

<system> Win10
  <version>3.0</version>
  <version>3.1</version>
</system>
Clerenz
  • 821
  • 8
  • 23

1 Answers1

1

Your xml is not well formed. An xml element can have either text or child elements as content. Instead, try this

<system os="Xp">
  <version>1.9</version>
  <version>2.0</version>
</system>

or that

<system>
  <os>Xp</os>
  <version>1.9</version>
  <version>2.0</version>
</system>
Clerenz
  • 821
  • 8
  • 23