Skip to main content

XML Menu Document

The input for this application is an XML file containing a simple menu tree definition:

<?xml version="1.0" ?>
<menu>
<item caption="File">
    <item caption="Open" />
    <item caption="Save" />
    <item caption="Exit" />
</item>
<item caption="Edit">
    <item caption="Search...">
        <item caption="Find" />
        <item caption="Replace" />
    </item>
    <item caption="Copy" />
</item>
<item caption="Help">
    <item caption="Index" />
</item>
</menu>

A menu consists of a series of item elements. Each item element has a caption attribute, which is the caption of the menu item. item elements can, in turn, contain nested item elements. These represent submenus.

Copy this contents of this document to an new file (using notepad, or similar text editor) and save it as menu.xml in a known location.

FeedbackOpens in a new tab