<its:rules
    xmlns:its="http://www.w3.org/2005/11/its"
    xmlns:itst="http://itstool.org/extensions/"
    xmlns:mal="http://projectmallard.org/1.0/"
    version="2.0">

  <itst:match selector="/mal:page"/>

  <!-- Any extension on projectmallard.org will use xml:lang -->
  <its:langRule selector="//*[starts-with(namespace-uri(.), 'http://projectmallard.org/')]"
                langPointer="@xml:lang"/>

  <itst:credits appendTo="/mal:page/mal:info">
    <mal:credit type="translator copyright">
      <mal:name><itst:value-of select="name"/></mal:name>
      <mal:email><itst:value-of select="email"/></mal:email>
      <mal:years><itst:value-of select="years"/></mal:years>
    </mal:credit>
  </itst:credits>

  <its:withinTextRule withinText="yes" selector="//mal:cite//*   |
                                                 //mal:code//*   |
                                                 //mal:desc//*   |
                                                 //mal:email//*  |
                                                 //mal:link//*   |
                                                 //mal:name//*   |
                                                 //mal:p//*      |
                                                 //mal:screen//* |
                                                 //mal:title//*  |
                                                 //mal:years//*  "/>

  <its:preserveSpaceRule space="preserve" selector="//mal:code | //mal:screen "/>

  <its:localeFilterRule localeFilterList="" selector="//mal:comment"/>

  <its:translateRule translate="no" selector="//mal:credit/mal:email"/>

  <its:externalResourceRefRule externalResourceRefPointer="@src" selector="//mal:media" />

  <itst:contextRule selector="//mal:info/mal:title[@type]" contextPointer="@type"/>
  <itst:contextRule selector="//mal:info/mal:title[@type and @role]" contextPointer="concat(@type, ':', @role)"/>
</its:rules>
