<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<axsl:stylesheet version="1.0" xmlns:axsl="http://www.w3.org/1999/XSL/Transform">
<axsl:output method="text"/>
<axsl:template match="/">
<axsl:apply-templates mode="M0"/>
<axsl:apply-templates mode="M1"/>
<axsl:apply-templates mode="M2"/>
</axsl:template>
<axsl:template match="rss" priority="4000" mode="M0">
<axsl:choose>
<axsl:when test="@version"/>
<axsl:otherwise>In pattern Structural Validation:
   An RSS version identifier should be supplied
</axsl:otherwise>
</axsl:choose>
<axsl:if test="@version != 0.91">In pattern Structural Validation:
   This Schematron validator is for RSS 0.91 only
</axsl:if>
<axsl:choose>
<axsl:when test="count(channel) = 1"/>
<axsl:otherwise>In pattern Structural Validation:
   An RSS element can only contain a single channel element
</axsl:otherwise>
</axsl:choose>
<axsl:apply-templates mode="M0"/>
</axsl:template>
<axsl:template match="channel" priority="3999" mode="M0">
<axsl:choose>
<axsl:when test="title"/>
<axsl:otherwise>In pattern Structural Validation:
   You must provide a title for your channel
</axsl:otherwise>
</axsl:choose>
<axsl:choose>
<axsl:when test="link"/>
<axsl:otherwise>In pattern Structural Validation:
   You must provide a link for your channel
</axsl:otherwise>
</axsl:choose>
<axsl:choose>
<axsl:when test="description"/>
<axsl:otherwise>In pattern Structural Validation:
   You must provide a description of your channel
</axsl:otherwise>
</axsl:choose>
<axsl:choose>
<axsl:when test="language"/>
<axsl:otherwise>In pattern Structural Validation:
   You must specify the language in which the content of your channel is written.
</axsl:otherwise>
</axsl:choose>
<axsl:choose>
<axsl:when test="count(copyright) &lt; 2"/>
<axsl:otherwise>In pattern Structural Validation:
   Only one copyright element should be supplied per channel
</axsl:otherwise>
</axsl:choose>
<axsl:choose>
<axsl:when test="count(image) &lt; 2"/>
<axsl:otherwise>In pattern Structural Validation:
   Only one image element should be supplied per channel
</axsl:otherwise>
</axsl:choose>
<axsl:choose>
<axsl:when test="count(textinput) &lt; 2"/>
<axsl:otherwise>In pattern Structural Validation:
   Only one textinput element can be supplied per channel
</axsl:otherwise>
</axsl:choose>
<axsl:choose>
<axsl:when test="count(skipHours) &lt; 2"/>
<axsl:otherwise>In pattern Structural Validation:
   One one skipHours element can be supplied per channel
</axsl:otherwise>
</axsl:choose>
<axsl:choose>
<axsl:when test="count(skipDays) &lt; 2"/>
<axsl:otherwise>In pattern Structural Validation:
   One one skipDays element can be supplied per channel
</axsl:otherwise>
</axsl:choose>
<axsl:choose>
<axsl:when test="managingEditor"/>
<axsl:otherwise>In pattern Structural Validation:
   You should provide an email address for the managing editor of your channel
</axsl:otherwise>
</axsl:choose>
<axsl:choose>
<axsl:when test="webMaster"/>
<axsl:otherwise>In pattern Structural Validation:
   You should provide an email address for the webmaster of your channel
</axsl:otherwise>
</axsl:choose>
<axsl:apply-templates mode="M0"/>
</axsl:template>
<axsl:template match="skipHours" priority="3998" mode="M0">
<axsl:choose>
<axsl:when test="count(hour) > 0"/>
<axsl:otherwise>In pattern Structural Validation:
   The skipHours element should contain a least one hour element
</axsl:otherwise>
</axsl:choose>
<axsl:apply-templates mode="M0"/>
</axsl:template>
<axsl:template match="skipDays" priority="3997" mode="M0">
<axsl:choose>
<axsl:when test="count(day) > 0"/>
<axsl:otherwise>In pattern Structural Validation:
   The skipDays element should contain a least one day element
</axsl:otherwise>
</axsl:choose>
<axsl:apply-templates mode="M0"/>
</axsl:template>
<axsl:template match="title|description|link" priority="3996" mode="M0">
<axsl:choose>
<axsl:when test="parent::channel or parent::image or parent::item or parent::textinput"/>
<axsl:otherwise>In pattern Structural Validation:
   A<axsl:text xml:space="preserve"> </axsl:text>
<axsl:value-of select="name(.)"/>
<axsl:text xml:space="preserve"> </axsl:text>element can only be contained with a channel, image, item or textinput element.
</axsl:otherwise>
</axsl:choose>
<axsl:if test="child::*">In pattern Structural Validation:
   A<axsl:text xml:space="preserve"> </axsl:text>
<axsl:value-of select="name(.)"/>
<axsl:text xml:space="preserve"> </axsl:text>element cannot contain sub-elements, remove any additional markup
</axsl:if>
<axsl:apply-templates mode="M0"/>
</axsl:template>
<axsl:template match="name" priority="3995" mode="M0">
<axsl:choose>
<axsl:when test="parent::textinput"/>
<axsl:otherwise>In pattern Structural Validation:
   A name element can only be contained within a textinput element
</axsl:otherwise>
</axsl:choose>
<axsl:apply-templates mode="M0"/>
</axsl:template>
<axsl:template match="url" priority="3994" mode="M0">
<axsl:choose>
<axsl:when test="parent::image"/>
<axsl:otherwise>In pattern Structural Validation:
   A url element can only be contained within an image element
</axsl:otherwise>
</axsl:choose>
<axsl:apply-templates mode="M0"/>
</axsl:template>
<axsl:template match="width" priority="3993" mode="M0">
<axsl:choose>
<axsl:when test="parent::image"/>
<axsl:otherwise>In pattern Structural Validation:
   A width element can only be contained within an image element
</axsl:otherwise>
</axsl:choose>
<axsl:apply-templates mode="M0"/>
</axsl:template>
<axsl:template match="height" priority="3992" mode="M0">
<axsl:choose>
<axsl:when test="parent::image"/>
<axsl:otherwise>In pattern Structural Validation:
   A height element can only be contained within an image element
</axsl:otherwise>
</axsl:choose>
<axsl:apply-templates mode="M0"/>
</axsl:template>
<axsl:template match="image" priority="3991" mode="M0">
<axsl:choose>
<axsl:when test="title"/>
<axsl:otherwise>In pattern Structural Validation:
   Images must have titles. The title is used for the ALT text of the image.
</axsl:otherwise>
</axsl:choose>
<axsl:choose>
<axsl:when test="count(width) = count(height)"/>
<axsl:otherwise>In pattern Structural Validation:
   Width and Height elements should be balanced
</axsl:otherwise>
</axsl:choose>
<axsl:choose>
<axsl:when test="url"/>
<axsl:otherwise>In pattern Structural Validation:
   This image does not have a url
</axsl:otherwise>
</axsl:choose>
<axsl:apply-templates mode="M0"/>
</axsl:template>
<axsl:template match="textinput" priority="3990" mode="M0">
<axsl:choose>
<axsl:when test="title"/>
<axsl:otherwise>In pattern Structural Validation:
   A textinput must have a title. It is used to label the submit button for the field
</axsl:otherwise>
</axsl:choose>
<axsl:choose>
<axsl:when test="name"/>
<axsl:otherwise>In pattern Structural Validation:
   A textinput must have a name. It is used to identify the input element in the form
</axsl:otherwise>
</axsl:choose>
<axsl:choose>
<axsl:when test="link"/>
<axsl:otherwise>In pattern Structural Validation:
   A textinput must have a link. It is used to identify the target to which the form is sent
</axsl:otherwise>
</axsl:choose>
<axsl:apply-templates mode="M0"/>
</axsl:template>
<axsl:template match="item" priority="3989" mode="M0">
<axsl:choose>
<axsl:when test="parent::channel"/>
<axsl:otherwise>In pattern Structural Validation:
   An item element can only occur within a channel element
</axsl:otherwise>
</axsl:choose>
<axsl:choose>
<axsl:when test="title"/>
<axsl:otherwise>In pattern Structural Validation:
   You must provide a title for this item
</axsl:otherwise>
</axsl:choose>
<axsl:choose>
<axsl:when test="link"/>
<axsl:otherwise>In pattern Structural Validation:
   You must provide a link for this item
</axsl:otherwise>
</axsl:choose>
<axsl:apply-templates mode="M0"/>
</axsl:template>
<axsl:template match="width" priority="3988" mode="M0">
<axsl:choose>
<axsl:when test="preceding::height or following::height"/>
<axsl:otherwise>In pattern Structural Validation:
   A width should be accompanied by a height
</axsl:otherwise>
</axsl:choose>
<axsl:apply-templates mode="M0"/>
</axsl:template>
<axsl:template match="height" priority="3987" mode="M0">
<axsl:choose>
<axsl:when test="preceding::width or following::width"/>
<axsl:otherwise>In pattern Structural Validation:
   A height should be accompanied by a width
</axsl:otherwise>
</axsl:choose>
<axsl:apply-templates mode="M0"/>
</axsl:template>
<axsl:template match="text()" priority="-1" mode="M0"/>
<axsl:template match="language" priority="4000" mode="M1">
<axsl:choose>
<axsl:when test="string-length(.) > 0"/>
<axsl:otherwise>In pattern Content Validation:
   You must specify a valid language code within a language element
</axsl:otherwise>
</axsl:choose>
<axsl:choose>
<axsl:when test=". = 'af' or . = 'sq' or . = 'eu' or . = 'be' or . = 'bg' or . = 'ca' or         . = 'zh-cn' or . = 'zh-tw' or . = 'hr' or . = 'cs' or . = 'da' or . = 'nl' or         . = 'nl-be' or . = 'nl-nl' or . = 'en' or . = 'en-au' or . = 'en-bz' or         . = 'en-ca' or . = 'en-ie' or . = 'en-jm' or . = 'en-nz' or . = 'en-ph' or         . = 'en-za' or . = 'en-tt' or . = 'en-gb' or . = 'en-us' or . = 'en-zw' or         . = 'fo' or . = 'fi' or . = 'fr' or . = 'fr-be' or . = 'fr-ca' or . = 'fr-fr' or         . = 'fr-lu' or . = 'fr-mc' or . = 'fr-ch' or . = 'gl' or . = 'gd' or . = 'de' or         . = 'de-at' or . = 'de-de' or . = 'de-li' or . = 'de-lu' or . = 'de-ch' or         . = 'el' or . = 'hu' or . = 'is' or . = 'in' or . = 'ga' or . = 'it' or         . = 'it-it' or . = 'it-ch' or . = 'ja' or . = 'ko' or . = 'mk' or . = 'no' or         . = 'pl' or . = 'pt' or . = 'pt-br' or . = 'pt-pt' or . = 'ro' or . = 'ro-mo' or         . = 'ro-ro' or . = 'ru' or . = 'ru-mo' or . = 'ru-ru' or . = 'sr' or . = 'sk' or         . = 'sl' or . = 'es' or . = 'es-ar' or . = 'es-bo' or . = 'es-cl' or . = 'es-co' or         . = 'es-cr' or . = 'es-do' or . = 'es-ec' or . = 'es-sv' or . = 'es-gt' or . = 'es-hn' or         . = 'es-mx' or . = 'es-ni' or . = 'es-pa' or . = 'es-py' or . = 'es-pe' or . = 'es-pr' or         . = 'es-es' or . = 'es-uy' or . = 'es-ve' or . = 'sv' or . = 'sv-fi' or . = 'sv-se' or . = 'tr' or         . = 'uk'"/>
<axsl:otherwise>In pattern Content Validation:
   Invalid language code
</axsl:otherwise>
</axsl:choose>
<axsl:apply-templates mode="M1"/>
</axsl:template>
<axsl:template match="link" priority="3999" mode="M1">
<axsl:choose>
<axsl:when test="starts-with(., 'http://') or starts-with(., 'ftp://')"/>
<axsl:otherwise>In pattern Content Validation:
   Links should only be made to http or ftp resources.
</axsl:otherwise>
</axsl:choose>
<axsl:apply-templates mode="M1"/>
</axsl:template>
<axsl:template match="skipHours" priority="3998" mode="M1">
<axsl:choose>
<axsl:when test="count(hour) &lt; 25"/>
<axsl:otherwise>In pattern Content Validation:
   There is a limit of 24 hour elements within a<axsl:text xml:space="preserve"> </axsl:text>
<axsl:value-of select="name(.)"/>
<axsl:text xml:space="preserve"> </axsl:text>element
</axsl:otherwise>
</axsl:choose>
<axsl:apply-templates mode="M1"/>
</axsl:template>
<axsl:template match="hour" priority="3997" mode="M1">
<axsl:choose>
<axsl:when test="number(.) > 0 and number(.) &lt; 24"/>
<axsl:otherwise>In pattern Content Validation:
   Hour values should be in the range 0-23
</axsl:otherwise>
</axsl:choose>
<axsl:apply-templates mode="M1"/>
</axsl:template>
<axsl:template match="skipDays" priority="3996" mode="M1">
<axsl:choose>
<axsl:when test="count(day) &lt; 8"/>
<axsl:otherwise>In pattern Content Validation:
   There is a limit of 7 day elements within a<axsl:text xml:space="preserve"> </axsl:text>
<axsl:value-of select="name(.)"/>
<axsl:text xml:space="preserve"> </axsl:text>element
</axsl:otherwise>
</axsl:choose>
<axsl:apply-templates mode="M1"/>
</axsl:template>
<axsl:template match="day" priority="3995" mode="M1">
<axsl:choose>
<axsl:when test=". = 'Monday' or . = 'Tuesday' or . = 'Wednesday' or         . = 'Thursday' or . = 'Friday' or         . = 'Saturday' or . = 'Sunday'"/>
<axsl:otherwise>In pattern Content Validation:
   Days should be listed as Monday, Tuesday, Wednesday, Thursday, Friday, Saturday and Sunday
</axsl:otherwise>
</axsl:choose>
<axsl:apply-templates mode="M1"/>
</axsl:template>
<axsl:template match="image" priority="3994" mode="M1">
<axsl:choose>
<axsl:when test="height"/>
<axsl:otherwise>In pattern Content Validation:
   An image height has not been supplied. A default height of 31 pixels will be assumed
</axsl:otherwise>
</axsl:choose>
<axsl:choose>
<axsl:when test="width"/>
<axsl:otherwise>In pattern Content Validation:
   An image width has not been supplied. A default width of 88 pixels will be assumed
</axsl:otherwise>
</axsl:choose>
<axsl:choose>
<axsl:when test="url"/>
<axsl:otherwise>In pattern Content Validation:
   This image does not have a url
</axsl:otherwise>
</axsl:choose>
<axsl:apply-templates mode="M1"/>
</axsl:template>
<axsl:template match="width" priority="3993" mode="M1">
<axsl:choose>
<axsl:when test="string-length(.) > 0"/>
<axsl:otherwise>In pattern Content Validation:
   Width elements should not be empty
</axsl:otherwise>
</axsl:choose>
<axsl:apply-templates mode="M1"/>
</axsl:template>
<axsl:template match="height" priority="3992" mode="M1">
<axsl:choose>
<axsl:when test="string-length(.) > 0"/>
<axsl:otherwise>In pattern Content Validation:
   Height elements should not be empty
</axsl:otherwise>
</axsl:choose>
<axsl:apply-templates mode="M1"/>
</axsl:template>
<axsl:template match="text()" priority="-1" mode="M1"/>
<axsl:template match="channel" priority="4000" mode="M2">
<axsl:if test="rating and         ((string-length(.) &lt; 20 or           string-length(.) > 500))">In pattern Field Lengths:
   Supplied PICS ratings must be between 20-500 characters in length
</axsl:if>
<axsl:apply-templates mode="M2"/>
</axsl:template>
<axsl:template match="link" priority="3999" mode="M2">
<axsl:choose>
<axsl:when test="string-length(.) > 1 and         string-length(.) &lt; 500"/>
<axsl:otherwise>In pattern Field Lengths:
   Link urls must be between 1-500 characters in length.
</axsl:otherwise>
</axsl:choose>
<axsl:apply-templates mode="M2"/>
</axsl:template>
<axsl:template match="width" priority="3998" mode="M2">
<axsl:choose>
<axsl:when test="number(.) &lt; 144 and         number(.) > 0"/>
<axsl:otherwise>In pattern Field Lengths:
   Images width must be between 1-144 pixels
</axsl:otherwise>
</axsl:choose>
<axsl:apply-templates mode="M2"/>
</axsl:template>
<axsl:template match="height" priority="3997" mode="M2">
<axsl:choose>
<axsl:when test="number(.) &lt; 400 and         number(.) > 0"/>
<axsl:otherwise>In pattern Field Lengths:
   Images height must be between 1-400 pixels
</axsl:otherwise>
</axsl:choose>
<axsl:apply-templates mode="M2"/>
</axsl:template>
<axsl:template match="title" priority="3996" mode="M2">
<axsl:choose>
<axsl:when test="string-length(.) > 1 and         string-length(.) &lt; 100"/>
<axsl:otherwise>In pattern Field Lengths:
   Titles must be between 1-100 characters in length
</axsl:otherwise>
</axsl:choose>
<axsl:apply-templates mode="M2"/>
</axsl:template>
<axsl:template match="description" priority="3995" mode="M2">
<axsl:if test="parent::channel and         (string-length(.) = 0 or          string-length(.) > 500)">In pattern Field Lengths:
   Channel descriptions must be between 1-500 characters in length
</axsl:if>
<axsl:if test="parent::item and         (string-length(.) = 0 or          string-length(.) > 500)">In pattern Field Lengths:
   Item descriptions must be between 1-500 characters in length
</axsl:if>
<axsl:if test="parent::image and         (string-length(.) = 0 or          string-length(.) > 100)">In pattern Field Lengths:
   Image descriptions must be between 1-100 characters in length
</axsl:if>
<axsl:if test="parent::textinput and         (string-length(.) = 0 or          string-length(.) > 500)">In pattern Field Lengths:
   Textinput descriptions must be between 1-500 characters in length
</axsl:if>
<axsl:apply-templates mode="M2"/>
</axsl:template>
<axsl:template match="copyright|pubDate|lastBuildDate|managingEditor|webMaster" priority="3994" mode="M2">
<axsl:choose>
<axsl:when test="string-length(.) > 1 and         string-length(.) &lt; 100"/>
<axsl:otherwise>In pattern Field Lengths:
   <axsl:text xml:space="preserve"> </axsl:text>
<axsl:value-of select="name(.)"/>
<axsl:text xml:space="preserve"> </axsl:text>elements must be between 1-100 characters in length
</axsl:otherwise>
</axsl:choose>
<axsl:apply-templates mode="M2"/>
</axsl:template>
<axsl:template match="url" priority="3993" mode="M2">
<axsl:choose>
<axsl:when test="string-length(.) > 0"/>
<axsl:otherwise>In pattern Field Lengths:
   url elements must not be empty
</axsl:otherwise>
</axsl:choose>
<axsl:apply-templates mode="M2"/>
</axsl:template>
<axsl:template match="text()" priority="-1" mode="M2"/>
<axsl:template match="text()" priority="-1"/>
</axsl:stylesheet>
