-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathxsl.php
More file actions
106 lines (85 loc) · 2.55 KB
/
xsl.php
File metadata and controls
106 lines (85 loc) · 2.55 KB
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<?php
/*----------------------------------------------------------------------------*/
require_once BITTER_LANGUAGE_PATH . '/xml.php';
/*------------------------------------------------------------------------------
Attributes
------------------------------------------------------------------------------*/
Bitter::rule(
Bitter::id('xsl-attribute'),
Bitter::capture('(match|select|test)(\s*=\s*)?(".*?"|\'.*?\')?', 'is'),
Bitter::id('xml-attribute-key'),
Bitter::rule(
Bitter::id('xsl-attribute-value-single'),
Bitter::tag('value xpath'),
Bitter::capture("'.*?'$", 's'),
Bitter::id('xml-entity')
),
Bitter::rule(
Bitter::id('xsl-attribute-value-double'),
Bitter::tag('value xpath'),
Bitter::capture('".*?"$', 's'),
Bitter::id('xml-entity')
),
Bitter::id('xml-attribute-error')
);
Bitter::rule(
Bitter::id('xsl-xpath'),
Bitter::tag('xpath'),
Bitter::capture('\{.*?\}|\$[a-z][a-z0-9_\-]*')
);
Bitter::rule(
Bitter::id('xml-attribute-value-single'),
Bitter::tag('value'),
Bitter::capture("'.*?'$"),
Bitter::id('xml-entity'),
Bitter::id('xsl-xpath')
);
Bitter::rule(
Bitter::id('xml-attribute-value-double'),
Bitter::tag('value'),
Bitter::capture('".*?"$'),
Bitter::id('xml-entity'),
Bitter::id('xsl-xpath')
);
/*------------------------------------------------------------------------------
Tags
------------------------------------------------------------------------------*/
Bitter::rule(
Bitter::id('xsl-tag-open'),
Bitter::capture('<[a-z][a-z0-9_\-\:]*(([^>]+)?)>', 'i'),
Bitter::tag('tag open'),
Bitter::rule(
Bitter::id('xsl-tag-open-begin'),
Bitter::capture('^<[a-z][a-z0-9_\-\:]*', 'i'),
Bitter::tag('begin')
),
Bitter::rule(
Bitter::id('xsl-tag-open-end'),
Bitter::capture('/>|>$'),
Bitter::tag('end')
),
Bitter::id('xsl-attribute'),
Bitter::id('xml-attribute')
);
/*------------------------------------------------------------------------------
Main
------------------------------------------------------------------------------*/
Bitter::rule(
Bitter::id('xsl-include'),
Bitter::tag('context-markup xml xsl'),
Bitter::capture('.+', 's'),
Bitter::id('xml-text'),
Bitter::id('xml-entity'),
Bitter::id('xml-doctype'),
Bitter::id('xml-comment'),
Bitter::id('xml-cdata'),
Bitter::id('xml-declaration'),
Bitter::id('xml-tag-close'),
Bitter::id('xsl-tag-open')
);
Bitter::rule(
Bitter::id('xsl'),
Bitter::id('xsl-include')
);
/*----------------------------------------------------------------------------*/
?>