<?xml version="1.0" ?>
<!DOCTYPE schema [
<!ELEMENT schema  ( pattern+ )>
<!ELEMENT pattern ( rule+ )>
<!ELEMENT rule    ( assert | report )+>
<!ELEMENT assert  ( #PCDATA )>
<!ELEMENT report  ( #PCDATA )>


<!ATTLIST schema  ns      CDATA #IMPLIED >
<!ATTLIST pattern name    CDATA #REQUIRED>
<!ATTLIST rule    context CDATA #REQUIRED>
<!ATTLIST assert  test    CDATA #REQUIRED>
<!ATTLIST report  test    CDATA #REQUIRED>
]>
<!-- 
	NITF Schema posted by Dave Pawson to maillist w3c-wai-pf@w3.org
	1999-10-29 as example for discussion purposes.
	NITF information can be found at http://www.iptc.org/iptc/
-->
<schema>
    <pattern name="The NITF Tagset">
         <rule context="docdata">
            <assert test="string-length(urgency/@ed-urg) &lt; 2">Urgency
should be a single digit</assert>
           
            <report test="count(*) &lt; 3">Warning: The docdata element
should normally have at least 4 entries: </report>
        </rule>

        <rule context="body">
            <assert test="@lang">The language attribute is missing from the
body element.</assert>  
            <assert test="string-length(@lang) &gt; 0">The language
attribute to the body element should not be empty.</assert>
        </rule>
        <rule context="body.head">
            <assert test="string-length(byline) &gt; 0">Byline should be
completed.</assert>
           
            <assert test="abstract">Warning: No abstract present. Needed for
archive purposes</assert>
        </rule>
        <rule context="hr">
            <assert test="parent::block">hr element used outside of a block
element. Deprecated</assert>
            
        </rule>
<!--  <rule context="num">
   <assert test="number(.)">The number element does not contain numeric
data</assert>
  </rule>
-->

  <rule context="a">
   <!-- one of (report assert) -->
   <assert test="@href">Element a has no href attribute</assert>
   <assert test="@href = id(@href)/@id">Cross reference from a element not
available</assert>
  </rule>


  <rule context="event|em|num|location">
   <!-- one of (report assert) -->
   <assert test="parent::block">The element is not within a block
wrapper</assert>
  </rule>

  <rule context="fig">
   <!-- one of (report assert) -->
   <assert test="string-length(@name) > 0">Figure has no name</assert>
   <assert test="string-length(@source)>0">Figure has no source</assert>
   <assert test="string-length(@alt)>0">Figure has no alternative text
description</assert>
  </rule>

 <rule context="img">
   <!-- one of (report assert) -->
   <assert test="string-length(@name) > 0">Image has no name</assert>
   <assert test="string-length(@alt)>0">Image has no alternative text
description</assert>
  </rule>


  <rule context="fig.caption">
   <!-- one of (report assert) -->
   <assert test="string-length(caption) > 0">No caption provided for
figure</assert>
  </rule>

    </pattern>
   
</schema>


