| Contents | Index |
xmlwrite(filename,DOMnode)
str = xmlwrite(DOMnode)
xmlwrite(filename,DOMnode) writes the Document Object Model (DOM) node DOMnode to the file filename.
str = xmlwrite(DOMnode) serializes the DOM node to a string.
filename |
String enclosed in single quotation marks that specifies the name of a local file or a URL. |
DOMnode |
Document Object Model node, as defined by the World Wide Web consortium. For more information, see What Is an XML Document Object Model (DOM)? |
str |
String that contains the serialized DOM node as it appears in an XML file. |
Create and view an XML document:
docNode = com.mathworks.xml.XMLUtils.createDocument...
('root_element')
docRootNode = docNode.getDocumentElement;
docRootNode.setAttribute('attr_name','attr_value');
for i=1:20
thisElement = docNode.createElement('child_node');
thisElement.appendChild...
(docNode.createTextNode(sprintf('%i',i)));
docRootNode.appendChild(thisElement);
end
docNode.appendChild(docNode.createComment('this is a comment'));
xmlFileName = [tempname,'.xml'];
xmlwrite(xmlFileName,docNode);
type(xmlFileName);| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |