Caplin Trader 4.7.1

Class: module:caplin/core/XmlParser

module:caplin/core/XmlParser

Constructor

new module:caplin/core/XmlParser()

Constructs an XmlParser. This has been included for backwards compatibility.

It is recommended that the module:caplin/core/XmlParser#getInstance method is used to get an instance instead of generating a new XmlParser every time.

Utility class that provides methods for parsing XML strings into Document Objects. The object is a singleton so caplin.core.XmlParser should be used to obtain an instance of an XmlParser.

Example:

var xmlParser = br.util.XmlParser;
var doc = xmlParser.parse("<test />");
console.log(doc);

The module:caplin/core/XmlUtility singleton provides further helper methods to manipulate XML.

Deprecated:
  • This functionality is now provided by BladeRunnerJS, and this proxy class will be removed from CaplinTrader in a future release. Please update any references to this class in your code.
    See:

    Methods

    (static) getInstance() → {module:caplin/core/XmlParser}

    Gets an instance of XmlParser. This is intended to allow a single instance to be used throughout the application.
    Deprecated:
    • This method is no longer needed as XmlParser is now a singleton.
      Returns:
      An instance of XmlParser.
      Type
      module:caplin/core/XmlParser

      (static) parse()

      Deprecated:
      • This functionality is now provided by BladeRunnerJS, and this proxy method will be removed from CaplinTrader in a future release. Please update any references to this method in your code.
        See:

        (static) parseString(sXml) → {DOMDocument}

        Parses an XML string and returns a document object representation.
        Parameters:
        Name Type Description
        sXml String The XML string to be parsed.
        Deprecated:
        • This method produces different XML DOM representations for the specified XML depending on which browser it is run within. For example, IE strips out whitespace whilst Firefox keeps it. It is recommended that the module:br/util/XmlParser.parse method is used instead.
          Returns:
          An XML DOM representing the specified XML. If the XML failed to be parsed an XML DOM with the root node parsererror will be returned.
          Type
          DOMDocument

          (static) stripWhitespace()

          Deprecated:
          • This functionality is now provided by BladeRunnerJS, and this proxy method will be removed from CaplinTrader in a future release. Please update any references to this method in your code.
            See: