Exporting and importing template XML content
You can think of a document based on a template as containing data represented by name/value pairs. Each pair consists of the name of an editable region, and the contents of that region.
Dreamweaver lets you export the name/value pairs into an XML file so that you can work with the data outside of Dreamweaver (for example, in an XML editor or a text editor, or a database application). Conversely, if you have an XML document thats structured appropriately, you can import the data from it into a document based on a Dreamweaver template.
To export a documents editable regions as XML:
- Open a template-based document that contains editable regions.
- Select File > Export > Template Data as XML.
The Export Template Data as XML dialog box appears.
- Select one of the Notation options:
- If the template contains repeating regions or template parameters, select Use Standard Dreamweaver XML Tag.
- If the template does not contain repeating regions or template parameters, select Use Editable Region Names as XML Tags.
- Click OK.
A dialog box appears for you to save the XML file.
- Select a folder location, enter a name for the XML file, then click Save.
Dreamweaver generates an XML file that contains the material from the documents parameters and editable regions, including editable regions inside repeating regions or optional regions. The XML file includes the name of the original template, as well as the name and contents of each template region.
Content in the non-editable regions is not exported to the XML file.
To import XML content:
- Select File > Import > Import XML into Template.
The Import XML dialog box appears.
- Select the XML file, then click Open.
Dreamweaver creates a new document based on the template specified in the XML file. It fills in the contents of each editable region in that document using the data from the XML file. The resulting document appears in a new Document window.
If your XML file isnt set up exactly the way Dreamweaver expects, you might not be able to import your data. One solution to this problem is to export a dummy XML file from Dreamweaver, so that youll have an XML file with exactly the right structure. Then copy the data from your original XML file into the exported XML file. The result is an XML file with the correct structure that contains the appropriate data, all ready to be imported.
- Exporting a site without template markup