此为 Mathematica 7 文档,内容基于更早版本的 Wolfram 语言
查看最新文档(版本11.1)

InitializeXMLParser

InitializeXMLParser[root, "file"]
creates an XMLParser object that has a list of entities corresponding to the contents of "file" and can be used on XML documents that have a root element root.
  • To use InitializeXMLParser, you first need to load the XML Package using Needs["XML`"].
  • InitializeXMLParser can be used to preload a DTD. If many documents with the same DTD are to be loaded repeatedly, a pre-initialized parser can speed up processing time.
Needs["XML`"]
Initialize a MathML parser (with a preloaded DTD):
In[2]:=
Click for copyable input
Out[2]=
The pre-initialized MathML parser is much faster than reloading the DTD:
In[3]:=
Click for copyable input
Out[3]=
In[4]:=
Click for copyable input
Out[4]=
For validation, a DOCTYPE declaration does not need to be present when using a pre-initialized parser:
In[5]:=
Click for copyable input
Out[5]=
ReleaseXMLParser frees up resources when the parser is done:
In[6]:=
Click for copyable input