/
Message.php
84 lines (76 loc) · 1.87 KB
/
Message.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php
/**
* This file provides a base class for messages from a W3C validator.
*
* @package Services_W3C_HTMLValidator
* @author Brett Bieber
*/
/**
* The message class holds a response from the W3 validator.
*/
class Services_W3C_HTMLValidator_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;
/**
* Unique ID for this message
*
* not implemented yet. should be the number of the error, as addressed
* internally by the validator
* @var int
*/
public $messageid;
/**
* 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
*/
function __construct($node = null)
{
if (isset($node)) {
foreach (get_class_vars('Services_W3C_HTMLValidator_Message') as
$var => $val) {
$element = $node->getElementsByTagName($var);
if ($element->length) {
$this->$var = $element->item(0)->nodeValue;
}
}
}
}
}
?>