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`
ExportXML
​
ExportXML
[xml]
converts a DocumentObject to symbolic XML.
​
Details and Options

Examples  
(2)
Basic Examples  
(1)
Parse an XML document with more parameters:
In[1]:=
moominsXml=Import["ExampleData/moomins.xml"];​​parsedRich=
ParseXML
@moominsXml;​​Dataset@parsedRich
Out[1]=
Children
Properties
Metadata
Options
Children
Properties
URN
Declaration
Doctype
Comment
Children
Properties
URN
Document
note
from
<<< Tove Jansson >>>
{}
—
http://www.w3.org/2000/xmlns/
xmlns
http://www.w3.org/moomins/
—
Version
1.0
note
"InternalSubset""\n<!ELEMENT note (from,h:heading,s:body)>\n<!ELEMENT from (#PCDATA)>\n<!ELEMENT h:heading (#PCDATA)>\n<!ELEMENT s:body (#PCDATA)>\n<!ATTLIST note xmlns CDATA #REQUIRED xmlns:a CDATA #REQUIRED xmlns:h CDATA #REQUIRED xmlns:s CDATA #REQUIRED>\n<!ATTLIST from profession CDATA 'Writer'>\n<!ATTLIST s:body a:language
CDATA 'English'>\n"
This document is a short note from Tove Jansson
Valid
True
heading
Moomins are important
{}
http://www.w3.org/moomins/heading
http://www.w3.org/2000/xmlns/
a
http://www.w3.org/moomins/attribute
Encoding
UTF-8
body
Mumin är viktiga för många barn över hela världen!
{http://www.w3.org/moomins/attribute,language}Swedish
http://www.w3.org/moomins/swedish/
http://www.w3.org/2000/xmlns/
h
http://www.w3.org/moomins/heading
4 total ›
Convert a parsed XML document back into symbolic XML:
In[2]:=
ExportXML
@parsedRich
Out[2]=
XMLObject[Document][{XMLObject[Declaration][Version1.0,EncodingUTF-8],XMLObject[Doctype][note,InternalSubset<!ELEMENT note (from,h:heading,s:body)><!ELEMENT from (#PCDATA)><!ELEMENT h:heading (#PCDATA)><!ELEMENT s:body (#PCDATA)><!ATTLIST note xmlns CDATA #REQUIRED xmlns:a CDATA #REQUIRED xmlns:h CDATA #REQUIRED xmlns:s CDATA #REQUIRED><!ATTLIST from profession CDATA 'Writer'><!ATTLIST s:body a:language CDATA 'English'>],XMLObject[Comment][This document is a short note from Tove Jansson]},XMLElement[note,{{http://www.w3.org/2000/xmlns/,xmlns}http://www.w3.org/moomins/,{http://www.w3.org/2000/xmlns/,a}http://www.w3.org/moomins/attribute,{http://www.w3.org/2000/xmlns/,h}http://www.w3.org/moomins/heading,{http://www.w3.org/2000/xmlns/,s}http://www.w3.org/moomins/swedish/},{XMLElement[from,{},{<<< Tove Jansson >>>}],XMLElement[{http://www.w3.org/moomins/heading,heading},{},{Moomins are important}],XMLElement[{http://www.w3.org/moomins/swedish/,body},{{http://www.w3.org/moomins/attribute,language}Swedish},{Mumin är viktiga för många barn över hela världen!}]}],{},ValidTrue]
As expected, the exported XML is exactly the same as the one used to generate the document:
In[3]:=
MatchQ​​
ExportXML
@
ParseXML
@moominsXml,​​moominsXml​​
Out[3]=
True
Possible Issues  
(1)

SeeAlso
ParseXML
""

© 2025 Wolfram. All rights reserved.

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