@@ -695,30 +695,27 @@ private AbstractField parseLiElement(XMPMetadata xmp, QName descriptor, Element
695695 loadAttributes (af , liElement );
696696 return af ;
697697 }
698+ // PDFBOX-4325: assume it is structured
699+ AbstractStructuredType af ;
700+ try
701+ {
702+ af = tm .instanciateStructuredType (type , descriptor .getLocalPart ());
703+ }
704+ catch (BadFieldValueException ex )
705+ {
706+ throw new XmpParsingException (ErrorType .InvalidType , "Parsing of structured type failed" , ex );
707+ }
708+ loadAttributes (af , liElement );
709+ PropertiesDescription pm ;
710+ if (type .isStructured ())
711+ {
712+ pm = tm .getStructuredPropMapping (type );
713+ }
698714 else
699715 {
700- // PDFBOX-4325: assume it is structured
701- AbstractStructuredType af ;
702- try
703- {
704- af = tm .instanciateStructuredType (type , descriptor .getLocalPart ());
705- }
706- catch (BadFieldValueException ex )
707- {
708- throw new XmpParsingException (ErrorType .InvalidType , "Parsing of structured type failed" , ex );
709- }
710- loadAttributes (af , liElement );
711- PropertiesDescription pm ;
712- if (type .isStructured ())
713- {
714- pm = tm .getStructuredPropMapping (type );
715- }
716- else
717- {
718- pm = tm .getDefinedDescriptionByNamespace (liElement .getNamespaceURI (), liElement .getLocalName ());
719- }
720- return tryParseAttributesAsProperties (tm , liElement , af , pm , null );
716+ pm = tm .getDefinedDescriptionByNamespace (liElement .getNamespaceURI (), liElement .getLocalName ());
721717 }
718+ return tryParseAttributesAsProperties (tm , liElement , af , pm , null );
722719 }
723720
724721 private void loadAttributes (AbstractField sp , Element element )
0 commit comments