Transforming Mathcad XMCD (XML) files

Mathcad is known for the ease with which math equations, text, and graphics can be combined in a single document. For authors and publishers, these documents form the basis of a typeset, formatted, mathematics-based content set. Mathcad's native XML format allows documents to be transformed into many useful target formats, such as HTML, PDF, and other XML-representable forms.

Mathcad XML settings for use in external applications

To transform Mathcad documents into other formats, you must set your XML storage settings appropriately:

  1. Choose Properties from the File menu and select the XML Options tab.
  2. Select the options you need. You can store Mathcad regions as images for use in PDF, HTML, Framemaker, or other XML layout and publishing formats. Choose the image format compatible with your end application. You may also store the text in your document as an image.
  3. Choose whether you will need your numeric results accessible in the target application. For example, if you are transforming to a spreadsheet format, you can retain results as full precision numeric entries in the XML, rather than as images.

Creating and applying a transform

XML's power lies in the ability to use a style sheet, or XSLT, to transform XML to other file formats. Several style sheet examples are available with Mathcad to convert XMCD worksheets into HTML using different processors. The style sheets are in the Transforms folder on your Mathcad CD. You can obtain more recent versions from the downloads section on mathcad.com. These sample transforms provide a starting place for you to learn about XML transformation. You should customize these files to suit your application.

To transform a Mathcad XML document to a new format, such as HTML, you need to apply transforms using a third-party application. Some freeware applications are suggested in the comments of the transforms provided with Mathcad. For example, NXSLT from OST, is a .NET command-line utility for applying transforms.

The difference between transforming native documents and saving them as HTML from within Mathcad is that the transform can include customized choices not available from the Save As HTML option, such as information about formatting, display of hidden regions, and additional elements you want to add.