Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

rule

A rule is used in a template. The children of the rule are used to declare the conditions in which the rule matches and the content that is generated. A rule may contain where, binding and/or action elements. A condition is defined used a where element. For each result that matches all of the conditions, content within the rule's action body is generated. The bindings element is optional and may specify additional variable bindings to be used.

When no query element is used in a template, a default query is used and the simple query syntax may be used for RDF datasources. For more information about this, see the Simple Query Syntax.

Attributes
iscontainer, isempty, parent, parsetype

Examples

(example needed)

Attributes

iscontainer
Type: boolean
Indicates whether rules match based on containment. If not specified, the rule may match regardless of whether a node is a container or not.
  • true: The rule will only match nodes that are marked as containers. This would apply to nodes that represent folders.
  • false: The rule will only match nodes that are not marked as containers.
isempty
Type: boolean
Indicates whether rules match based on emptyness. If not specified, the rule may match regardless of whether a node has children or not.
  • true: The rule will only match nodes that contain no child elements.
  • false: The rule will only match nodes that contain one or more child elements.
parent
Type: element tag name
If set, the rule will only match the corresponding tag. This may be used to have separate rules for leaf and container nodes with different tags.
parsetype
Type: string
If this attribute is set to Integer, the rule will only match RDF nodes with a parse type of Integer.

Properties

Inherited Properties
align, attributes, allowEvents, baseURI, boxObject, builder, childElementCount, childNodes, children, className, clientHeight, clientLeft, clientTop, clientWidth, collapsed, contextMenu, controllers, database, datasources, dir, firstChild, firstElementChild, flex, height, hidden, id, lastChild, lastElementChild, left, localName, maxHeight, maxWidth, menu, minHeight, minWidth, namespaceURI, nextElementSibling, nextSibling, nodeName, nodeType, nodeValue, observes, ordinal, orient, ownerDocument, pack, parentNode, persist, prefix, previousElementSibling, previousSibling, ref, resource, scrollHeight, scrollLeft, scrollTop, scrollWidth, statusText, style, tagName,textContent, tooltip, tooltipText, top, width

Methods

Inherited Methods
addEventListener(), appendChild(), blur, click, cloneNode(), compareDocumentPosition, dispatchEvent(), doCommand, focus, getAttribute(), getAttributeNode(), getAttributeNodeNS(), getAttributeNS(), getBoundingClientRect(), getClientRects(), getElementsByAttribute, getElementsByAttributeNS, getElementsByClassName(), getElementsByTagName(), getElementsByTagNameNS(), getFeature, getUserData, hasAttribute(), hasAttributeNS(), hasAttributes(), hasChildNodes(), insertBefore(), isDefaultNamespace(), isEqualNode, isSameNode, isSupported(), lookupNamespaceURI, lookupPrefix, normalize(), querySelector(), querySelectorAll(), removeAttribute(), removeAttributeNode(), removeAttributeNS(), removeChild(), removeEventListener(), replaceChild(), setAttribute(), setAttributeNode(), setAttributeNodeNS(), setAttributeNS(), setUserData

Document Tags and Contributors

 Contributors to this page: Sheppy, Marsf, Enn, Ptak82, Dria
 Last updated by: Sheppy,