<?xml version="1.0" encoding="utf-8"?>
<!-- ************************************************************

	* [Sample SILCN-based XMLProbe rules for Web Accessibility 
	  Initiative guidelines conformance]
	* XMLProbe
	* by Griffin Brown
	* Copyright (c) 2004 Griffin Brown Digital Publishing Ltd
	* [nandinid 15:05 05/01/04]
	
     ************************************************************-->



<!-- Root element must be <silcn>. It's a good idea to declare SILCN and XMLProbe
Namespaces here for use throughout the document -->

<silcn:silcn xmlns:silcn='http://silcn.org/200309' xmlns:probe="http://xmlprobe.com/200312">



<!-- SILCN version - must be 1.0 for SILCN 1.0 -->

<silcn:version>1.0</silcn:version>


<!-- * * * * * * * * * * * * * * START TOOL CONFIGURATION * * * * * * * * * * * * * * -->


<!-- This <addin> element configures the underlying parser behaviour. NB you can pass any feature
information supported by your chosen parser using these structures. -->

<probe:addIn>
<probe:name>org.apache.xerces.parsers.SAXParser</probe:name>
<probe:config>



<!-- Set this feature to tell the parser whether or not to use validation. For testing
well-formed content, this should be set false. When content is valid to a DTD, this should
be set true -->

	<probe:feature>
		<probe:name>http://xml.org/sax/features/validation</probe:name>
		<probe:value>false</probe:value>
	</probe:feature>
	


<!-- Whether or not to recognise Namespaces. Should always be true except in weird circumstances. -->
	
	<probe:feature>
		<probe:name>http://xml.org/sax/features/namespaces</probe:name>
		<probe:value>true</probe:value>
	</probe:feature>
	
	
	
<!-- Whether or not to recognise Namespace prefixes. Ditto. -->
	
	<probe:feature>
		<probe:name>http://xml.org/sax/features/namespace-prefixes</probe:name>
		<probe:value>true</probe:value>
	</probe:feature>   
	
	
	
<!-- XERCES ONLY! Whether or not Xerces-J should try to continue after a fatal error in the XML (i.e.
a well-formedness error). Since all bets are off under these conditions, this is best
left set false -->	
	
	<probe:feature>
		<probe:name>http://apache.org/xml/features/continue-after-fatal-error</probe:name>
		<probe:value>false</probe:value>
	</probe:feature>


	
<!-- Whether or not XMLProbe should issue 'warnings' (as specified in the XML Recommendation). -->	

	<probe:feature>
		<probe:name>http://xmlprobe.com/features/issue-warnings</probe:name>
		<probe:value>false</probe:value>
	</probe:feature>
	

	
<!-- Whether or not XMLProbe should emit an activity log to STDERR when it runs. Primarily useful
for debugging purposes -->		
	
	<probe:feature>
		<probe:name>http://xmlprobe.com/features/show-activity-log</probe:name>
		<probe:value>true</probe:value>
	</probe:feature>


	
<!-- Determines the error format used for output. Currently this *must* be 'xml' - which causes
XMLProbe to emit a report in SILCN format - or 'text', for a convention parser-like output -->		

	<probe:feature>
		<probe:name>http://xmlprobe.com/features/error-format</probe:name>
		<probe:value>xml</probe:value>
	</probe:feature>
	

<!-- Determines the encoding used for output. Currently this *must* be 'utf8' or 'ascii' -->		
		
	<probe:feature>
		<probe:name>http://xmlprobe.com/features/encoding</probe:name>
		<probe:value>UTF-8</probe:value>
	</probe:feature>

</probe:config>


<!-- This <addin> element configures the QA application behavior -->

</probe:addIn>
   
<probe:addIn>
<probe:name>com.xmlprobe.QAHandler</probe:name>
<probe:config>



<!-- This determines whether XMLProbe should use XPath to locate elements matched by the rules. This
should always be true - and is required to process output sensibly using XSLT etc.-->

<probe:feature>
<probe:name>http://xmlprobe.com/features/use-xpath-locators</probe:name>
<probe:value>true</probe:value>
</probe:feature>


</probe:config>
</probe:addIn>

<!-- * * * * * * * * * * * * * * END TOOL CONFIGURATION * * * * * * * * * * * * * * -->


<!-- Everything from here on is pertinent to the QA rules themselves -->


<!-- Each <selection> element contains a bunch of rules -->

<silcn:selection>
   
   <silcn:expression-language-declaration>
      <silcn:name>XPath</silcn:name>
   </silcn:expression-language-declaration>
   
   <silcn:namespace-declaration>
      <silcn:uri>http://www.w3.org/1999/xlink</silcn:uri>
      <silcn:prefix>xlink</silcn:prefix>
   </silcn:namespace-declaration>
   
   <silcn:namespace-declaration>
      <silcn:uri>http://www.w3.org/1999/xhtml</silcn:uri>
      <silcn:prefix>xh</silcn:prefix>
   </silcn:namespace-declaration>
   
   <silcn:set-criterion>
      <silcn:id>1001</silcn:id>
      <silcn:expression>//xh:img[not(@alt)and not(@longdesc)]
            |//xh:input[not(@alt)]
            |//xh:applet[not(@alt)]
            |//xh:object[not(@alt)or(@longdesc)]</silcn:expression>
      <probe:message>WAI Guideline 1.1: <probe:eval>name()</probe:eval> should have a text-equivalent in the form of an alt or longdesc attribute.</probe:message>
   </silcn:set-criterion>
   
   <silcn:set-criterion>
      <silcn:id>1002</silcn:id>
      <silcn:expression>//xh:script[ not( following-sibling::*[1][self::xh:noscript])]</silcn:expression>
      <probe:message>WAI Guideline 6.3: In order to ensure that pages are usable when scripts are turned off or not supported, provide a text equivalent with the 'noscript' element.</probe:message>
   </silcn:set-criterion>
   
   <silcn:set-criterion>
      <silcn:id>1003</silcn:id>
      <silcn:expression>//xh:style
            |/xh:html/xh:head/xh:link/@href[ends-with( ., ".css" )]</silcn:expression>
      <probe:message>WAI Guideline 6.1: Ensure that pages are still readable even if the provided internal or external stylesheets are not usable.</probe:message>
   </silcn:set-criterion>
   
   <silcn:set-criterion>
      <silcn:id>1004</silcn:id>
      <silcn:expression>//xh:frame[not(@title)]
            |//xh:frameset[not(@title)]</silcn:expression>
      <probe:message>WAI Guideline 1.1: Frame elements should have a descriptive title.</probe:message>
   </silcn:set-criterion>
   
   <silcn:set-criterion>
      <silcn:id>1005</silcn:id>
      <silcn:expression>//xh:frame/@src[ends-with(.,".gif")
            or ends-with( ., "jpg" )
            or ends-with( ., "jpeg" )
            or ends-with( ., "png" )]</silcn:expression>
      <probe:message>WAI Guideline 6.2: Equivalents for dynamic content should be updated when the dynamic content changes. This is not possible if a frame is just an image link. Make the source ("src") of a frame an HTML file and insert images within it so that the text alternatives evolve correctly.</probe:message>
   </silcn:set-criterion>
   
   <silcn:set-criterion>
      <silcn:id>1006</silcn:id>
      <silcn:expression>//xh:map[area(not(@alt)]
            |//map[not(a)] </silcn:expression>
      <probe:message>WAI Guideline 1.1: Image maps should either use the "alt" attribute with area, or the map element with a elements (and other text) as content.</probe:message>
   </silcn:set-criterion>
   
   <silcn:set-criterion>
      <silcn:id>1007</silcn:id>
      <silcn:expression>//xh:table/xh:tr[(not(xh:th))]
            |//xh:table/xh:td[(not(xh:th))]</silcn:expression>
      <probe:message>WAI Guideline 5.1: Identify the row and column headers for all data tables.</probe:message>
   </silcn:set-criterion>
   
   <silcn:set-criterion>
      <silcn:id>2008</silcn:id>
      <silcn:expression>//xh:body[string(@bgcolor)=string(@color)]</silcn:expression>
      <probe:message>WAI Guideline 2.2: The background color and the foreground color are the same.</probe:message>
   </silcn:set-criterion>
   
   <silcn:set-criterion>
      <silcn:id>2009</silcn:id>
      <silcn:expression>//xh:meta[@http-equiv="refresh"]</silcn:expression>
      <probe:message>WAI Guideline 7.4: Until user agents allow users to stop the refresh, avoid causing the page to periodically refresh.</probe:message>
   </silcn:set-criterion>
   
   <silcn:set-criterion>
      <silcn:id>2010</silcn:id>
      <silcn:expression>//xh:b
            |//xh:i
            |//xh:font</silcn:expression>
      <probe:message>WAI Guideline 3.3: Use of presentation markup such as <probe:eval>name()</probe:eval> not recommended. Use style-independent elements such as 'strong' and 'em', or style sheets to control layout and presentation.</probe:message>
   </silcn:set-criterion>
   
   <silcn:set-criterion>
      <silcn:id>2011</silcn:id>
      <silcn:expression>//xh:frame[not(@longdesc)]
            |//xh:frameset[not(@longdesc)]</silcn:expression>
      <probe:message>WAI Guideline 12.2: The purpose of frame elements and how they relate to each other should be described with a longdesc element.</probe:message>
   </silcn:set-criterion>
   
   <silcn:set-criterion>
      <silcn:id>2012</silcn:id>
      <silcn:expression>//xh:frame[not(xh:noframes)]
            |//xh:frameset[not(xh:noframes)]</silcn:expression>
      <probe:message>WAI Guideline 6.5: Ensure that dynamic content is accessible or provide an alternative presentation or page through a noframes alternative for each frameset.</probe:message>
   </silcn:set-criterion>
   
   <silcn:set-criterion>
      <silcn:id>2013</silcn:id>
      <silcn:expression>//xh:blink
            |//xh:marquee</silcn:expression>
      <probe:message>WAI Guideline 7.2: Use of markup such as <probe:eval>name()</probe:eval> not recommended. Until users are able to control blinking or moving content, avoid such display effects in content.</probe:message>
   </silcn:set-criterion>
   
   <silcn:set-criterion>
      <silcn:id>3014</silcn:id>
      <silcn:expression>/xh:html[not(@lang) or (@xml:lang)]
            |//body[not(@lang) or (@xml:lang)]</silcn:expression>
      <probe:message>WAI Guideline 4.3: Identify the primary natural language of the web page.</probe:message>
   </silcn:set-criterion>
   
   <silcn:set-criterion>
      <silcn:id>3015</silcn:id>
      <silcn:expression>//xh:table[not(@summary)]</silcn:expression>
      <probe:message>WAI Guideline 5.5: Tables should be provided with a summary attribute.</probe:message>
   </silcn:set-criterion>
   
   <silcn:set-criterion>
      <silcn:id>3016</silcn:id>
      <silcn:expression>//xh:abbr[not(@title)]
            |//xh:acronym[not(@title)]</silcn:expression>
      <probe:message>WAI Guideline 4.2: Specify the expansion of each <probe:eval>name()</probe:eval> in a document.</probe:message>
   </silcn:set-criterion>
   
</silcn:selection>

</silcn:silcn>
