Interface XMQAttr
- All Superinterfaces:
XMQNode
An xml attribute, like xmqAttributeType. Its children are the raw value
split into text nodes and entity references, and the value is the
concatenation of the children.
-
Method Summary
Modifier and TypeMethodDescriptionelement()Returns the element this attribute belongs to.ns()Returns the namespace of the attribute, like the libxml2 xmlAttr ns.rawValue()Returns the raw value as found in the file, or null for a parsed attribute.voidSet the namespace of the attribute.voidSet the value of the attribute.value()Returns the value of the attribute, the concatenation of the children.Methods inherited from interface XMQNode
addChild, addNextSibling, addPrevSibling, appendRaw, children, content, doc, firstChild, fullName, lastChild, line, name, next, numChildren, parent, prev, replaceWith, setContent, setLine, setName, textContent, type, unlinkModifier and TypeMethodDescriptionAdd a child like xmqAddChild.Insert a sibling after this node, like xmqAddNextSibling (but without text merging).Insert a sibling before this node, like xmqAddPrevSibling (but without text merging).Append a child without merging adjacent text nodes.children()Returns a new list with the children of this node.content()Returns the text content of text like nodes (text, cdata, comment, pi).doc()Returns the document owning this node.Returns the first child.fullName()Returns the full name, ie prefix:name if the node has a namespace with a prefix.Returns the last child.intline()Returns the source line of the node, like xmqGetLineNumber: elements get the line where their start tag ends, text the line where its first chunk was read, comments, processing instructions and cdata sections the line where they end.name()Returns the name of the node.next()Returns the next sibling.intReturns the number of children.parent()Returns the parent node.prev()Returns the previous sibling.voidReplace this node with another node, like xmqReplaceNode.voidsetContent(String content) Set the content of a text like node.voidsetLine(int line) Set the source line of the node.voidSet the name of the node.Returns the string value of the node, like xmqGetString.type()Returns the type of this node.voidunlink()Remove this node from its parent and siblings, like xmqUnlinkNode.
-
Method Details
-
ns
XMQNS ns()Returns the namespace of the attribute, like the libxml2 xmlAttr ns.- Returns:
- The namespace or null.
-
setNs
-
value
String value()Returns the value of the attribute, the concatenation of the children. Character references contribute their character.- Returns:
- The value, never null.
-
rawValue
String rawValue()Returns the raw value as found in the file, or null for a parsed attribute.- Returns:
- The raw value or null.
-
setValue
Set the value of the attribute. If the value contains entities, then the value is kept as-is in a single text child, and rawValue() returns it, like for a raw attribute found in a file.- Parameters:
value- The value.
-
element
-