Understanding XML data sourcesAn XML data source object describes the structure and tags of a kind of XML file. For each of these tags, it tells GoLive how to find and process the information in the XML file so that it can be extracted and made available to Web pages in the site. When you create an XML data source object, you tell GoLive about each of the tags in the XML file and how to process them. The tag structure and the names of the tags themselves are obtained by scanning a sample XML file that serves as a general example for all XML files that will use the same format. Thus, the data source identifies a class of XML files. Each XML file that follows the format can be processed using the same XML data source object. The details of creating an XML data source object are described in Creating an XML data source. XML elements are syntactic components that begin with a <tag_name>, have some content after that, and end with a </tag_name>. tag_name is the name of the element and identifies its kind. The content between the begin and end tags may contain text and other XML elements. We refer to everything between the start and end tags as the body of the element and elements nested inside as children of the element. In addition, elements can have attributes that appear in XML as <tag_name attr_name= "value">. There can be zero or more attributes on an element. For simplicity, GoLive XML data sources treat attributes similar to nested elements. You can access their values in the same way you access nested element values. In addition, GoLive XML data sources define, for every element that has children, a special additional child element called [body]. This special element represents the full value of the body of the element. It includes all children, their enclosing tags, and any text that appears between child elements. In short, [body] represents everything between the begin and end tags of the element. For each XML element tag, attribute, and special [body] element, you can specify one of the available binding options. For each of the element tags, you can specify Bindable or Not Bindable. Bind Children Only and Treat As Rowset apply only to element tags, not attributes or [body]. Bindable The XML element with this tag is available to be bound to page elements. The value returned will be everything enclosed in the tag returned as a string. This will generally include everything in the tag including whitespace, comments, and processing directives, but this can vary with XML implementation (which is part of the server, not part of GoLive). Not bindable The XML element with this tag is not made available for binding. This is done mainly to reduce the size of the list of possible tags that the Web page author has to select from. Some XML tag definitions include hundreds of tags of which only a few may be relevant to a given Web site. Bind children only The XML element itself is not bindable, but nested elements that appear in the element are made visible. You then need to mark them with one of the XML binding options. Text that appears between elements are not bindable in this case (use the special [body] element to access the full text of an element with children). This choice is available only if the element has children present in the sample XML file. You can bind the whole tag by making its [body] child bindable. Treat as rowset Treat the element value as a series of records. This creates a nested content source that will return each of the child elements, one at a time. If you have a content source based on a data source containing a Treat As Rowset element, an additional nested content source will be automatically defined. This choice is available only if the element has children present in the sample XML file. |