@@ -700,7 +700,7 @@ private AbstractField parseLiElement(XMPMetadata xmp, QName descriptor, Element
700700 else
701701 {
702702 // PDFBOX-4325: assume it is structured
703- AbstractField af ;
703+ AbstractStructuredType af ;
704704 try
705705 {
706706 af = tm .instanciateStructuredType (type , descriptor .getLocalPart ());
@@ -710,20 +710,16 @@ private AbstractField parseLiElement(XMPMetadata xmp, QName descriptor, Element
710710 throw new XmpParsingException (ErrorType .InvalidType , "Parsing of structured type failed" , ex );
711711 }
712712 loadAttributes (af , liElement );
713- if (af instanceof AbstractStructuredType )
713+ PropertiesDescription pm ;
714+ if (type .isStructured ())
714715 {
715- PropertiesDescription pm ;
716- if (type .isStructured ())
717- {
718- pm = tm .getStructuredPropMapping (type );
719- }
720- else
721- {
722- pm = tm .getDefinedDescriptionByNamespace (liElement .getNamespaceURI (), liElement .getLocalName ());
723- }
724- af = tryParseAttributesAsProperties (tm , liElement , (AbstractStructuredType ) af , pm , null );
716+ pm = tm .getStructuredPropMapping (type );
725717 }
726- return af ;
718+ else
719+ {
720+ pm = tm .getDefinedDescriptionByNamespace (liElement .getNamespaceURI (), liElement .getLocalName ());
721+ }
722+ return tryParseAttributesAsProperties (tm , liElement , af , pm , null );
727723 }
728724 }
729725
0 commit comments