Apologies if this is slightly OT...I guessed that XPath knowledge is mostly likely to be found in this forum.
I'm using XPath to locate elements in JavaScript (incidentally its a techinque I highly recommend, makes things much easier) I would like to match a div element that looks like any one of these:
Code:
<div class="modifiers toolbar">
Code:
<div class="toolbar modifiers">
Code:
<div class="modifiers toolbar ">
Code:
<div class=" toolbar modifiers ">
At the moment I'm just doing this:
Code:
.//div[contains(@class, "modifiers") and contains(@class, "toolbar")]
but obviously this is going to match...
Code:
<div class="footoolbar barmodifiers">
...too. I see from
http://www.w3schools.com/xpath/xpath...ons.asp#string that I should be able to use translate() or match() functions but those don't seem to be available. Can anyone provide an explanation as to why that is / how I could achieve this? The JavaScript call (mostly) responsible for using XPath within
JS is this:
Code:
document.createExpression()
Many thanks.