Newer
Older
ade-outils-xml / dtd / Wileyml3gv20-rng / Wileyml3g-cookery.rng
@niederle niederle on 29 Dec 2015 9 KB 1er commit
<?xml version="1.0" encoding="UTF-8"?>
<!--
  =============================================================================================
  WileyML 3G
  
  A model for the content of John Wiley &amp; Sons. 
  
  This file conforms to ISO/IEC 19757-2:2003 AMENDMENT 1 (RELAX NG Compact Syntax). The
  collection of these files normatively defines the XML grammar for WileyNG instances.
  
  Copyright (c) 2011 John Wiley & Sons Inc. All rights reserved worldwide.
  
  $Id: Wileyml3g-cookery.rnc,v 1.8 2011/07/24 16:16:38 johnp Exp $
  =============================================================================================
-->
<grammar xmlns:wng="http://www.wiley.com/namespaces/wiley" xmlns:aux="http://www.wiley.com/namespaces/wiley/aux" xmlns="http://relaxng.org/ns/structure/1.0">
  <!--
    Changes for v2.0 (Aug 2011):
      1. <recipeProcedure>, <recipeIngredientsList>, <recipeTools>, 
             <recipeIntro>: add initial optional (title | titleGroup)
      2. <recipe>: added optional (mediaResource | mediaResourceGroup+)
  -->
  <!--
    Changes for v1.0.3 (Aug 2010):
      1. <recipe>: added new element recipeVariations in place of recipeVariation
  -->
  <!--
    =============================================================================================
    recipe
    =============================================================================================
  -->
  <define name="wng.recipe.attlist">
    <interleave>
      <ref name="pattern.global.attributes"/>
      <ref name="pattern.id.attribute"/>
      <optional>
        <attribute name="category">
          <aux:desc>a category for the recipe</aux:desc>
        </attribute>
      </optional>
      <optional>
        <attribute name="difficulty">
          <aux:desc>the difficulty of the recipe</aux:desc>
        </attribute>
      </optional>
      <attribute name="source">
        <aux:desc>the origin of the recipe</aux:desc>
      </attribute>
    </interleave>
  </define>
  <define name="wng.recipe">
    <element name="wng:recipe">
      <aux:desc aux:cat="cook">A (culinary) recipe.</aux:desc>
      <ref name="wng.recipe.attlist"/>
      <optional>
        <ref name="pattern.model.fragment.titling"/>
      </optional>
      <oneOrMore>
        <choice>
          <ref name="wng.recipeYield"/>
          <ref name="wng.recipeTime"/>
          <ref name="wng.recipeTools"/>
          <ref name="wng.recipeIntro"/>
          <ref name="wng.recipeIngredientsList"/>
          <ref name="wng.recipeProcedure"/>
          <ref name="wng.recipeVariations"/>
          <ref name="wng.recipeNutritionInfo"/>
          <ref name="wng.p"/>
          <ref name="wng.feature"/>
          <ref name="wng.recipe"/>
        </choice>
      </oneOrMore>
      <optional>
        <choice>
          <ref name="wng.mediaResource"/>
          <oneOrMore>
            <ref name="wng.mediaResourceGroup"/>
          </oneOrMore>
        </choice>
      </optional>
    </element>
  </define>
  <!--
    =============================================================================================
    recipeYield
    =============================================================================================
  -->
  <define name="wng.recipeYield.attlist">
    <ref name="pattern.global.attributes"/>
  </define>
  <define name="wng.recipeYield">
    <element name="wng:recipeYield">
      <aux:desc aux:cat="cook">A (culinary) recipe's yield, i.e., the number of servings or amount that the recipe makes.</aux:desc>
      <ref name="wng.recipeYield.attlist"/>
      <zeroOrMore>
        <choice>
          <text/>
          <ref name="pattern.formatting.nomath"/>
        </choice>
      </zeroOrMore>
    </element>
  </define>
  <!--
    =============================================================================================
    recipeTime
    =============================================================================================
  -->
  <define name="wng.recipeTime.attlist">
    <interleave>
      <ref name="pattern.global.attributes"/>
      <optional>
        <ref name="pattern.type.attribute"/>
      </optional>
    </interleave>
  </define>
  <define name="wng.recipeTime">
    <element name="wng:recipeTime">
      <aux:desc aux:cat="cook">The time required to make all, or a part of, a recipe.</aux:desc>
      <ref name="wng.recipeTime.attlist"/>
      <zeroOrMore>
        <choice>
          <text/>
          <ref name="pattern.formatting.nomath"/>
        </choice>
      </zeroOrMore>
    </element>
  </define>
  <!--
    =============================================================================================
    recipeIntro
    =============================================================================================
  -->
  <define name="wng.recipeIntro.attlist">
    <ref name="pattern.global.attributes"/>
  </define>
  <define name="wng.recipeIntro">
    <element name="wng:recipeIntro">
      <aux:desc aux:cat="cook">A (culinary) recipe's introduction.</aux:desc>
      <ref name="wng.recipeIntro.attlist"/>
      <optional>
        <ref name="pattern.model.fragment.titling"/>
      </optional>
      <oneOrMore>
        <ref name="wng.p"/>
      </oneOrMore>
    </element>
  </define>
  <!--
    =============================================================================================
    recipeIngredientsList
    =============================================================================================
  -->
  <define name="wng.recipeIngredientsList.attlist">
    <ref name="pattern.global.attributes"/>
  </define>
  <define name="wng.recipeIngredientsList">
    <element name="wng:recipeIngredientsList">
      <aux:desc aux:cat="cook">A list of ingredients for a <xref xmlns="" linkend="wng_recipe"/>
+++.</aux:desc>
      <ref name="wng.recipeIngredientsList.attlist"/>
      <optional>
        <ref name="pattern.model.fragment.titling"/>
      </optional>
      <oneOrMore>
        <choice>
          <ref name="wng.list"/>
          <ref name="wng.tabularFixed"/>
        </choice>
      </oneOrMore>
    </element>
  </define>
  <!--
    =============================================================================================
    recipeNutritionInfo
    =============================================================================================
  -->
  <define name="wng.recipeNutritionInfo.attlist">
    <ref name="pattern.global.attributes"/>
  </define>
  <define name="wng.recipeNutritionInfo">
    <element name="wng:recipeNutritionInfo">
      <aux:desc aux:cat="cook">A (culinary) recipe's nutrition information, such as calories and diet exchanges.</aux:desc>
      <ref name="wng.recipeNutritionInfo.attlist"/>
      <optional>
        <ref name="pattern.model.fragment.titling"/>
      </optional>
      <oneOrMore>
        <ref name="wng.p"/>
      </oneOrMore>
    </element>
  </define>
  <!--
    =============================================================================================
    recipeProcedure
    =============================================================================================
  -->
  <define name="wng.recipeProcedure.attlist">
    <ref name="pattern.global.attributes"/>
  </define>
  <define name="wng.recipeProcedure">
    <element name="wng:recipeProcedure">
      <aux:desc aux:cat="cook">The procedure part of a (culinary) recipe.</aux:desc>
      <ref name="wng.recipeProcedure.attlist"/>
      <optional>
        <ref name="pattern.model.fragment.titling"/>
      </optional>
      <oneOrMore>
        <choice>
          <ref name="wng.list"/>
          <ref name="wng.tabularFixed"/>
        </choice>
      </oneOrMore>
    </element>
  </define>
  <!--
    =============================================================================================
    recipeTools
    =============================================================================================
  -->
  <define name="wng.recipeTools.attlist">
    <ref name="pattern.global.attributes"/>
  </define>
  <define name="wng.recipeTools">
    <element name="wng:recipeTools">
      <aux:desc aux:cat="cook">A (culinary) recipe's tools.</aux:desc>
      <ref name="wng.recipeTools.attlist"/>
      <optional>
        <ref name="pattern.model.fragment.titling"/>
      </optional>
      <oneOrMore>
        <ref name="wng.p"/>
      </oneOrMore>
    </element>
  </define>
  <!--
    =============================================================================================
    recipeVariation
    =============================================================================================
  -->
  <define name="wng.recipeVariation.attlist">
    <interleave>
      <ref name="pattern.global.attributes"/>
      <optional>
        <attribute name="category">
          <aux:desc>a category for the recipe</aux:desc>
        </attribute>
      </optional>
    </interleave>
  </define>
  <define name="wng.recipeVariation">
    <element name="wng:recipeVariation">
      <aux:desc aux:cat="cook">A variation of a (culinary) recipe.</aux:desc>
      <ref name="wng.recipeVariation.attlist"/>
      <optional>
        <ref name="pattern.model.fragment.titling"/>
      </optional>
      <oneOrMore>
        <ref name="wng.p"/>
      </oneOrMore>
    </element>
  </define>
  <!--
    =============================================================================================
    recipeVariations
    =============================================================================================
  -->
  <define name="wng.recipeVariations.attlist">
    <ref name="pattern.global.attributes"/>
  </define>
  <define name="wng.recipeVariations">
    <element name="wng:recipeVariations">
      <aux:desc aux:cat="cook">A wrapper for one or more variations of a (culinary) recipe. These typically appear in print following the procedure (<xref xmlns="" linkend="wng_recipeProcedure"/>
+++).</aux:desc>
      <ref name="wng.recipeVariations.attlist"/>
      <optional>
        <ref name="pattern.model.fragment.titling"/>
      </optional>
      <zeroOrMore>
        <ref name="wng.p"/>
      </zeroOrMore>
      <oneOrMore>
        <ref name="wng.recipeVariation"/>
      </oneOrMore>
    </element>
  </define>
</grammar>