Short question: Creating a XML file

조회 수: 1 (최근 30일)
MiauMiau
MiauMiau 2013년 1월 15일
Hi
I would like to know if my general approach to creating XML files is correct:
docNode = com.mathworks.xml.XMLUtils.createDocument('root_element');
cell = docNode.getDocumentElement;
cell.setAttribute('id','12345')
child = docNode.createElement('successor');
cell.appendChild(child)
First I creat the document, then I identify the root, then creat an element, and this element I append to the root. If this should be correct, where would I find the generated XML?
Thanks
  댓글 수: 1
Image Analyst
Image Analyst 2013년 1월 15일
편집: Image Analyst 2013년 1월 15일
Don't use cell - it's a built in function. Use another name, like myTree or something like that.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile 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!

Translated by