<div class="content" style="opacity: 1;">
<div class="A" >
<ul class ="any" >
<div class ="demo" >
<div class="pipe" >
<ul class= "markedl-list">
I want to select class content except sub class "marked-list" Any help?
Assuming the elements you're trying to select are direct children of
divwith the classcontentand you don't need to select the parent "content" div, this xpath 1.0 should work...Note the possible misspelling of "markedl-list".
Also, the use of
contains(concat(' ',normalize-space(@class),' '),' someclass ')might seem like overkill, but will account for the possibility of classes other than the target class being in the class attribute. If you can use XPath 2.0, this test is much cleaner (How can I match on an attribute that contains a certain string?).Example: http://www.xpathtester.com/xpath/d449841c402b3e15ef69e3004a39ee6c