Skip to content

Commit

Permalink
Fixed the '<ns1>:<ns2>:<name>' error leading to 'x:<ns2>:<name> xmlns…
Browse files Browse the repository at this point in the history
…:x='<ns1>'
  • Loading branch information
AdrienCastex committed May 20, 2017
1 parent 76d8bb0 commit f3e15a4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/helper/XML.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/helper/XML.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f3e15a4

Please sign in to comment.