1 <?xml version="1.0" encoding="UTF-8"?>
3 <sect2 id="zend.validate.sitemap">
4 <title>Sitemap Validators</title>
7 The following validators conform to the <ulink
8 url="http://www.sitemaps.org/protocol.php">Sitemap <acronym>XML</acronym>
12 <sect3 id="zend.validate.sitemap.changefreq">
13 <title>Sitemap_Changefreq</title>
16 Validates whether a string is valid for using as a 'changefreq'
17 element in a Sitemap <acronym>XML</acronym> document. Valid values are: 'always',
18 'hourly', 'daily', 'weekly', 'monthly', 'yearly', or 'never'.
22 Returns <constant>TRUE</constant> if and only if the value is a string
23 and is equal to one of the frequencies specified above.
27 <sect3 id="zend.validate.sitemap.lastmod">
28 <title>Sitemap_Lastmod</title>
31 Validates whether a string is valid for using as a 'lastmod'
32 element in a Sitemap <acronym>XML</acronym> document. The lastmod element should
33 contain a <acronym>W3C</acronym> date string, optionally discarding information
38 Returns <constant>TRUE</constant> if and only if the given value is
39 a string and is valid according to the protocol.
42 <example id="zend.validate.sitemap.lastmod.example">
43 <title>Sitemap Lastmod Validator</title>
45 <programlisting language="php"><![CDATA[
46 $validator = new Zend_Validate_Sitemap_Lastmod();
48 $validator->isValid('1999-11-11T22:23:52-02:00'); // true
49 $validator->isValid('2008-05-12T00:42:52+02:00'); // true
50 $validator->isValid('1999-11-11'); // true
51 $validator->isValid('2008-05-12'); // true
53 $validator->isValid('1999-11-11t22:23:52-02:00'); // false
54 $validator->isValid('2008-05-12T00:42:60+02:00'); // false
55 $validator->isValid('1999-13-11'); // false
56 $validator->isValid('2008-05-32'); // false
57 $validator->isValid('yesterday'); // false
62 <sect3 id="zend.validate.sitemap.loc">
63 <title>Sitemap_Loc</title>
66 Validates whether a string is valid for using as a 'loc'
67 element in a Sitemap <acronym>XML</acronym> document. This uses
68 <methodname>Zend_Form::check()</methodname> internally. Read more at
69 <link linkend="zend.uri.validation">URI Validation</link>.
73 <sect3 id="zend.validate.sitemap.priority">
74 <title>Sitemap_Priority</title>
77 Validates whether a value is valid for using as a 'priority'
78 element in a Sitemap <acronym>XML</acronym> document. The value should be a
79 decimal between 0.0 and 1.0. This validator accepts both numeric
80 values and string values.
83 <example id="zend.validate.sitemap.priority.example">
84 <title>Sitemap Priority Validator</title>
86 <programlisting language="php"><![CDATA[
87 $validator = new Zend_Validate_Sitemap_Priority();
89 $validator->isValid('0.1'); // true
90 $validator->isValid('0.789'); // true
91 $validator->isValid(0.8); // true
92 $validator->isValid(1.0); // true
94 $validator->isValid('1.1'); // false
95 $validator->isValid('-0.4'); // false
96 $validator->isValid(1.00001); // false
97 $validator->isValid(0xFF); // false
98 $validator->isValid('foo'); // false
103 <sect3 id="zend.validate.set.callback.options">
104 <title>Supported options for Zend_Validate_Sitemap_*</title>
107 There are no supported options for any of the Sitemap validators.