The answer is neither.
The problem is (that) you tried to use that as a relative pronoun, but you have nothing to relate the two clauses.
Let's take a closer look at your sentence.
For example div[@id=”content” or contains(@class,”content”)]
can be used to show a node that the value of its id attribute is “content” or the value of its class attribute contains “content”.
This could look like that relates to its, but actually it does not.
Let's try something simpler:
Two sentences: This is a cat. This cat sleeps a lot.
One complex sentence: This is the cat that sleeps a lot.
(= This is a the cat this cat that sleeps a lot.)
That's how a relative pronoun works in general. It has to replace something in the subordinated clause, usually either the subject or the object of the subordinated clause.
So, how should we fix your sentence?
My first thought was to use that as a subordinating conjunction instead (to show [that ...]), but according to the intended meaning, to obtain fits the sentence better. (For the sake of simplicity, I'll assume that we will obtain only one node.) So, let's consider the whole idea (with the verb to obtain) as two sentences first:
- For example,
div[@id=”content” or contains(@class,”content”)]
can be used to obtain a node.
- The value of the attribute
id
of this node is “content” or the value of the attribute class
(of this node) contains “content”.
Fix #1: Use of which
An obvious way to join the two sentences is to use which in the place of node in the subordinate clause (sentence 2). The result will look like this:
For example, div[@id=”content” or contains(@class,”content”)]
can be used to obtain the node of which the value of the attribute id
is “content” or the value of the attribute class
contains “content”.
Fix #2: Use whose
Though of which is possible, it's more common to simply use whose. Whose is corresponding to its in the subordinated clause, which is the OP's original problem. Using whose instead of of which, we get this:
For example, div[@id=”content” or contains(@class,”content”)]
can be used to obtain the node whose the value of attribute id
is “content” or the value of attribute class
contains “content”.
But, wait! We can even make it a little better:
For example, div[@id=”content” or contains(@class,”content”)]
can be used to obtain the node whose either the value of attribute id
is or the value of attribute class
contains “content”.