src/sap.ui.core/src/sap/ui/core/util/XMLPreprocessor.js
function visitNode(oNode, oWithControl) {
				var fnVisitor;

				function visitAttributesAndChildren() {
					return visitAttributes(oNode, oWithControl).then(function () {
						return visitChildNodes(oNode, oWithControl);
					}).then(function () {
						if (fnSupportInfo) {
							fnSupportInfo({context:oNode, env:{caller:"visitNode", after: {name: oNode.tagName}}});
						}
					});
				}

				// process only ELEMENT_NODEs
				if (oNode.nodeType !== 1 /* Node.ELEMENT_NODE */) {
					return oSyncPromiseResolved;
				}
				if (fnSupportInfo) {
					fnSupportInfo({context:oNode, env:{caller:"visitNode", before: {name: oNode.tagName}}});
				}
				if (oNode.namespaceURI === sNAMESPACE) {
					switch (oNode.localName) {
					case "alias":
						return templateAlias(oNode, oWithControl);

					case "if":
						return templateIf(oNode, oWithControl);

					case "repeat":
						return templateRepeat(oNode, oWithControl);

					case "with":
						return templateWith(oNode, oWithControl);

					default:
						error("Unexpected tag ", oNode);
					}
				} else if (oNode.namespaceURI === "sap.ui.core") {
					switch (oNode.localName) {
					case "ExtensionPoint":
						return templateExtensionPoint(oNode, oWithControl).then(function (bResult) {
							if (bResult) {
								return visitAttributesAndChildren();
							}
						});

					case "Fragment":
						if (oNode.getAttribute("type") === "XML") {
							return templateFragment(oNode, oWithControl);
						}
						break;

					// no default
					}
				} else {
					fnVisitor = mVisitors[oNode.namespaceURI + " " + oNode.localName]
						|| mVisitors[oNode.namespaceURI];

					if (fnVisitor) {
						iNestingLevel++;
						debug(oNode, "Calling visitor");
						return fnVisitor(oNode, createCallbackInterface(oWithControl))
							.then(function (vVisitorResult) {
								if (vVisitorResult !== undefined) {
									// prepare for later enhancements using return value
									error("Unexpected return value from visitor for ", oNode);
								}
								debugFinished(oNode);
								iNestingLevel -= 1;
							});
					}
				}

				return visitAttributesAndChildren();
			}
function visitNode(oNode, oWithControl) {
				var fnVisitor;

				function visitAttributesAndChildren() {
					return visitAttributes(oNode, oWithControl).then(function () {
						return visitChildNodes(oNode, oWithControl);
					}).then(function () {
						if (fnSupportInfo) {
							fnSupportInfo({context:oNode, env:{caller:"visitNode", after: {name: oNode.tagName}}});
						}
					});
				}

				// process only ELEMENT_NODEs
				if (oNode.nodeType !== 1 /* Node.ELEMENT_NODE */) {
					return oSyncPromiseResolved;
				}
				if (fnSupportInfo) {
					fnSupportInfo({context:oNode, env:{caller:"visitNode", before: {name: oNode.tagName}}});
				}
				if (oNode.namespaceURI === sNAMESPACE) {
					switch (oNode.localName) {
					case "alias":
						return templateAlias(oNode, oWithControl);

					case "if":
						return templateIf(oNode, oWithControl);

					case "repeat":
						return templateRepeat(oNode, oWithControl);

					case "with":
						return templateWith(oNode, oWithControl);

					default:
						error("Unexpected tag ", oNode);
					}
				} else if (oNode.namespaceURI === "sap.ui.core") {
					switch (oNode.localName) {
					case "ExtensionPoint":
						return templateExtensionPoint(oNode, oWithControl).then(function (bResult) {
							if (bResult) {
								return visitAttributesAndChildren();
							}
						});

					case "Fragment":
						if (oNode.getAttribute("type") === "XML") {
							return templateFragment(oNode, oWithControl);
						}
						break;

					// no default
					}
				} else {
					fnVisitor = mVisitors[oNode.namespaceURI + " " + oNode.localName]
						|| mVisitors[oNode.namespaceURI];

					if (fnVisitor) {
						iNestingLevel++;
						debug(oNode, "Calling visitor");
						return fnVisitor(oNode, createCallbackInterface(oWithControl))
							.then(function (vVisitorResult) {
								if (vVisitorResult !== undefined) {
									// prepare for later enhancements using return value
									error("Unexpected return value from visitor for ", oNode);
								}
								debugFinished(oNode);
								iNestingLevel -= 1;
							});
					}
				}

				return visitAttributesAndChildren();
			}
function visitNode ( oNode , oWithControl ) { var fnVisitor ; function visitAttributesAndChildren ( ) { return visitAttributes ( oNode , oWithControl ) . then ( function ( ) { return visitChildNodes ( oNode , oWithControl ) ; } ) . then ( function ( ) { if ( fnSupportInfo ) { fnSupportInfo ( { context : oNode , env : { caller : "visitNode" , after : { name : oNode . tagName } } } ) ; } } ) ; } // process only ELEMENT_NODEs if ( oNode . nodeType !== 1 /* Node.ELEMENT_NODE */ ) { return oSyncPromiseResolved ; } if ( fnSupportInfo ) { fnSupportInfo ( { context : oNode , env : { caller : "visitNode" , before : { name : oNode . tagName } } } ) ; } if ( oNode . namespaceURI === sNAMESPACE ) { switch ( oNode . localName ) { case "alias" : return templateAlias ( oNode , oWithControl ) ; case "if" : return templateIf ( oNode , oWithControl ) ; case "repeat" : return templateRepeat ( oNode , oWithControl ) ; case "with" : return templateWith ( oNode , oWithControl ) ; default : error ( "Unexpected tag " , oNode ) ; } } else if ( oNode . namespaceURI === "sap.ui.core" ) { switch ( oNode . localName ) { case "ExtensionPoint" : return templateExtensionPoint ( oNode , oWithControl ) . then ( function ( bResult ) { if ( bResult ) { return visitAttributesAndChildren ( ) ; } } ) ; case "Fragment" : if ( oNode . getAttribute ( "type" ) === "XML" ) { return templateFragment ( oNode , oWithControl ) ; } break ; // no default } } else { fnVisitor = mVisitors [ oNode . namespaceURI + " " + oNode . localName ] || mVisitors [ oNode . namespaceURI ] ; if ( fnVisitor ) { iNestingLevel ++ ; debug ( oNode , "Calling visitor" ) ; return fnVisitor ( oNode , createCallbackInterface ( oWithControl ) ) . then ( function ( vVisitorResult ) { if ( vVisitorResult !== undefined ) { // prepare for later enhancements using return value error ( "Unexpected return value from visitor for " , oNode ) ; } debugFinished ( oNode ) ; iNestingLevel -= 1 ; } ) ; } } return visitAttributesAndChildren ( ) ; }
Visits the given node.

@param {Node} oNode the XML DOM node
@param {sap.ui.core.template._with} oWithControl the "with" control
@returns {sap.ui.base.SyncPromise}
A sync promise which resolves with <code>undefined</code> as soon as visiting is
done, or is rejected with a corresponding error if visiting fails.
@throws {Error}
If an unexpected tag in the template namespace is encountered
Visits the given node .