I want to modify xml text information of an svg file in MATLAB. I renamed the svg file to xml file
system('rename *myfile.svg* *myfile.xml')
got the XML text info:
fid = fopen(‘myfile.xml');
XMLdata = fscanf(fid1, '%s');
XMLdata is a char array containing XML text info Now I can modify the XMLdata using strcmp for eg:
new_claim = strrep(XMLdata, 'Sans', 'Times New Roman')
Now I could not write this XMLdata to an xml file using xmlwrite
xmlwrite('fileout.xml', XMLdata)
I am getting error
Error using javaMethod Java exception occurred: javax.xml.transform.TransformerException: java.net.MalformedURLException: no protocol: image/svg+xml200m
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: java.net.MalformedURLException: no protocol: image/svg+xml200m
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at com.icl.saxon.IdentityTransformer.transform(IdentityTransformer.java:90)
... 2 more
java.net.MalformedURLException: no protocol: image/svg+xml200m
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
at java.net.URL.<init>(Unknown Source)
at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
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)
Error in xmlwrite (line 83) javaMethod('serializeXML',...
No comments:
Post a Comment