Strophe.js
    Preparing search index...

    Function xmlText

    • A string as XML is able to carry it, for the places one is put into a tree without a parser ever reading it.

      Line endings are normalised as XML 1.0 ยง 2.11 requires. Left alone, a CRLF reaches the wire intact and every recipient's parser turns it into a line feed, so the sender's own tree disagrees with the one everyone else holds about a message they all received whole.

      A character XML cannot represent is refused. Nothing escapes one, so a stanza carrying it is unsendable: it would be serialized unchanged, and the server would answer the stream with not-well-formed and close it, costing the connection rather than the one message.

      Parameters

      • text: string
      • subject: string

        What to call the text in the error, as the sentence's subject: A text node, The "id" attribute.

      Returns string

      The text, with its line endings normalised.