home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / Servidores / xampp-win32-1.6.7-installer.exe / php / PEAR / Services / W3C / HTMLValidator / Message.php < prev    next >
Encoding:
PHP Script  |  2008-07-02  |  2.4 KB  |  97 lines

  1. <?php
  2. /**
  3.  * This file provides a base class for messages from a W3C validator.
  4.  * 
  5.  * PHP versions 5
  6.  * 
  7.  * @category Services
  8.  * @package  Services_W3C_HTMLValidator
  9.  * @author   Brett Bieber <brett.bieber@gmail.com>
  10.  * @license  http://www.opensource.org/licenses/bsd-license.php BSD
  11.  * @version  CVS: $id$
  12.  * @link     http://pear.php.net/package/Services_W3C_HTMLValidator
  13.  * @since    File available since Release 0.2.0
  14.  */
  15.  
  16. /**
  17.  * The message class holds a response from the W3 validator.
  18.  * 
  19.  * @category Services
  20.  * @package  Services_W3C_HTMLValidator
  21.  * @author   Brett Bieber <brett.bieber@gmail.com>
  22.  * @license  http://www.opensource.org/licenses/bsd-license.php BSD
  23.  * @link     http://pear.php.net/package/Services_W3C_HTMLValidator
  24.  */ 
  25. class Services_W3C_HTMLValidator_Message
  26. {
  27.     /**
  28.      * line corresponding to the message
  29.      * 
  30.      * Within the source code of the validated document, refers to the line which
  31.      * caused this message.
  32.      * @var int
  33.      */
  34.     public $line;
  35.     
  36.     /**
  37.      * column corresponding to the message
  38.      * 
  39.      * Within the source code of the validated document, refers to the column within
  40.      * the line for the message.
  41.      * @var int
  42.      */
  43.     public $col;
  44.     
  45.     /**
  46.      * The actual message
  47.      * @var string
  48.      */
  49.     public $message;
  50.     
  51.     /**
  52.      * Unique ID for this message
  53.      * 
  54.      * not implemented yet. should be the number of the error, as addressed
  55.      * internally by the validator
  56.      * @var int
  57.      */
  58.     public $messageid;
  59.     
  60.     /**
  61.      * Explanation for this message.
  62.      * 
  63.      * HTML snippet which describes the message, usually with information on
  64.      * how to correct the problem.
  65.      * @var string
  66.      */
  67.     public $explanation;
  68.     
  69.     /**
  70.      * Source which caused the message.
  71.      * 
  72.      * the snippet of HTML code which invoked the message to give the 
  73.      * context of the e
  74.      * @var string
  75.      */
  76.     public $source;
  77.     
  78.     /**
  79.      * Constructor for a response message
  80.      *
  81.      * @param object $node A dom document node.
  82.      */
  83.     function __construct($node = null)
  84.     {
  85.         if (isset($node)) {
  86.             foreach (get_class_vars('Services_W3C_HTMLValidator_Message') as
  87.                 $var => $val) {
  88.                 $element = $node->getElementsByTagName($var);
  89.                 if ($element->length) {
  90.                     $this->$var = $element->item(0)->nodeValue;
  91.                 }
  92.             }
  93.         }
  94.     }
  95. }
  96.  
  97. ?>