-
Notifications
You must be signed in to change notification settings - Fork 193
/
Copy pathresolve-entities.xspec
78 lines (75 loc) · 2.58 KB
/
resolve-entities.xspec
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
<?xml version="1.0" encoding="UTF-8"?>
<x:description xmlns:x="http://www.jenitennison.com/xslt/xspec"
stylesheet="resolve-entities3.xsl"
xmlns="http://csrc.nist.gov/ns/oscal/metaschema/1.0">
<x:scenario label="Everything copies:">
<x:scenario label="A bare metaschema">
<x:context>
<METASCHEMA/>
</x:context>
<x:expect label="copies" select="$x:context"/>
</x:scenario>
<x:scenario label="With random PIs">
<x:context>
<?xml-stylesheet href="some.css"?>
<METASCHEMA>
<title>A test</title>
<?random?>
</METASCHEMA>
</x:context>
<x:expect label="copies" select="$x:context"/>
</x:scenario>
<x:scenario label="A comment" pending="dev"/>
</x:scenario>
<x:scenario label="import/@href is modified:">
<x:scenario label="providing a suffix to the base name">
<x:context>
<METASCHEMA>
<import href="some.other.metaschema.xml"/>
</METASCHEMA>
</x:context>
<x:expect label="copies with @href modified">
<METASCHEMA>
<import href="some.other.metaschema_RESOLVED.xml"/>
</METASCHEMA>
</x:expect>
</x:scenario>
<x:scenario label="even when the suffix is not 'xml'">
<x:context>
<METASCHEMA>
<import href="some.other.metaschema"/>
</METASCHEMA>
</x:context>
<x:expect label="copies with @href modified">
<METASCHEMA>
<import href="some.other_RESOLVED.metaschema"/>
</METASCHEMA>
</x:expect>
</x:scenario>
<x:scenario label="or it is missing entirely">
<x:context>
<METASCHEMA>
<import href="some_metaschema"/>
</METASCHEMA>
</x:context>
<x:expect label="copies with @href modified">
<METASCHEMA>
<import href="some_metaschema_RESOLVED"/>
</METASCHEMA>
</x:expect>
</x:scenario>
<x:scenario label="providing a suffix to the base name">
<x:context>
<x:param name="splice">_NEW</x:param>
<METASCHEMA>
<import href="some.other.metaschema.xml"/>
</METASCHEMA>
</x:context>
<x:expect label="copies with @href modified">
<METASCHEMA>
<import href="some.other.metaschema_NEW.xml"/>
</METASCHEMA>
</x:expect>
</x:scenario>
</x:scenario>
</x:description>