@@ -1143,4 +1143,32 @@ void testBadRdfNameSpace() throws XmpParsingException
11431143 () -> xmpParser1 .parse (s .getBytes (StandardCharsets .UTF_8 )));
11441144 assertEquals ("Expecting namespace 'http://www.w3.org/1999/02/22-rdf-syntax-ns#' and found 'https://www.w3.org/1999/02/22-rdf-syntax-ns#'" , ex .getMessage ());
11451145 }
1146+
1147+ @ Test
1148+ void testTypeInLiResourceElement () throws XmpParsingException
1149+ {
1150+ // <rdf:li xmlns:stEvt="http://ns.adobe.com/xap/1.0/sType/ResourceEvent#" rdf:parseType="Resource"
1151+ String s = "<?xml version=\" 1.0\" encoding=\" UTF-8\" standalone=\" no\" ?>\n " +
1152+ "<?xpacket begin=\" \" id=\" W5M0MpCehiHzreSzNTczkc9d\" ?><x:xmpmeta xmlns:x=\" adobe:ns:meta/\" >\n " +
1153+ " <rdf:RDF xmlns:rdf=\" http://www.w3.org/1999/02/22-rdf-syntax-ns#\" >\n " +
1154+ " <rdf:Description xmlns:xmpMM=\" http://ns.adobe.com/xap/1.0/mm/\" rdf:about=\" \" >\n " +
1155+ " <xmpMM:History>\n " +
1156+ " <rdf:Seq>\n " +
1157+ " <rdf:li xmlns:stEvt=\" http://ns.adobe.com/xap/1.0/sType/ResourceEvent#\" rdf:parseType=\" Resource\" >\n " +
1158+ " <stEvt:action>created</stEvt:action>\n " +
1159+ " <stEvt:parameters>original PDF file</stEvt:parameters>\n " +
1160+ " </rdf:li>\n " +
1161+ " </rdf:Seq>\n " +
1162+ " </xmpMM:History>\n " +
1163+ " </rdf:Description>\n " +
1164+ " </rdf:RDF>\n " +
1165+ "</x:xmpmeta><?xpacket end=\" w\" ?>" ;
1166+ DomXmpParser xmpParser = new DomXmpParser ();
1167+ XMPMetadata xmp2 = xmpParser .parse (s .getBytes (StandardCharsets .UTF_8 ));
1168+ XMPMediaManagementSchema xmpMediaManagementSchema = xmp2 .getXMPMediaManagementSchema ();
1169+ ArrayProperty historyProperty = xmpMediaManagementSchema .getHistoryProperty ();
1170+ ResourceEventType firstHistoryEntry = (ResourceEventType ) historyProperty .getAllProperties ().iterator ().next ();
1171+ assertEquals ("created" , firstHistoryEntry .getAction ());
1172+ assertEquals ("original PDF file" , firstHistoryEntry .getParameters ());
1173+ }
11461174}
0 commit comments