1

I have a XML file containing different publications. I want to find the publication with the highest amount of timesCited which is published before 2010. I have this as of now:

/publications/publication[timesCited = max(/publications/publication/timesCited)]
                         [yearFinished < 2010]

The problem is that this checks for the highest timesCited, which is a publication from 2011, and thus returns nothing. I want to find the publication with the highest amount of citations before 2010. How would I go about this?

1
  • Share your XML source Commented Nov 22, 2017 at 20:03

2 Answers 2

1

The following expression should works

/publications/publication[yearFinished < 2010][timesCited = max(/publications/publication[yearFinished < 2010]/timesCited)]

hope it helps

Sign up to request clarification or add additional context in comments.

Comments

1

This XPath,

//publication[yearFinished < 2010]
             [timesCited = max(//publication[yearFinished < 2010]/timesCited)]

will select the pre-2010 publication element with the maximum timesCited, as requested.

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.