Element.hasAttribute( name as String ) as Boolean
Whether this element has an attribute with the given name.
Parameters | |
---|---|
name | The name of the attribute. |
Since lookup is by the string value of the name, it is best to avoid using this method for namespaced attributes. Use hasAttributeNS instead.
cts.doc("example.xml").getElementById("ex1").hasAttribute("class")
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.