Skip to main content

How do I create an XML output for a page?

An XML Output gives you a way to see the system-generated XML behind a page — invaluable when writing or debugging a Format.

  1. Create a new Template containing only <system-region name="DEFAULT"/>.
  2. Navigate to Manage Site > Configuration.
  3. Select your existing Configuration and edit it.
  4. Click Add new Output.
  5. For Name, enter "XML".
  6. For Template, browse to the Template from step 1.
  7. For File Extension, enter ".xml".
  8. For Type of Data, select "XML".
  9. Leave Publishable unchecked for now.
  10. Click Submit.

Now navigate to a page using that Configuration, click the Output drop-down, and select "XML" to see the generated XML.

If you see a "Root element not set" error

Bash
Could not convert JDOM document into string: Exception outputting Document: Root element not set

Change the Template content from:

HTML
<system-region name="DEFAULT"/>

to:

HTML
<xml>
    <system-region name="DEFAULT"/>
</xml>

This ensures the content within the DEFAULT region always has a root element.

Context-sensitive Index Blocks

The XML configuration's DEFAULT region is a useful place to plug in context-sensitive Index Blocks. An Index Block with Rendering Behavior set to "Start at the current page..." only generates XML once it's attached to a page region. To see its output for a given page:

  1. Click Edit on the page.
  2. Click the Configure pane.
  3. Click the XML Configuration.
  4. In the DEFAULT region, use the Block chooser to select the Index Block.
  5. Click Submit.

Return to the page view and select the XML output to see the XML the Index Block generates for that page.