Class: shaka.util.XmlUtils

A set of XML utility functions.

Constructor

new XmlUtils()

A set of XML utility functions.

Source:

Members

trustedHTMLFromString_ :shaka.util.Lazy.<function(!string): (!TrustedHTML|!string)>

Promote a string to TrustedHTML. This function is security-sensitive and should only be used with security approval where the string is guaranteed not to cause an XSS vulnerability.
Type:
Source:

Methods

parseXml(data, expectedRootElemName) → {Element}

Parse some data (auto-detecting the encoding) and return the resulting root element if it was valid XML.
Parameters:
Name Type Description
data BufferSource
expectedRootElemName string
Source:
Returns:
Type
Element

parseXmlString(xmlString, expectedRootElemName) → {Element}

Parse a string and return the resulting root element if it was valid XML.
Parameters:
Name Type Description
xmlString string
expectedRootElemName string
Source:
Returns:
Type
Element

toArrayBuffer(elemnon-null) → {ArrayBuffer}

Converts a Element to BufferSource.
Parameters:
Name Type Description
elem Element
Source:
Returns:
Type
ArrayBuffer