edgeport - v1.0.6
    Preparing search index...

    Function parseFragment

    • Parses a single complete XML element from a string (the raw-XML escape hatch).

      Intended for building a stanza payload from hand-written markup. The input must contain exactly one root element (leading declaration/comments are ignored).

      Parameters

      • xml: string

        A well-formed XML fragment with a single root element.

      Returns XmlElement

      The parsed root element.

      If the input has no element or is malformed.

      1.0.4

      import { parseFragment } from 'edgeport/xmpp';

      const geo = parseFragment("<geoloc xmlns='http://jabber.org/protocol/geoloc'><lat>1</lat></geoloc>");