1212import com .adobe .epubcheck .util .EpubConstants ;
1313import com .adobe .epubcheck .util .HandlerUtil ;
1414import com .adobe .epubcheck .util .PathUtil ;
15+ import com .adobe .epubcheck .vocab .Property ;
16+ import com .adobe .epubcheck .vocab .AggregateVocab ;
1517import com .adobe .epubcheck .vocab .StructureVocab ;
1618import com .adobe .epubcheck .vocab .Vocab ;
1719import com .adobe .epubcheck .vocab .VocabUtil ;
@@ -25,10 +27,10 @@ public class OverlayHandler implements XMLHandler
2527{
2628
2729 private static Map <String , Vocab > RESERVED_VOCABS = ImmutableMap .<String , Vocab > of ("" ,
28- StructureVocab .VOCAB );
30+ AggregateVocab . of ( StructureVocab .VOCAB , StructureVocab . UNCHECKED_VOCAB ) );
2931 private static Map <String , Vocab > KNOWN_VOCAB_URIS = ImmutableMap .of ();
3032 private static Set <String > DEFAULT_VOCAB_URIS = ImmutableSet .of (StructureVocab .URI );
31-
33+
3234 private final ValidationContext context ;
3335 private final String path ;
3436 private final Report report ;
@@ -85,8 +87,20 @@ else if (name.equals("body") || name.equals("par"))
8587
8688 private void checkType (String type )
8789 {
88- VocabUtil .parsePropertyList (type , vocabs , context ,
90+ Set < Property > propList = VocabUtil .parsePropertyList (type , vocabs , context ,
8991 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+ }
90104 }
91105
92106 private void processSrc (XMLElement e )
0 commit comments