Manually Importing from XML


On the flip side of exporting XML data from templates, Dreamweaver has the capability to import XML data into a template to create a new template-derived document. For the import operation to work as intended, the XML must be in a specific format. Each XML tag corresponds to a template region or markup. Both XML syntax used during export ”the standard Dreamweaver <item> syntax and the editable region names as XML tags ” are supported for import, with the same restrictions. For complex templates, including any template markup other than just editable regions , the standard Dreamweaver syntax must be used.

Perhaps the best way to understand the format required for import is to examine an exported XML file. Here's a simple example:

graphics/04icon06.gif

The first thing to notice is the tag identifying the template from which the document was derived. Another important aspect is the order ”or rather the lack of order ”of the item entries. In the original file, the editable regions appeared in this sequence: doctitle , planetImage , diameter , orbital_period , and moons . In the exported data file, they are written in this order: diameter , moons , planetImage , doctitle , and orbital_period . This is one of the major advantages of an XML file over a less structured layout of information ”the order the data is written is irrelevant to the order of its final presentation.

Dreamweaver imports XML files written in both standard and editable region-based syntax. Either of the following two formats is supported:

 <templateItems template="/Templates/planet.dwt"  codeOutsideHTMLIsLocked="false">...</templateItems>  <planet template="/Templates/planet.dwt">...</planet> 

When the File, Import, XML into Template command is given and a properly formatted XML file is selected, the data and the template instance are merged and a new document is created immediately.



Joseph Lowery's Beyond Dreamweaver
Joseph Lowerys Beyond Dreamweaver
ISBN: B000H2MWYS
EAN: N/A
Year: 2001
Pages: 87
Authors: Joseph Lowery

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net