Loading TOC...

Element.getAttribute

Element.getAttribute(
   $name as String
) as String

Summary

Get the value of the attribute of this element with the given name, if any.

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 getAttributeNS instead.

Example

cts.doc("example.xml").getElementById("ex1").getAttribute("class")

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.

Comments

The commenting feature on this page is enabled by a third party. Comments posted to this page are publicly visible.