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.
` in your example is not an ancestor of ``, therefore it is not considered when searching for attributes via inheritance.
– choroba Sep 12 '12 at 17:24