You are here

class W3Cvalidator_Message in W3C Validator 7

Simple class for a w3c_validator module Message.

The aim of this class is to format the errors or warning Messages in a similar way, no matter which validator as been employed. NOTE : still, this is oriented to easily understand W3C Markup Validator soap1.2 response format.

Hierarchy

Expanded class hierarchy of W3Cvalidator_Message

1 string reference to 'W3Cvalidator_Message'
W3Cvalidator_Message::__construct in validators/Message.php
Constructor for a response message

File

validators/Message.php, line 12

View source
class W3Cvalidator_Message {

  /**
   * Line corresponding to the message.
   *
   * Within the source code of the validated document, refers to the line
   * which caused this message.
   * @var int
   */
  public $line;

  /**
   * Column corresponding to the message.
   *
   * Within the source code of the validated document, refers to the column
   * within the line for the message.
   * @var int
   */
  public $col;

  /**
   * The actual message.
   * @var string
   */
  public $message;

  /**
   * Explanation for this message.
   *
   * HTML snippet which describes the message, usually with information on
   * how to correct the problem.
   * @var string
   */
  public $explanation;

  /**
   * Source which caused the message.
   *
   * the snippet of HTML code which invoked the message to give the
   * context of the e.
   * @var string
   */
  public $source;

  /**
   * Constructor for a response message
   *
   * @param object $node A dom document node.
   */
  function __construct($node = null) {
    if (isset($node)) {
      foreach (get_class_vars('W3Cvalidator_Message') as $var => $val) {
        $element = $node
          ->getElementsByTagName($var);
        if ($element->length) {
          $this->{$var} = $element
            ->item(0)->nodeValue;
        }
      }
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
W3Cvalidator_Message::$col public property Column corresponding to the message.
W3Cvalidator_Message::$explanation public property Explanation for this message.
W3Cvalidator_Message::$line public property Line corresponding to the message.
W3Cvalidator_Message::$message public property The actual message.
W3Cvalidator_Message::$source public property Source which caused the message.
W3Cvalidator_Message::__construct function Constructor for a response message