xml2table

xml2table(X,type) returns contents of X in table format
  • type=true if X is an XML file, by default
  • type=false if X is a string

Examples

> string = '<Best-selling>
<Book id="001">
  <Author>Charles Dickens</Author>
  <Title>A Tale Of Two Cities</Title>
  <First_published>1859</First_published>
</Book>
<Book id="002">
  <Author>J. R. R. Tolkien</Author>
  <Title>The Lord of the Rings</Title>
  <First_published>1954</First_published>
</Book>
</Best-selling>'

> example1 = xml2table(string,false)#

       example1 =
       id     Author	          Title	                 First_published
       001    Charles Dickens	  A Tale Of Two Cities	 1859
       002    J. R. R. Tolkien    The Lord of the Rings	 1954

> example2 = xml2table('xmlexample.xml')#

       example2 =
       id     user                  email
       1    admin    admin@mathlayer.com
       2  contact  contact@mathlayer.com

Resources

See also

fopen | table | urlread