With my XML
<products>
<product id="12" type="modell">
<attribute type="image">nose.jpg</attribute>
<product id="13" type="kid">
<attribute type="image">face.jpg</attribute>
</product>
</product>
<product id="22" type="modell">
...
</product>
</products>
and xquery I except to get every attribute with type image
under my product with id 12
.
What I tried so far:
data(for $image in //product[@id = '12']/*/attribute[@type='IMAGE']
return $image)
Which will not work (without *
I'm getting only the nose.jpg
), but I m searching for a way to return face.jpg
and nose.jpg
.
Any hints?