Element.hasAttribute

Element.hasAttribute(
   name as String
) as Boolean

Summary

Whether this element has an attribute with the given name.

Parameters
name The name of the attribute.

Usage Notes

Since lookup is by the string value of the name, it is best to avoid using this method for namespaced attributes. Use hasAttributeNS instead.

Example

cts.doc("example.xml").getElementById("ex1").hasAttribute("class")
Powered by MarkLogic Server | Terms of Use | Privacy Policy