Digital humanities

Maintained by: David J. Birnbaum ( [Creative Commons BY-NC-SA 3.0 Unported License] Last modified: 2023-02-03T16:52:27+0000

Test #2: Relax NG

Preliminary instructions

The goal of this test is to create a well-formed Relax NG schema using a XML document that we will supply for you. Here’s how to get started:

  1. Open the XML document at (lilacs_lyrics.xml) in <oXygen/>. You can open it directly from the Internet by hitting Ctrl+u (Windows) or Cmd+u (Mac) in <oXygen/> and then copying and pasting the URL into the Open URL dialog box.

  2. The XML document for which you will be creating a schema is the song Lilacs from Dave Malloy’s musical Preludes. You can hear it performed on YouTube (it’s really a very lovely song, so we highly recommend checking it out!).

  3. Use File → Save As in the <oXygen/> menu to save the XML file locally to your computer.

  4. Create a new Relax NG compact syntax document and save it to your computer in the same directory as the XML, making sure that you follow our file-naming conventions, as you would for any assignment in this class.

  5. After you’ve saved both the XML song file and the new Relax NG file, click into the XML file and then use the Document → Schema → Associate Schema menu options to associate your XML with your Relax NG. The schema won’t be valid yet, which means that XML will also show a red square, but after you’re done with this next task, you will have two beautiful green squares.

Your task

Create a Relax NG schema that validates the XML file that we provide. This test is open book, but you can’t receive help from another person. Here are some more details:

If you get stuck, feel free to ask a question in the #relax-ng channel in our Slack. Don’t be shy about doing that; if you have a question, it’s likely that someone else will have the same question. We can’t write the schema rules for you, but there’s a lot we can and will do to point you in the right direction.