Articles and categories


Download and unzip the above file Then:

  1. Import the resulting Exam Project into your IDEA IDE by choosing »File --> Open...« subsequently selecting the Exam/pom.xml file.

  2. Also import the Exam folder into your Oxygenxml IDE using »Project« --> »Open Project« subsequently selecting the Exam/sda1.xpr file.


Consider a catalog of categories and articles:

<catalog xmlns:xsi=""
  xsi:noNamespaceSchemaLocation="catalog.xsd" >
    <category id="food">Food and drinking</category>
    <category id="hardware">Tools, DIY</category>
    <category id="lifestyle">Lifestyle products</category>    
    <article orderNo="232434">
      <name>Super 3D Tin Lunch Box </name>      
      <img src="232434_1" type="png"/>
    <article orderNo="544343">
      <name>Monthly beer subscription box</name>
      <description>Various brands and flavours on offer.</description>      

The following data integrity rules shall apply:

  1. Each <category> has got an id value being unique with respect to all categories.

  2. Each <article> carries a positive integer orderNo attribute being unique with respect to all articles.

  3. Each <article> is being related to at least one <category> by means of <cat> references. In the given sample the «Monthly beer subscription box» relates to the «Food and drinking» category.

  4. An <article> may have one <description> and one <img> element in that order.

  5. The attributes src and type of <img> are mandatory. The attribute type is being restricted to the set {gif, png, svg}.


Complete your schema's implementation in Schema/catalog.xsd using the Oxygenxml IDE. Hints:

  1. The folder SchemaTest contains sample files testing your schema's correctness.

  2. Junit execution of de.hdm_stuttgart.mi.sda1.test.ex1.SchemaTest from within IntelliJ executes all unit tests based on files residing in your project's folder SchemaTest. Some of these files, e.g. SchemaTest/0101_missingArticles.xml, contain comment hints regarding expected errors with respect to the intended Schema/catalog.xsd.

     ... <!-- Expected error: <articles > absent -->...

    Clicking on file names within test failure reports will open e.g. SchemaTest/0101_missingArticles.xml in IDEA. However opening the same file in Oxygenxml will likely save time anyway due to better XML support.

  3. Never touch your project's unit tests in the SchemaTest folder: The automated tests may end up throwing meaningless exceptions.

  4. Edit Schema/catalog.xsd only by small steps executing the tests immediately. Schema changes may cause already working tests to fail again. In case of spoiling your schema undo is your friend.


  • XPath uses the dot (.) for selecting an element's content e.g. "food" from <cat>food</cat> .

  • Choose appropriate XSD standard types rather than defining own types by restriction.

Project upload

Export your project by hitting »File« --> »Export to Zip File« in IDEA creating an e.g. file. Then enter your ILIAS browser, hit the choose file button selecting and subsequently click upload. Do not forget to advance to the next question for actually saving your upload. Common pitfalls:

  • Do not select the wrong archive! In particular avoid choosing the original skeleton.

  • After uploading check for being visible in the examination system.

  • You may upload multiple versions i.e. etc. . Only your least uploaded archive will become subject to marking.

  • When approaching examination ending time check your input for completeness.

  • Projects residing just on your local workstation cannot be recovered after exam termination.