Namespace: EMLUtilities

EMLUtilities

A generic utility object that contains functions used throughout MetacatUI to perform useful functions related to EML, but not used to store or manipulate any state about the application.
Since:
  • 2.34.0
Source:

Methods

getParentEML(model, maxTriesopt) → {EML211|false}

Climbs up the model hierarchy until it finds the EML model
Parameters:
Name Type Attributes Description
model Backbone.Model The starting model
maxTries number <optional>
The maximum number of levels to climb
Source:
Returns:
- Returns the EML 211 Model or null if not found
Type
EML211 | false

serializeDOM(dom) → {string}

Serialize a DOM element to a string, removing the XML declaration and any namespace declarations. Namespaces are added to the elements because the codebase currently combines older ways of handling XML (using jQuery's parseHTML and document.createElement) with newer ways (using DOMParser). While we transition to using modern methods, this function can be used to clean up the serialized XML.
Parameters:
Name Type Description
dom Element The DOM element to serialize
Since:
  • 2.35.0
Source:
Returns:
The serialized XML string
Type
string