@@ -619,6 +619,31 @@ void testBadType() throws XmpParsingException
619619 assertEquals ("[Author=TextType:edocslib]" , tt .toString ());
620620 }
621621
622+ @ Test
623+ void testBadType2 () throws XmpParsingException , BadFieldValueException
624+ {
625+ String s = "<?xml version=\" 1.0\" encoding=\" UTF-8\" standalone=\" no\" ?>\n " +
626+ "<?xpacket begin=\" \" id=\" W5M0MpCehiHzreSzNTczkc9d\" ?>\n " +
627+ "<x:xmpmeta xmlns:x=\" adobe:ns:meta/\" \n " +
628+ " x:xmptk=\" 3.1.1-111\" >\n " +
629+ " <rdf:RDF xmlns:rdf=\" http://www.w3.org/1999/02/22-rdf-syntax-ns#\" >\n " +
630+ " <rdf:Description xmlns:pdf=\" http://ns.adobe.com/pdf/1.3/\" \n " +
631+ " rdf:about=\" \" >\n " +
632+ " <pdf:Bad>Value</pdf:Bad>\n " +
633+ " </rdf:Description>\n " +
634+ " </rdf:RDF>\n " +
635+ "</x:xmpmeta><?xpacket end=\" r\" ?>" ;
636+ final DomXmpParser xmpParser1 = new DomXmpParser ();
637+ XmpParsingException ex = assertThrows (
638+ XmpParsingException .class ,
639+ () -> xmpParser1 .parse (s .getBytes (StandardCharsets .UTF_8 )));
640+ assertEquals ("No type defined for {http://ns.adobe.com/pdf/1.3/}Bad" , ex .getMessage ());
641+ final DomXmpParser xmpParser2 = new DomXmpParser ();
642+ xmpParser2 .setStrictParsing (false );
643+ XMPMetadata xmp = xmpParser2 .parse (s .getBytes (StandardCharsets .UTF_8 ));
644+ assertEquals ("Value" , xmp .getAdobePDFSchema ().getUnqualifiedTextPropertyValue ("Bad" ));
645+ }
646+
622647 @ Test
623648 void testBadLocalName () throws XmpParsingException
624649 {
0 commit comments