From 20d4a27f0a7c6a50f8702a9ff7eeaa7e8bc88d31 Mon Sep 17 00:00:00 2001 From: Neil Fraser Date: Tue, 2 Jul 2019 03:48:51 -0700 Subject: [PATCH] Add namespacing to XML Fixes #1978. --- core/utils/xml.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/utils/xml.js b/core/utils/xml.js index d3467f285..3de333364 100644 --- a/core/utils/xml.js +++ b/core/utils/xml.js @@ -32,6 +32,10 @@ */ goog.provide('Blockly.utils.xml'); +/** + * Namespace for Blockly's XML. + */ +Blockly.utils.xml.NAME_SPACE = 'https://developers.google.com/blockly/xml'; /** * Create DOM element for XML. @@ -40,9 +44,8 @@ goog.provide('Blockly.utils.xml'); * @package */ Blockly.utils.xml.createElement = function(tagName) { - // TODO (#1978): Namespace this element. // TODO (#2082): Support node.js. - return document.createElement(tagName); + return document.createElementNS(Blockly.utils.xml.NAME_SPACE, tagName); }; /**