Microscopy Image Browser 2.91
MIB
Loading...
Searching...
No Matches
xml2struct.m File Reference

Convert xml file into a MATLAB structure [ s ] = xml2struct( file ) More...

Functions

function s = xml2struct (file)
 Convert xml file into a MATLAB structure [ s ] = xml2struct( file )
 
function [ children , ptext , textflag ] = xml2struct>parseChildNodes (theNode)
 
function [ text , name , attr , childs , textflag ] = xml2struct>getNodeData (theNode)
 
function attributes = xml2struct>parseAttributes (theNode)
 

Detailed Description

Convert xml file into a MATLAB structure [ s ] = xml2struct( file )

Function Documentation

◆ xml2struct>getNodeData()

function [ text , name , attr , childs , textflag ] = xml2struct>getNodeData ( theNode)

◆ xml2struct>parseAttributes()

function attributes = xml2struct>parseAttributes ( theNode)

◆ xml2struct>parseChildNodes()

function [ children , ptext , textflag ] = xml2struct>parseChildNodes ( theNode)

◆ xml2struct()

function s = xml2struct ( file)

Convert xml file into a MATLAB structure [ s ] = xml2struct( file )

A file containing
<XMLname attrib1="Some value"> <Element>Some text</Element> <DifferentElement attrib2="2">Some more text</Element> <DifferentElement attrib3="2" attrib4="1">Even more text</DifferentElement> </XMLname>
Will produce
s.XMLname.Attributes.attrib1 = "Some value"; s.XMLname.Element.Text = "Some text"; s.XMLname.DifferentElement{1}.Attributes.attrib2 = "2"; s.XMLname.DifferentElement{1}.Text = "Some more text"; s.XMLname.DifferentElement{2}.Attributes.attrib3 = "2"; s.XMLname.DifferentElement{2}.Attributes.attrib4 = "1"; s.XMLname.DifferentElement{2}.Text = "Even more text";

Please note that the following characters are substituted - by dash, : by colon and . by dot

Written by W. Falkena, ASTI, TUDelft, 21-08-2010 Attribute parsing speed increased by 40% by A. Wanner, 14-6-2011 Added CDATA support by I. Smirnov, 20-3-2012

Modified by X. Mo, University of Wisconsin, 12-5-2012

References xml2struct().

Referenced by getXMLheader(), mibGetImageMetadata(), readBigDataViewerFormat(), and xml2struct().

Here is the call graph for this function:
Here is the caller graph for this function: