From f3e15a495e7a37887cdcf7905e3042c35283b59b Mon Sep 17 00:00:00 2001 From: Adrien Castex Date: Sat, 20 May 2017 18:03:33 +0200 Subject: [PATCH] Fixed the '::' error leading to 'x:: xmlns:x='' --- lib/helper/XML.js | 2 +- src/helper/XML.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/helper/XML.js b/lib/helper/XML.js index 98763362..e85b79c8 100644 --- a/lib/helper/XML.js +++ b/lib/helper/XML.js @@ -88,7 +88,7 @@ var XML = (function () { attributes = {}; var li1 = name.lastIndexOf(':'); var li2 = name.indexOf(':'); - var lindex = Math.max(li1 === li2 ? -1 : li2, name.lastIndexOf('/')) + 1; + var lindex = Math.max(li1 === li2 ? -1 : li1, name.lastIndexOf('/')) + 1; if (lindex !== 0) { attributes['xmlns:x'] = name.substring(0, lindex); name = 'x:' + name.substring(lindex); diff --git a/src/helper/XML.ts b/src/helper/XML.ts index 02a613b2..a67ede56 100644 --- a/src/helper/XML.ts +++ b/src/helper/XML.ts @@ -124,7 +124,7 @@ export abstract class XML const li1 = name.lastIndexOf(':'); const li2 = name.indexOf(':'); - const lindex = Math.max(li1 === li2 ? -1 : li2, name.lastIndexOf('/')) + 1; + const lindex = Math.max(li1 === li2 ? -1 : li1, name.lastIndexOf('/')) + 1; if(lindex !== 0) { attributes['xmlns:x'] = name.substring(0, lindex);