Main Content

Convert XML Documents to Different File Formats

Why Convert XML Documents?

You can generate a report in a different output file format without regenerating it by using either the Report Explorer File Converter or the rptconvert command. These utilities convert DocBook XML source files created by the report-generation process into formatted documents such as HTML, RTF, or PDF.

Note

The report-generation process can only convert XML source files created by the latest version of the software.

Convert XML Documents Using the Report Explorer

To open the Convert Properties pane:

  1. In the Report Explorer, select Tools > Convert Source File.

    The Convert Source File Properties pane appears. All XML files in your current folder appear in the Options pane in the middle.

    Report Explorer with XML files displaying in the Options pane in the middle

  2. Select your XML source file using one of the following options:

    • Click Browse in the Properties pane on the right to browse to the location of your XML source.

    • Double-click a file name in the Options pane in the middle to automatically enter it into the Source file field in the Properties pane.

  3. Select your output format and style sheet:

    1. In the File format text box, select an output format.

    2. In the Style sheet text box, select a style sheet. The style sheet choice depends on the specified output format. You can use a predefined or customized style sheet.

      For more information about available formats and predefined style sheets, see Report Output Format.

      For more information about customizing style sheets, see Create a New Style Sheet.

  4. Use the View Report when done converting check box to indicate whether you want to view the report after it has conversion.

  5. To begin the conversion, click Convert file.

Convert XML Documents Using the Command Line

To convert files using the command line, use the rptconvert function.

Edit XML Source Files

Before you send a source file to the converter, edit it as text in the Report Explorer:

  1. In the Outline pane on the left, open the File Converter.

  2. Right-click MATLAB Report Generator and select Convert source file.

  3. In the Options pane in the middle, select the source file to edit.

  4. In the Properties pane on the right, click Edit as text.

  5. Use the MATLAB® Editor to edit and save the text.