static getElementsFromCollection_(
      element, attributeName, collection, prefixName, nsName) {
    const items = [];

    if (!element || collection.length < 1) {
      return items;
    }

    const attributeValue = shaka.text.TtmlTextParser.getInheritedAttribute_(
        element, attributeName, nsName);

    if (attributeValue) {
      // There could be multiple items in one attribute
      // <span style="style1 style2">A cue</span>
      const itemNames = attributeValue.split(' ');

      for (const name of itemNames) {
        for (const item of collection) {
          if ((prefixName + item.attributes['xml:id']) == name) {
            items.push(item);
            break;
          }
        }
      }
    }

    return items;
  }
Selects items from |collection| whose id matches |attributeName|
from |element|.

@param {shaka.extern.xml.Node} element
@param {string} attributeName
@param {!Array<shaka.extern.xml.Node>} collection
@param {string} prefixName
@param {string=} nsName
@return {!Array<!shaka.extern.xml.Node>}
@private