This extension function allows author actions to be available in a context only if the associated schema permits it.
The oxy:allows-child-element() is evaluated at the cursor position and has the following signature: oxy:allows-child-element($childName, ($attributeName, $defaultAttributeValue, $contains?)?).
oxy:allows-child-element("para")
The
above example verifies if the para element (of the default
namespace) is allowed in the current context.oxy:allows-child-element("*:para")
The
above example verifies if the para element (of any namespace) is
allowed in the current context.oxy:allows-child-element("prefix:para")
The
prefix is resolved in the context of the element where the cursor is located. The
function matches on the element with the para local name from the
previous resolved namespace. If the prefix is not resolved to a namespace, the
function returns a value of false.oxy:allows-child-element("{namespaceURI}para")
The namespaceURI is the namespace of the element. The above example verifies if the para element (of the specified namespace) is allowed in the current context.
oxy:allows-child-element("*")
The
above function verifies if any element is allowed in the current context.oxy:allows-child-element("*", "class", " topic/topic ")The above example verifies if an element with the class attribute and the default value of this attribute (that contains the topic/topic string) is allowed in the current context.
oxy:allows-child-element("*", "*:localname", " topic/topic ")
oxy:allows-child-element("*", "prefix:localname", " topic/topic ")The prefix is resolved in the context of the element where the cursor is located. If the prefix is not resolved to a namespace, the function returns a value of false.