Saving an XML Document [Word 2003 XML Reference] --  Microsoft Office Word 2003 XML Software Development Kit

Saving an XML Document [Word 2003 XML Reference]

Saving an XML document

  1. On the File menu, click Save As.

  2. In the Save as type box, click XML Document.

  3. In the File name box, type the document name.

  4. If you have attached a custom schema to apply custom XML tags and you want to discard formatting in Microsoft© Office Word 2003, saving only the custom data, select the Save data only check box.

  5. If you want to use an Extensible Stylesheet Language Transformation (XSLT) to format the document, select the Apply transform check box, and then click Transform to locate the XSLT file.

    Caution  If you apply an XSLT when you save the XML file, Word discards any data that is not included in the output of the transformation.

  6. Click Save.

    Note  The Save data only option and the Apply transform option are not mutually exclusive. If Save data only is checked and you apply a transform, then Word formatting stored in WordprocessingML is discarded and the transform affects any custom XML content in the document.

Figure 1. XML options in the File Save As dialog box.

Setting default save options for XML files

You can configure default options for saving Extensible Markup Language (XML) files. These default settings apply to the active document only. When you open another XML document, you must reconfigure these settings.

  1. On the Tools menu, click Templates and Add-Ins.

  2. On the XML Schema tab, click XML Options.

  3. Do one or both of the following:

    • To discard Word formatting and save only XML data, select the Save data only check box.

    • To use an Extensible Stylesheet Language Transformation (XSLT) file to format the document, select the Apply custom transform check box, and then click Browse to locate the XSLT file.

      Caution  If you apply an XSLT when you save the XML file, Word discards any data that is not included in the output of the transformation.

    Note  The Save data only option and the Apply transform option are not mutually exclusive. If Save data only is checked and you apply a transform, then Word formatting stored in WordprocessingML is discarded and the transform affects any custom XML content in the document.

More Information

For more information on the option settings used to configure the XML features in Word, see Understanding XML Options. For suggestions on troubleshooting problems that may occur while using these features, see Troubleshooting XML Documents in Word.

For additional information and examples that describe or demonstrate the end-to-end process of working with XML documents in Microsoft Office Word 2003, see the following articles:

Editing XML Data with Microsoft Office Word 2003 and Microsoft Office Excel 2003

Creating and Applying an XML Resume Template in Microsoft Office Word 2003

Microsoft Office Word 2003 XML: Memo Styles Sample

XML and Microsoft Office Word 2003: Writing a Trip Report

©2004 Microsoft Corporation. All rights reserved. Permission to copy, display and distribute this document is available at: http://msdn.microsoft.com/library/en-us/odcXMLRef/html/odcXMLRefLegalNotice.asp