XML File Format

Mathcad worksheets are saved in XML or compressed XML format. This file format has advantages in accessibility, searchability, and information storage. Because the format is text-based (unless compressed), it can be opened, searched, and edited with any text editor. All metadata, either document-level or region level, can be viewed, searched, and queried in any XML compliant or text-based tool.

To save a worksheet in XML format,

  1. Set XML Options.

  2. Choose Save As from the File menu.

  3. In the "Save as type" drop-down list, choose the default "Mathcad XML Document (*.XMCD)" or "Mathcad Compressed XML Document (*.XMCDZ)" and provide a file name.

  4. Click "Save."

You can choose XMCD or XMCDZ format as your default file format on the Save tab of the Preferences dialog.

Saving Results

Mathcad's XML format saves evaluated results, those displayed after an equals sign. When a worksheet is saved as .XMCD or .XMCDZ, all regions in the worksheet are calculated, and the results stored between <ml:result> tags.

However, the default is "Don't store large evaluated results." This to reduce the size of the files. If you want to save all results, then remove the check from "Don't store large evaluated results" option in the XML settings in the XML tab in the Properties dialog under the File menu

If you interrupt Mathcad calculations, not all results are saved and other unpredictable behavior may occur. When you reopen the worksheet in Mathcad, it reverts to an uncalculated state, and any calculations are performed as usual when they appear on screen. Saved results are useful for accessing the final value of long calculations outside of Mathcad without rerunning the worksheet.

The XMCDZ compressed format is a GZIP (RFC1952) format that compresses the entire file, not just particular regions. The files can be decompressed by a number of utilities, including WinZip and Gzip. Once decompressed, these files have the XMCD extension. Mathcad automatically unzips compressed files on file open.