Worksheet

 parse a worksheet into an XML data structure

 Calling Sequence ReadFile( filename, format=output_format )

Parameters

 filename - string; name of a worksheet file format=output_format - (optional) equation; output_format can be either "maple8_xml" or "mw" (default)

Description

 • The ReadFile command parses a worksheet, returning an XML data structure that represents the worksheet. It requires a single argument filename that must be a Maple string and is assumed to name a worksheet file. The file is opened, and its contents read and parsed. The parsed worksheet is converted to an XML data structure that can be used with the XMLTools package. The XML document structure returned by this procedure is of type Worksheet:-worksheet.
 • You can save a worksheet in XML format by using the procedure WriteFile in the XMLTools package.
 Note: Maple worksheets (.mw) files are saved in an XML-based format. You can display the structure of a Maple worksheet in XML applications.

Examples

 > $\mathrm{with}\left(\mathrm{Worksheet}\right):$
 > $\mathrm{dir}≔\mathrm{kernelopts}\left(\mathrm{mapledir}\right):$
 > $\mathrm{mws}≔\mathrm{ReadFile}\left(\mathrm{cat}\left(\mathrm{dir},"/examplesclassic/obj.mws"\right)\right):$
 > $\mathrm{type}\left(\mathrm{mws},'\mathrm{Worksheet}:-\mathrm{worksheet}'\right)$
 ${\mathrm{true}}$ (1)
 > $\mathbf{use}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathrm{XMLTools}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{in}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathrm{ElementStatistics}\left(\mathrm{mws}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{end use}$
 $\left[{"Worksheet"}{=}{1}{,}{"View-Properties"}{=}{1}{,}{"Label-Scheme"}{=}{1}{,}{"Version"}{=}{1}{,}{"Task"}{=}{1}{,}{"Styles"}{=}{1}{,}{"Hyperlink"}{=}{5}{,}{"Section"}{=}{8}{,}{"Title"}{=}{10}{,}{"Layout"}{=}{33}{,}{"Input"}{=}{104}{,}{"Group"}{=}{104}{,}{"Font"}{=}{110}{,}{"Text-field"}{=}{146}\right]$ (2)