|
|
| File Information |
| Description |
Read XML files into MATLAB struct and writes MATLAB data types to XML files, with help of simple interface to MATLAB's xmlwrite and xmlread functions.
Two function to simplify reading and writing XML files from MATLAB:
* Function xml_read first calls MATLAB's xmlread function and than converts its output ('Document Object Model' tree of Java objects) to tree of MATLAB struct's. The output is often in format of nested structs and cells. In the output data structure field names are based on XML tags.
* Function xml_write first convert input tree of MATLAB structs and cells and other types to tree of 'Document Object Model' nodes, and then writes resulting object to XML file using MATLAB's xmlwrite function.
This package can:
* Read any XML file, possibly created outside of MATLAB, and convert it to MATLAB data structures.
* Write any MATLAB's struct tree to XML file
* Handle XML attributes in the same way as xml_toolbox package
* Handle special node types like CDATA_SECTIONs, PROCESSING_INSTRUCTIONs and COMMENTs.
* Read and write XML files with base64 encoded binary objects
* Be studied, modified, customized, rewritten and used in other packages without any limitations. All code is included and documented. Software is distributed under MIT License (included).
This package can't:
* Guarantee to recover the same Matlab objects that were saved. If you need to be able to recover carbon copy of the structure that was saved than you will have to use one of the packages that uses special set of tags saved as xml attributes that help to guide the parsing of XML code. This package does not do that.
* Guarantee to work with MATLAB versions older than the package (2006/11). The code does not work with older versions of MATLAB. |
| MATLAB release |
MATLAB 7.6 (R2008a)
|
| Zip File Content |
|
| Published M Files |
Tutorial for xml_io_tools Package
|
| Other Files |
base64decode.m, base64encode.m, gen_object_display.m, html/xml_tutorial_script.png, html/xml_tutorial_script_01.png, license.txt, MIT_Licence.txt, test_file.xml, xml_read.m, xml_tutorial_script.m, xml_write.m, xmlwrite_xerces.m
|
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Updates |
| 24 Jan 2007 |
Made changes to allow handling special node types like CDATA_SECTIONs and COMMENTs. |
| 12 Mar 2007 |
Fix by Alberto Amaro of xml_write to allow writing CDATA sections. |
| 21 Jun 2007 |
Fixed problem reported by Anna Kelbert in Reviews. Also: added support for Processing Instructions, added support for global text nodes: Processing Instructons and Comments, allowed writing tag names with special characters |
| 20 Jul 2007 |
Added tutorial "Published M-file", few minor code changes adding more customization parameters |
| 23 Jan 2008 |
Fixed problem reported by Anna Krewet of converting dates in format '2007-01-01' to numbers. Improved and added warning messages. Added detection of old Matlab versions incompatible with the library. Expanded documentation. |
| 23 Jun 2008 |
Fixed problem with writing 1D arrays and 2D cell arrays. Extended Pref.Num2Str to: never, smart and always. Added parameter Pref.KeepNS for keeping or ignoring namespace data. |
| 11 Sep 2008 |
Resubmitting last upload |
| 25 Feb 2009 |
More error handling. More robust in case of large binary objects. Added support for Base64 encoding/decoding of binary objects (using functions by Peter J. Acklam). |
| 15 May 2009 |
Reupload of 25 Feb 2009 version. Something did not work. |
| 26 Jun 2009 |
changes to xml_read: added CellItem parameter to allow better control of reading files with 'item' notation (see comment by Shlomi); changed try-catch statements so xml_read would work for mablab versions prior to 7.5 (see Thomas Pilutti comment) |
|
MATLAB Central Terms of Use
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for
all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content.
Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available
via MATLAB Central.
Read the complete Terms prior to use.
Contact us at files@mathworks.com