XMLGet


returns the XML expression tree corresponding to the contents of .


uses the pre-initialized XMLParser object to parse the file.


reads from a URL.

更多信息更多信息

  • To use , you first need to load the XML Package using Needs["XML`"].
  • This is similar to Import[file, "XML"]. However, it can take a pre-initialized XML parser.
  • The following options can be given:
  • "NormalizeWhitespace"Truewhether to remove leading, trailing, and multiple internal whitespace in elements
    "IncludeNamespaces"Automaticwhether to explicitly include namespaces
    "ValidateAgainstDTD"Automaticwhether to validate the XML against the DTD content model
    "IncludeEmbeddedObjects"Nonewhether to retain comments and processing instructions
    "AllowRemoteDTDAccess"Truewhether to seek DTDs on the network
    "ReadDTD"Truewhether to read the DTD
    "IncludeDefaultedAttributes"Falsewhether to explicitly include default attributes as defined in the DTD
    "AllowUnrecognizedEntities"Automaticwhether entities undefined by the DTD are considered errors
    "PreserveCDATASections"Falsewhether the distinction between CDATA sections and regular character data is maintained on import

范例范例打开所有单元关闭所有单元

基本范例 (2)基本范例 (2)

In[1]:=
Click for copyable input

Create a file:

In[2]:=
Click for copyable input
Out[2]=

returns the contents of the file as an XML expression:

In[4]:=
Click for copyable input
Out[4]=
In[1]:=
Click for copyable input

Retrieve data via HTTP. This retrieves stock quotes and returns the data as SymbolicXML:

In[2]:=
Click for copyable input
Out[2]=
New to Mathematica? Find your learning path »
Have a question? Ask support »