Namespace: browserCompatibility

bcdui.core. browserCompatibility

This namespace contains XML-related functions to make the BCD-UI library work on different browsers' XML implementation. These functions deal with the following issues:

XML Document creation

Factory functions for creating XML documents, parsing and serialization and creating XSLT processors.

XML Manipulation + IE API Compatibilty

The Mozilla / Webkit XML classes are augmented so that they implement the IE-compatible interface. Then the users can focus on this API only.

Namespace handling

Align the handling of XML namespaces and prefixes so that the well-known BCD-UI prefixes as well as user prefixes can be used in the JavaScript API.

Namespaces

ie

Members

staticbcdui.core.browserCompatibility.asyncCreateXsltProcessor

Asynchronous creation of an XSLTProcessor object from a DOM document.

staticbcdui.core.browserCompatibility.ieVersion

Allows for quick testing of IE version, if not iE, this is simply undefined

Methods

staticbcdui.core.browserCompatibility.appendElementWithPrefix(targetElement, name, insertBeforeTargetElement){DomElement}

core/browserCompatibility.js, line 116
Creates a new element whose name can contain a well-known prefix (like "wrs") and appends it to the specified target element. This function should be used rather than createElementNS, because the latter is not available on the Internet Explorer.
Name Type Description
targetElement HtmlElement The targetElement which is used for appending the new element.
name string The element name which may contain a well-known prefix.
insertBeforeTargetElement boolean Preprend instead of append element.
Returns:
Type Description
DomElement The new XMLElement.

staticbcdui.core.browserCompatibility.asyncCreateXsltProcessor(args)

core/browserCompatibility.js, line 143
Asynchronous creation of an XSLTProcessor object from a DOM document.
Name Type Description
args object An argument map containing the following elements:
Name Type Description
model DomDocument The XSLT document the XSLTProcessor instance should be
callBack function The callback function executed when the processor has been created. It takes the processor instance as argument
callerDebug string Additional (debug) information from the caller for logging

staticbcdui.core.browserCompatibility.cleanupGeneratedXslt()

core/extendedBrowserCompatibility.js, line 24
Helper to support namespace-alias for Gecko

staticbcdui.core.browserCompatibility.cloneDocument(doc){DomDocument}

core/browserCompatibility.js, line 63
Name Type Description
doc DomDocument To be cloned
Returns:
Type Description
DomDocument A clone of the given DOM document

staticbcdui.core.browserCompatibility.createDOMFromXmlString(serializedDoc, msg){DomDocument}

core/browserCompatibility.js, line 75
Parses given xml string and creates a DOMDocument out of it.
Name Type Description
serializedDoc string A serialized XML document.
msg string Optional for better error message.
Returns:
Type Description
DomDocument The DOMDocument parsed from the serialized document string.

staticbcdui.core.browserCompatibility.MSXMLDocumentWrapper()

core/browserCompatibility.js, line 217
To be able to attach new functions like createElementNS to our XMLDocument, we need to wrap MSXML ActiceX objects here Sadly, we cannot provide legacy .xml, .text via implicit getter (defineProperty is not available in IE8). Switching to an explicit function xml() or so is also no real option since we cannot provide that for MSXML elements (unless we would proxy them all them) and often it is unknown whether we have an element (no proxy) or a document (is proxied). So, just use standard XMLSerializer from now on. New native XML objects of MS do not support selectSingleNode() nor evaluate(), we still have to use MSXML, can't use document.implementation.createDocument(null,null,null);

staticbcdui.core.browserCompatibility.newDOMDocument(){DomDocument}

core/browserCompatibility.js, line 54
Returns:
Type Description
DomDocument A new DOM document

staticbcdui.core.browserCompatibility.removeObsoleteNS(doc){String}

core/browserCompatibility.js, line 91
removes obsolete namespace declarations and moves used ones to the root element
Name Type Description
doc The document (doc or string) which should be cleaned
Returns:
Type Description
String The serialized and namespace-cleaned representation of the doc

staticbcdui.core.browserCompatibility.resolveNamespace(){string}

core/browserCompatibility.js, line 46
Returns:
Type Description
string URI for a given prefix