MATLAB Answers

Undeclared Namespace Error when using xmlwrite

조회 수: 1(최근 30일)
Alex Buczynsky
Alex Buczynsky 2 Aug 2016
Hello,
I have been working on a function that can read and then change specific variables in XML documents.
The objective is:
  1. Import XML document using xmlread()
  2. Parse through and check for elements that contain specific parameter names
  3. Update the value corresponding to the parameter name
  4. Save the xmldocument over the original with xmlwrite()
Here is part of the XML document:
<FTS_params>
<FTS_System>
<Parameter name="name" value="FTS #Mission" type="char" ml:type="char"/> <!--FTS name-->
<Parameter name="collisionAvoidanceFcn" value="collAlgo_TTC" type="char" ml:type="char"/> <!--collision algo-->
<Parameter name="slamFcn" value="slamAlgo_real" type="char" ml:type="char"/> <!--slam algo-->
The imortant part of the xml doc is the namespace 'ml:type' seen above. This is where the error is occuring. The error dump from matlab is the following:
Error using xmlwrite (line 82)
Java exception occurred:
javax.xml.transform.TransformerException: org.xml.sax.SAXException:
Undeclared namespace in ml:type
at
com.icl.saxon.IdentityTransformer.transform(IdentityTransformer.java:92)
at com.mathworks.xml.XMLUtils.serializeXML(XMLUtils.java:175)
at com.mathworks.xml.XMLUtils.serializeXML(XMLUtils.java:44)
Caused by: org.xml.sax.SAXException: Undeclared namespace in ml:type
at com.icl.saxon.DOMDriver.walkNode(DOMDriver.java:290)
at com.icl.saxon.DOMDriver.walkNode(DOMDriver.java:306)
at com.icl.saxon.DOMDriver.walkNode(DOMDriver.java:306)
at com.icl.saxon.DOMDriver.parse(DOMDriver.java:177)
at com.icl.saxon.DOMDriver.parse(DOMDriver.java:146)
at
com.icl.saxon.IdentityTransformer.transform(IdentityTransformer.java:90)
... 2 more
---------
org.xml.sax.SAXException: Undeclared namespace in ml:type
at com.icl.saxon.DOMDriver.walkNode(DOMDriver.java:290)
at com.icl.saxon.DOMDriver.walkNode(DOMDriver.java:306)
at com.icl.saxon.DOMDriver.walkNode(DOMDriver.java:306)
at com.icl.saxon.DOMDriver.parse(DOMDriver.java:177)
at com.icl.saxon.DOMDriver.parse(DOMDriver.java:146)
at
com.icl.saxon.IdentityTransformer.transform(IdentityTransformer.java:90)
at com.mathworks.xml.XMLUtils.serializeXML(XMLUtils.java:175)
at com.mathworks.xml.XMLUtils.serializeXML(XMLUtils.java:44)
Any advice?

  댓글 수: 0

로그인 to comment.

답변 수 (0)

이 질문에 답변하려면 로그인을(를) 수행하십시오.

제품


Translated by