You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2026/01/01 14:03:26 UTC

svn commit: r1931036 - pdfbox/branches/2.0/xmpbox/src/main/java/org/apache/xmpbox/xml

Author: tilman
Date: Thu Jan  1 14:03:26 2026
New Revision: 1931036

Log:
PDFBOX-5660: refactor

Modified:
   pdfbox/branches/2.0/xmpbox/src/main/java/org/apache/xmpbox/xml/DomXmpParser.java

Modified: pdfbox/branches/2.0/xmpbox/src/main/java/org/apache/xmpbox/xml/DomXmpParser.java
==============================================================================
--- pdfbox/branches/2.0/xmpbox/src/main/java/org/apache/xmpbox/xml/DomXmpParser.java	Thu Jan  1 14:03:21 2026	(r1931035)
+++ pdfbox/branches/2.0/xmpbox/src/main/java/org/apache/xmpbox/xml/DomXmpParser.java	Thu Jan  1 14:03:26 2026	(r1931036)
@@ -663,30 +663,27 @@ public class DomXmpParser
             loadAttributes(af, liElement);
             return af;
         }
+        // PDFBOX-4325: assume it is structured
+        AbstractStructuredType af;
+        try
+        {
+            af = tm.instanciateStructuredType(type, descriptor.getLocalPart());
+        }
+        catch (BadFieldValueException ex)
+        {
+            throw new XmpParsingException(ErrorType.InvalidType, "Parsing of structured type failed", ex);
+        }
+        loadAttributes(af, liElement);
+        PropertiesDescription pm;
+        if (type.isStructured())
+        {
+            pm = tm.getStructuredPropMapping(type);
+        }
         else
         {
-            // PDFBOX-4325: assume it is structured
-            AbstractStructuredType af;
-            try
-            {
-                af = tm.instanciateStructuredType(type, descriptor.getLocalPart());
-            }
-            catch (BadFieldValueException ex)
-            {
-                throw new XmpParsingException(ErrorType.InvalidType, "Parsing of structured type failed", ex);
-            }
-            loadAttributes(af, liElement);
-            PropertiesDescription pm;
-            if (type.isStructured())
-            {
-                pm = tm.getStructuredPropMapping(type);
-            }
-            else
-            {
-                pm = tm.getDefinedDescriptionByNamespace(liElement.getNamespaceURI(), liElement.getLocalName());
-            }
-            return tryParseAttributesAsProperties(tm, liElement, af, pm, null);
+            pm = tm.getDefinedDescriptionByNamespace(liElement.getNamespaceURI(), liElement.getLocalName());
         }
+        return tryParseAttributesAsProperties(tm, liElement, af, pm, null);
     }
 
     private void loadAttributes(AbstractField sp, Element element)