Xsl when test attribute exists

01.02.2019 Admin

We can achieve if else by using below code. Nodeset when selectbar did not find. Any children elements named bar. But how could i check if an attribute does not exist.

If not, the template will not be applied at all. I want to remove the attribute and add it as an element.

If the attributes were elements, i can do this with a count of all the named elements below the element. I added a test to verify if 'tuple' has an attribute but it returns a blank 'ecatalogue' element. That tests if the string value is empty, which is true if there isn't an attribute or of it s explictly empty. Your post is not quite clear on that point.

If this attribute does not exist then i need to write. I notice that sometimes the element name 'tuple' has an attribute. Result i had with this template above. I would like to do a test to determine if a named attribute exists in one or more of the child elements.