From ec7a9bb51cbe467087f3b4aacc86544c6933ef43 Mon Sep 17 00:00:00 2001 From: Sebastian Helzle Date: Tue, 8 Oct 2019 09:25:59 +0200 Subject: [PATCH] Simplify check for xmlns attribute --- src/view/domconverter.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/view/domconverter.js b/src/view/domconverter.js index cc1eb92ba..f0723a718 100644 --- a/src/view/domconverter.js +++ b/src/view/domconverter.js @@ -224,9 +224,8 @@ export default class DomConverter { return domElement; } else { // Create DOM element. - const namespace = viewNode.getAttribute( 'xmlns' ); - if ( namespace !== undefined ) { - domElement = domDocument.createElementNS( namespace, viewNode.name ); + if ( viewNode.hasAttribute( 'xmlns' ) ) { + domElement = domDocument.createElementNS( viewNode.getAttribute( 'xmlns' ), viewNode.name ); } else { domElement = domDocument.createElement( viewNode.name ); }