forked from josephwilk/iwfms
/
parseHTMLdtd.php
49 lines (26 loc) · 1.04 KB
/
parseHTMLdtd.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
<?
function generatePrologDTDtyping( $dtd ){
$table="dtdFile";
include_once(realpath('') . '/includes/configuration/core_configuration.php');
//Load the pear library
require_once 'XML_DTD/DTD.php';
ob_implicit_flush(true);
$path = ini_get('include_path');
$dtd = 'w3cDtds/' . $dtd;
ini_set('include_path', realpath('..') . ":$path");
$formElements = array();
$formElements[0] = 'select';
$formElements[1] = 'option';
$formElements[2] = 'textarea';
$formElements[3] = 'input';
$typeRulesArray = array(":- multifile attributetype/3.\n\n");
for($index=0; $index<sizeof($formElements); $index++){
$typeRule = dtd::findAttributes($formElements[$index],$dtd);
$typeRulesArray = array_merge($typeRulesArray ,$typeRule->toArray() );
}
for($index=0; $index < sizeof($typeRulesArray); $index++){
echo "$typeRulesArray[$index]<br>";
}
writer::write('typedefinitions.pl','cgi-bin/htmlTyping/',$typeRulesArray);
}
?>