Why doesn't this XPath query work as I assumed?
Posted: Mon Sep 15, 2025 12:47 pm
Hello,
I have the following query (XPath 2.0):
I'm looking to find topic and xref elements that have a hash in their href attribute while excluding certain types of elements. The issue is that the query above doesn't show elements with @outputclass='expandable'.
I had to run a separate query to identify those elements:
Why doesn't the first, longer query display those elements? I also tried using contains(@class, '- topic/xref') instead of @class='- topic/xref', but it didn't make a difference.
I have the following query (XPath 2.0):
Code: Select all
//xref[contains(@href,'#') and @class='- topic/xref ' and @type!='step' and @type!='fig' and @type!='substep']
I had to run a separate query to identify those elements:
Code: Select all
//xref[contains(@href,'#') and @outputclass='expandable']