Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/schemaOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,19 @@ define({
}],
alwaysOutput : true
};

// put xmlns attribute first
var tempStyleAttributes = JSON.parse(JSON.stringify(nodeProperties["root/style"].attributes));
for (var styleAttribute in nodeProperties["root/style"].attributes){
if (nodeProperties["root/style"].attributes.hasOwnProperty(styleAttribute) && styleAttribute !== "xmlns"){
delete nodeProperties["root/style"].attributes[styleAttribute];
}
}
for (styleAttribute in tempStyleAttributes){
if (tempStyleAttributes.hasOwnProperty(styleAttribute) && styleAttribute !== "xmlns"){
nodeProperties["root/style"].attributes[styleAttribute] = tempStyleAttributes[styleAttribute];
}
}

nodeProperties["root/style"].attributes["version"].alwaysOutput = true;

Expand Down