decorative banner

Creating an XML data source


    You can create an XML data source using a sample XML file.

To create an XML data source:

    Note: You need to have your site set up as a dynamic site. (See Making a Web site dynamic.)

  1. With the site window active, select the Site > Settings > Dynamic Content pane.
  2. In the Data Sources area, click New.
  3. Select XML Data Source, and click Add Data Source.
  4. In the XML Data Source editor, fill in the fields as follows:
    • Data Source Name: Choose a name for this data source. A name representative of the kind of information in the XML files is usually a good choice. This must be a legal filename on the Web server and the machine where GoLive is running.
    • Sample XML URL: Enter the full URL (starting with http://) to a sample XML file representative of the tag structure that all actual XML files will share. This file is used in lieu of a schema; hence, it must be a complete example of the union of tags that will be seen and the structure in which they will be seen. As an alternative to a full URL, you can use a Web server file system filename. This is how the value will be interpreted if it doesn't start with http://.
    • Transform XML and XSLT URL: If the XML is to be processed by an XSLT transform, check the Transform XML box and enter the full URL to the XSLT script. The XML from the content source will be run through the transform before it is used as information to be bound to elements on the Web page. If not, skip to the next step. The XML will be used as it appears in the XML source file specified in the content source.
  5. If the XML is structured as a single record, select the Treat Source As Single Record option. Then all but the top-level tag will appear in a single hierarchy. If the XML is structured as multiple records at the top level of the file, leave the option unselected. GoLive processing of the XML will assume that each element immediately within the top level element is a separate record, and processes the elements one at a time.
  6. Click the Load XML Sample button. This loads and analyzes the XML sample file and displays the resulting structure in a window.
  7. Go through the tags, as displayed in the window, and select for each whether it is to be available for binding or not, and whether its children are to be available for binding or not, and whether it should be treated as a rowset.
  8. To specify this, click on the icon that appears to the left of the field name. This opens a pop-up menu from which you can choose how the element should be treated. If you select Bind Children Only, then the display will be modified to include the children of this element. (See Understanding XML data sources for more information on the meaning of the XML binding options.)

  9. Click OK to create the XML data source.
  10. Press the Test button to test the processing of the XML sample file. If successful, a window displays the parsed contents of the XML sample file. The Test button in a content source will test an actual XML source. The Test button applied to the data source checks only the sample file.