1

I'm looking to extract 8 from below piece of XML based on either Shoe Size or MenShoesShoe Size using XPATH.
I've tried some variations but I can only select individual values i.e 8.
And the whitespace is causing issues too, can anyone be of help please?
Of coarse, the whole XML contains many colors and sizes so I'd be looking for all sizes.

<Entry> 
  <Attributes> 
    <Values> 
      <values>Tan</values>  
      <identifier>Tan</identifier>  
    </Values>  
    <identifier>MenShoesColor</identifier>  
    <name>Color</name>  
  </Attributes>  
  <Attributes> 
    <Values> 
      <values>8</values>  
      <identifier>8</identifier>  
    </Values>  
    <identifier>MenShoesShoe Size</identifier>  
    <name>Shoe Size</name>  
  </Attributes> 
</Entry>

2 Answers 2

2

I think this is what you are looking for

//Entry/Attributes[identifier = 'MenShoesShoe Size' or name = 'Shoe Size' ]/Values/values/text()
Sign up to request clarification or add additional context in comments.

Comments

0

If you meant to get values of <Attributes> having "MenShoesShoe Size" identifier or having "Shoe Size" name, then you can try this way (formatted for readability) :

/Entry
/Attributes[indentifier='MenShoesShoe Size' or name='Shoe Size']
/Values
/value

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.