-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>
2

1 Answer 1

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>
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.