|
SOLUTIONS
|
XML 程序包 符号
XMLGetString
![]()
returns the XML expression tree corresponding to a string.
![]()
uses the pre-initialized XMLParser object to parse the string.
更多信息更多信息
- To use
, you first need to load the XML Package using Needs["XML`"]. - This function is similar to ImportString["data", "XML"]. However, it can take a pre-initialized XML parser.
- The following options can be given:
-
"NormalizeWhitespace" True whether to remove leading, trailing, and multiple internal whitespace in elements "IncludeNamespaces" Automatic whether to explicitly include namespaces "ValidateAgainstDTD" Automatic whether to validate the XML against the DTD content model "IncludeEmbeddedObjects" None whether to retain comments and processing instructions "AllowRemoteDTDAccess" True whether to seek DTDs on the network "ReadDTD" True whether to read the DTD "IncludeDefaultedAttributes" False whether to explicitly include default attributes as defined in the DTD "AllowUnrecognizedEntities" Automatic whether entities undefined by the DTD are considered errors "PreserveCDATASections" False whether the distinction between CDATA sections and regular character data is maintained on import
范例范例打开所有单元关闭所有单元
基本范例 (2)基本范例 (2)
| In[1]:= |
imports a string as SymbolicXML:
| In[2]:= |
| Out[2]= |
| In[1]:= |
To use
with a pre-initialized parser, pre-initialize the parser according to a DTD at the remote URL and name that pre-initialized parser
:
| In[2]:= |
| Out[2]= |
Use the pre-initialized parser to validate the string on import. "Valid"->True indicates the string was validated successfully:
| In[3]:= |
| Out[3]= | ![]() |
Mathematica 9 is now available!
New to Mathematica?
Find your learning path »
Have a question?
Ask support »

