ParseFile - Maple Help

Home : Support : Online Help : Connectivity : Web Features : XMLTools : XMLTools/ParseFile

XMLTools

 ParseFile
 read an XML document from a file

 Calling Sequence ParseFile(fileName, opts)

Parameters

 fileName - string; name of file to read opts - equation(s) of the form option=value where option is one of validate, externaldtd, entities, prolog, or whitespace; specify parsing options

Description

 • The ParseFile(fileName) command reads XML data from the file fileName.
 The file is closed after it is read.
 • The opts argument can contain one or more equations that set parsing options.
 • The validate option determines whether a validating or a non-validating parser should be used. Possible values are true and false. By default validate is set to false.
 • The externaldtd option determines whether the parser will process any external document type definition (DTD) referenced in the file. Note this action typically requires network resources whose availability will therefore affect the parsing time. Possible values are true and false. By default externaldtd is set to true.
 • The entities option determines whether the parser should resolve entity references. Possible values are name and value. By default entities is set to name.
 • The prolog option determines whether prolog should be included in the document. Possible values are true and false. By default prolog is set to false.
 • The whitespace option indicates whether ignorable whitespace should be included in the document. Possible values are true and false. This option is effective only if validate is set to true. By default whitespace is set to true.

Examples

 > $\mathrm{with}\left(\mathrm{XMLTools}\right):$
 > $\mathrm{file}≔\mathrm{FileTools}:-\mathrm{JoinPath}\left(\left["help","XMLTools","SimpleDocument3.xml"\right],\mathrm{base}=\mathrm{datadir}\right)$
 > $\mathrm{ParseFile}\left(\mathrm{file}\right)$

Compatibility

 • The XMLTools[ParseFile] command was updated in Maple 18.
 • The externaldtd option was introduced in Maple 18.