12
12
import com .adobe .epubcheck .util .EpubConstants ;
13
13
import com .adobe .epubcheck .util .HandlerUtil ;
14
14
import com .adobe .epubcheck .util .PathUtil ;
15
+ import com .adobe .epubcheck .vocab .Property ;
16
+ import com .adobe .epubcheck .vocab .AggregateVocab ;
15
17
import com .adobe .epubcheck .vocab .StructureVocab ;
16
18
import com .adobe .epubcheck .vocab .Vocab ;
17
19
import com .adobe .epubcheck .vocab .VocabUtil ;
@@ -25,10 +27,10 @@ public class OverlayHandler implements XMLHandler
25
27
{
26
28
27
29
private static Map <String , Vocab > RESERVED_VOCABS = ImmutableMap .<String , Vocab > of ("" ,
28
- StructureVocab .VOCAB );
30
+ AggregateVocab . of ( StructureVocab .VOCAB , StructureVocab . UNCHECKED_VOCAB ) );
29
31
private static Map <String , Vocab > KNOWN_VOCAB_URIS = ImmutableMap .of ();
30
32
private static Set <String > DEFAULT_VOCAB_URIS = ImmutableSet .of (StructureVocab .URI );
31
-
33
+
32
34
private final ValidationContext context ;
33
35
private final String path ;
34
36
private final Report report ;
@@ -85,8 +87,20 @@ else if (name.equals("body") || name.equals("par"))
85
87
86
88
private void checkType (String type )
87
89
{
88
- VocabUtil .parsePropertyList (type , vocabs , context ,
90
+ Set < Property > propList = VocabUtil .parsePropertyList (type , vocabs , context ,
89
91
EPUBLocation .create (path , parser .getLineNumber (), parser .getColumnNumber ()));
92
+
93
+ // Check unrecognized properties from the structure vocab
94
+ for (Property property : propList )
95
+ {
96
+ if (StructureVocab .URI .equals (property .getVocabURI ())) try
97
+ {
98
+ property .toEnum ();
99
+ } catch (UnsupportedOperationException ex )
100
+ {
101
+ report .message (MessageId .OPF_088 , parser .getLocation (), property .getName ());
102
+ }
103
+ }
90
104
}
91
105
92
106
private void processSrc (XMLElement e )
0 commit comments