0

I have a probleme to get the max value of CategoryLevel I write this but it says Invalidate Predicate.

document=xmlParser.parse("Categories.xml")

xpathQuery="{0}CategoryArray/{0}Category[not({0}CategoryArray/{0}Category/{0}CategoryLevel>{0}CategoryLevel)]".format(namespace)

categories=root.find(xpathQuery)

The xml file

<GetCategoriesResponse xmlns="urn:xxxxxxxx:xxxxx:xxxxxxxx">
<CategoryArray>
    <Category>          
        <CategoryLevel>1</CategoryLevel>            
    </Category>
    <Category>
        <CategoryLevel>2</CategoryLevel>    
    </Category>
    <Category>          
        <CategoryLevel>3</CategoryLevel>            
    </Category>
    <Category>
        <CategoryLevel>2</CategoryLevel>    
    </Category>

I want to check if this xpath query is suitable to extract the maximum value of categoryLevel or not, and i don't understand the answer of the other post. Could you please tell me the source of my error?! Cordially

2
  • Possible duplicate of Getting elements with default namespace (no namespace prefix) using XPath Commented Nov 8, 2016 at 14:01
  • I want to check if this xpath query is suitable to extract the maximum value of categoryLevel or not, and i don't understand the answer of the other post. Could you please tell me the source of my error?! Cordially Commented Nov 8, 2016 at 14:17

0

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.