I was looking into HTML:Element documentation and came across attr_get_i method which according to documentation states that:
In list context, returns a list consisting of the values of the given
attribute for $h and for all its ancestors starting from $h and
working its way up.
Now, according to the example given there:
<html lang='i-klingon'>
<head><title>Pati Pata</title></head>
<body>
<h1 lang='la'>Stuff</h1>
<p lang='es-MX' align='center'>
Foo bar baz <cite>Quux</cite>.
</p>
<p>Hooboy.</p>
</body>
</html>
If $h is the <cite> element, $h->attr_get_i("lang") in list context will return the list ('es-MX', 'i-klingon').
Now, according to my unuderstanding the returned list should be ('es-MX', 'la', 'i-klingon') that is it should also consider <h1 lang='la'>Stuff</h1> but according to the documentation it doesn’t.
Now, why am I wrong here.
The ‘lang’ attributes here are:
The
<cite>node does not have<h1>as its parent (path is/html/body/p/cite), so<h1>is not its ancestor. This is why the method does not return it.