Wolfram Language Paclet Repository

Community-contributed installable additions to the Wolfram Language

Primary Navigation

    • Cloud & Deployment
    • Core Language & Structure
    • Data Manipulation & Analysis
    • Engineering Data & Computation
    • External Interfaces & Connections
    • Financial Data & Computation
    • Geographic Data & Computation
    • Geometry
    • Graphs & Networks
    • Higher Mathematical Computation
    • Images
    • Knowledge Representation & Natural Language
    • Machine Learning
    • Notebook Documents & Presentation
    • Scientific and Medical Data & Computation
    • Social, Cultural & Linguistic Data
    • Strings & Text
    • Symbolic & Numeric Computation
    • System Operation & Setup
    • Time-Related Computation
    • User Interface Construction
    • Visualization & Graphics
    • Random Paclet
    • Alphabetical List
  • Using Paclets
    • Get Started
    • Download Definition Notebook
  • Learn More about Wolfram Language

XMLParse

Symbols

  • ExportXML
  • ParseXML
TonyAristeidou`XMLParse`
ParseXML
​
ParseXML
[xml]
converts an XML to a DocumentObject.
​
​
ParseXML
[xml,elements]
converts XML to a DocumentObject containing only the specified component
elements
.
​
Details and Options

Examples  
(1)
Basic Examples  
(1)
Parse an example XML:
In[1]:=
paintinsXml=Import["ExampleData/paintings.xml"];​​parsed=
ParseXML
[paintinsXml];​​parsed〚​​"Document","Children",​​"PAINTINGS","Children",​​"SALE",​​All,"Children",​​All,"Children"​​〛//Dataset
Out[1]=
TITLE
ARTIST
YEAR
PRICE
No.5, 1948
Jackson Pollock
1948
$140,000,000
Woman III
Willem de Kooning
1953
$137,500,000
Portrait of Adele Block-Bauer I
Gustav Klimt
1907
$135,000,000
Portrait of Dr. Gachet
Vincent van Gogh
1890
$82,500,000
Bal au moulin de la Galette, Montmartre
Pierre-Auguste Renoir
1876
$78,100,000
A specification of a single element to include can be provided as the second argument:
In[2]:=
parsed=
ParseXML
[paintinsXml,"Children"];​​parsed〚"Document","PAINTINGS","SALE"〛//Dataset
Out[2]=
TITLE
ARTIST
YEAR
PRICE
No.5, 1948
Jackson Pollock
1948
$140,000,000
Woman III
Willem de Kooning
1953
$137,500,000
Portrait of Adele Block-Bauer I
Gustav Klimt
1907
$135,000,000
Portrait of Dr. Gachet
Vincent van Gogh
1890
$82,500,000
Bal au moulin de la Galette, Montmartre
Pierre-Auguste Renoir
1876
$78,100,000
A list specification preserves the full document structure:
In[3]:=
parsed=
ParseXML
[paintinsXml,{"Children"}];​​parsed〚​​"Document","Children",​​"PAINTINGS","Children",​​"SALE",All,"Children"​​〛//Dataset
Out[3]=
TITLE
ARTIST
YEAR
PRICE
Children
Children
Children
Children
No.5, 1948
Jackson Pollock
1948
$140,000,000
Woman III
Willem de Kooning
1953
$137,500,000
Portrait of Adele Block-Bauer I
Gustav Klimt
1907
$135,000,000
Portrait of Dr. Gachet
Vincent van Gogh
1890
$82,500,000
Bal au moulin de la Galette, Montmartre
Pierre-Auguste Renoir
1876
$78,100,000
A specification of multiple elements to include can be provided as the second argument:
In[4]:=
parsed=
ParseXML
[paintinsXml,{"Children","URN"}];​​parsed〚"Document","Children","PAINTINGS","Children"〛//Dataset
Out[4]=
Children
URN
TITLE
ARTIST
YEAR
PRICE
Children
URN
Children
URN
Children
URN
Children
URN
SALE
No.5, 1948
—
Jackson Pollock
—
1948
—
$140,000,000
—
—
Woman III
—
Willem de Kooning
—
1953
—
$137,500,000
—
—
Portrait of Adele Block-Bauer I
—
Gustav Klimt
—
1907
—
$135,000,000
—
—
Portrait of Dr. Gachet
—
Vincent van Gogh
—
1890
—
$82,500,000
—
—
Bal au moulin de la Galette, Montmartre
—
Pierre-Auguste Renoir
—
1876
—
$78,100,000
—
—
SeeAlso
ExportXML
""

© 2025 Wolfram. All rights reserved.

  • Legal & Privacy Policy
  • Contact Us
  • WolframAlpha.com
  • WolframCloud.com