File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed
Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 221221 <rng : optional condition =" $IsPDFA4OrGreater" >
222222 <rng : ref name =" xmpDM.takeNumber" />
223223 </rng : optional >
224- <rng : optional condition =" $IsPDFA4OrGreater" >
225- <rng : ref name =" xmpDM.videoFrameRate" />
226- </rng : optional >
227224 <rng : optional condition =" $IsPDFA4OrGreater" >
228225 <rng : ref name =" xmpDM.partOfCompilation" />
229226 </rng : optional >
Original file line number Diff line number Diff line change @@ -173,6 +173,7 @@ static void validateSchema(XElement root)
173173 // Find main <rng:interleave> element
174174 var interleave = root . Descendants ( RngNs + "interleave" ) . First ( ) ;
175175 var refs = interleave . Descendants ( RngNs + "ref" ) . ToList ( ) ;
176+ HashSet < string > properties = new HashSet < string > ( ) ;
176177 foreach ( var reference in refs )
177178 {
178179 var name = reference . Attribute ( "name" ) ! . Value ! ;
@@ -182,8 +183,13 @@ static void validateSchema(XElement root)
182183 {
183184 // Ensure the second level interleave elements
184185 // are <rng:optional> elements with a single child
185- if ( child . Name . LocalName != "optional" || child . Elements ( ) . Count ( ) != 1 )
186+ List < XElement > children ;
187+ if ( child . Name . LocalName != "optional" || ( children = child . Elements ( ) . ToList ( ) ) . Count != 1 )
186188 throw new Exception ( "Invalid interleaved element" ) ;
189+
190+ var propName = children [ 0 ] . Attribute ( "name" ) ! . Value ! ;
191+ if ( ! properties . Add ( children [ 0 ] . Attribute ( "name" ) ! . Value ! ) )
192+ throw new Exception ( $ "Repeated property \" { propName } \" ") ;
187193 }
188194 }
189195 }
You can’t perform that action at this time.
0 commit comments