decorative banner

Working with XML elements that are repeated


    GoLive supports multiple records within an XML source implicitly at the top level of the XML structure. It also provides support for repeated element processing when the repeated elements are nested within the XML. Consider the following XML structure:

    <addresses>

        <entry>

            <name>Russell</name>

            <address_list>

                <address type="usa">

                    <number>1435</number>

                    <street>Oregon Ave</street>

                    <city>Washington</city>

                </address>

                <address>

                    <number>2434</number>

                    <street>Main Street</street>

                    <city>San Jose</city>

                </address>

            </address_list>

        </entry>

        <entry>

            ...   

        </entry>

    </addresses>

    To create a table that lists entries and contains a nested table listing addresses for each entry, proceed as follows. Create an XML data source based on this XML. For the element <address_list>, set the XML Binding Option to Treat As Rowset. On the page that will contain the table, create an XML content source based on this XML data source. A second content source will automatically be created that returns fields of the <address> elements contained inside the <address_list> element. You can then place a table on the page with the Replace Rows option set with the main XML content source. Nested within it, place a second table with the Replace Rows option set with the nested XML content source.