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

Ado Riadh
  • 19
  • 7
  • Possible duplicate of [Getting elements with default namespace (no namespace prefix) using XPath](http://stackoverflow.com/questions/16717211/getting-elements-with-default-namespace-no-namespace-prefix-using-xpath) – Markus Nov 08 '16 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 – Ado Riadh Nov 08 '16 at 14:17

0 Answers0