Add or modify attributes of the current element.
The attributes should be passed in object notation. This function does not move the current element pointer.
The attributes to add/modify in object notation.
If an attribute is set to null or undefined, it will be removed.
The Strophe.Builder object.
Build the stanza the template describes.
Add a child to the current element and make it the new current element.
This function moves the current element pointer to the child, unless text is provided. If you need to add another child, it is necessary to use up() to go back to the parent in the tree.
The name of the child.
Optionalattrs: string | Record<string, string>
The attributes of the child in object notation.
Optionaltext: string
The text to add to the child.
The Strophe.Builder object.
Add a child to the current element and make it the new current element.
This function is the same as c() except that instead of using a name and an attributes object to create the child it uses an existing DOM element object.
A DOM element.
The Strophe.Builder object.
Replace current element contents with the HTML passed in.
This does not make the child the new current element
The html to insert as contents of current element.
The Strophe.Builder object.
Make the root element the new current element.
When at a deeply nested element in the tree, this function can be used to jump back to the root of the tree, instead of having to repeatedly call up().
The Strophe.Builder object.
Add a child text element.
This does not make the child the new current element since there are no children of text elements.
The text data to append to the current element.
The Strophe.Builder object.
Serialize the DOM tree to a String.
This function returns a string serialization of the current DOM tree. It is often used internally to pass data to a Strophe.Request object.
The serialized DOM tree in a String.
Return the DOM tree.
This function returns the current DOM tree as an element object. This is suitable for passing to functions like Strophe.Connection.send().
The DOM tree as a element object.
Make the current parent element the new current element. This function is often used after c() to traverse back up the tree.
The Strophe.Builder object.
StaticfromStaticserializeRender a DOM element and all descendants to a String.
A DOM element.
The serialized element tree as a String.
StatictoTurns the passed-in string into an XML Element.
OptionalthrowErrorIfInvalidNS: booleanStaticunsafeA directive which can be used to pass a string of XML as a value to the stx tagged template literal.
It's considered "unsafe" because it can pose a security risk if used with untrusted input.
A Stanza represents a XML element used in XMPP (commonly referred to as stanzas).