xmlwrite : Attributes are alphabetically sorted
이전 댓글 표시
Hi
Does the xmlwrite() function use some sort of a sorting algorithm? When I execute the following code:
entry_node = docNode.createElement('myelement');
entry_node.setAttribute('name', myStruct.name);
entry_node.setAttribute('value', myStruct.value);
entry_node.setAttribute('unit', myStruct.unit);
docNode.getDocumentElement.appendChild(entry_node);
I get an XML file as follows:
<?xml version="1.0" encoding="utf-8"?>
<mySpec>
<myelement name="myName" unit="myUnit" value="myValue"/>
</mySpec>
What I need is:
<?xml version="1.0" encoding="utf-8"?>
<mySpec>
<myelement name="myName" value="myValue" unit="myUnit"/>
</mySpec>
Is there anyway to suppress the sorting algorithm(if any exists)?
Thanks in advance.
Regards, Vamsi
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Structured Data and XML Documents에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!