Using RecipeBook XML With A GUI Editor

Rather than writing RecipeBook XML documents by hand using a text editor like notepad or vi, it is often conveinent to use an XML editor with a point-and-click graphical user interface (GUI). This tutorial covers the use of one such editor, XMLMind's XML Editor (XXE), to create RecipeBook XML documents.

Operating System Requirements

XXE is Java-based and will run on almost any platform that supports Sun Java version 1.4 or better. This means you can edit your RecipeBook XML recipes using Windows, Linux or Mac OS. If your computer does not have Java installed you will need to visit http://java.sun.com and download the J2SE Java Runtime Environment (JRE) for your operating system.

Downloading The Editor

The personal edition of XMLMind's XML editor is available as a free download and comes with a very liberal end-user license. You can find XXE on XMLMind's product page at: http://www.xmlmind.com/products.html. If you plan to convert your recipes to HTML, PDF or Rich Text you may also want to download XMLMind's FO Converter (XFC) at this time.

Installing XMLMind's XML Editor

Using the Windows setup binary is very easy and can be accomplished quickly by accepting the default directory locations. Other operating systems require using the tar+gzip archive which takes a few more steps.

To install using the tar+gzip archive.

  1. Decide on a suitable location to install. For example, /usr/local.
  2. Extract the archive to the chosen directory.
  3. Create an application launcher on your desktop that points to the xxe shell script.

Which ever method of installation you decide on, make sure that you are logged in as a user with sufficient privileges to accomplish the task.

Configuring XXE To Handle RecipeBook XML

The XML Editor needs the RecipeBook XML Document Type Definition (DTD) and style sheets and config files to properly edit recipes. All of this can be obtained from the RecipeBook XML web site.

Follow these steps to install.

  1. Download the RecipeBook XXE configuration package.
  2. Locate the directory of the XXE installation. For example /usr/local/xxe-std-29 or C:\Program Files\XMLmind_XML_Editor.
  3. Extract the RecipeBook XXE configuration package into the <xxe-root>/config/ directory where <xxe-root> refers to the directory located in the previous step.
  4. Verify that the <xxe-root>/config/recipebook/ directory exists and contains all of the files from the package.
  5. Launch XXE and select the menu item Options, Reload All Configurations.

You are now ready to use XXE to edit your RecipeBook XML recipes.

Creating A New RecipeBook XML Recipe

Creating a new recipe is easy once you get the hang of using the XXE. A short step-by-step example is given below.

  1. Select File, New from the XML Editor's menu.
  2. Choose RecipeBook Recipe or RecipeBook Cookbook as appropriate for your document.
  3. Select Style, Both Tree And Styled Views from the menu to give a better indication of the document's structure.
  4. Replace the words "Recipe Title" or "Cookbook Title" with the actual title of your document. Do the same to the blurb, author and any other elements you wish.
  5. Add new elements by selecting an existing element in the tree view and choosing Edit, Insert After from the menu. For example, to add an ingredient select an existing ingredient element and perform an Insert After. Then select "ingredient" from the element list on the far right.
  6. After filling in ingredients and preparation you may wish use inline markup for things like quantities, units, food items and equipment. Do this by highlighting the appropriate text and selecting Edit, Convert from the menu. Appropriate choices appear in the element list on the far right.
  7. Don't forget to save your work using File, Save from the menu.

Use the XXE help file and product documentation to learn more about how to use the XML Editor.

Viewing The Completed RecipeBook XML Recipe

There are two possibilities for viewing your completed recipe. One option is to view native RecipeBook XML in an XML capable browser like Mozilla Firefox or Internet Explorer. Simply place the recipebook.xsl style sheet in the same directory as the recipe and view the recipe the browser of choice. The other option is to convert the recipe to another format like HTML, PDF or Rich Text using the appropriate RecipeBook XSL style sheet with XMLMind's FO Converter.