xmlread fails if the xml file extension is other than .xml

조회 수: 6 (최근 30일)
Vamsinag Gunti
Vamsinag Gunti 2018년 10월 23일
댓글: Vamsinag Gunti 2018년 10월 31일
Hi,
I am crrently wrting a script that reads and manipulates an XML file. However, I am to read an XML file with a custom extension. For e.g. the name of the XML file is myXMLfile.myExtension. In such a case the xmlread() function fails with the following error:
xmlread('myXMLfile.myExtension')
Error using xmlstringinput (line 42)
File parameter.incparamter not found
Error in xmlread (line 76)
filename = xmlstringinput(filename,true);
Can someone please guide me on this issue?
Thanks in advance.
Regards, Vamsi

채택된 답변

madhan ravi
madhan ravi 2018년 10월 23일
편집: madhan ravi 2018년 10월 23일
It is really common because the syntax works if and only if the function correlates to it , the option I choose is to just change the extension to .xml and to try the reading option , see https://in.mathworks.com/matlabcentral/answers/284557-how-to-call-a-file-without-extension#comment_368357
  댓글 수: 5
madhan ravi
madhan ravi 2018년 10월 23일
no only you can create .xml with xmlwrite
Vamsinag Gunti
Vamsinag Gunti 2018년 10월 31일
Update: The path I was trying to read from was wrong. That is why xmlread and xmlwrite functions did not work.
xmlread and xmlwrite work with any file extension as long as the data inside is xml. This is just an observation I made.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Structured Data and XML Documents에 대해 자세히 알아보기

태그

제품


릴리스

R2017b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by