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 2023/08/29 06:32:07 UTC

svn commit: r1911976 - /pdfbox/branches/3.0/xmpbox/src/main/java/org/apache/xmpbox/xml/DomXmpParser.java

Author: tilman
Date: Tue Aug 29 06:32:07 2023
New Revision: 1911976

URL: http://svn.apache.org/viewvc?rev=1911976&view=rev
Log:
PDFBOX-5649: add namespace only if it isn't already known

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

Modified: pdfbox/branches/3.0/xmpbox/src/main/java/org/apache/xmpbox/xml/DomXmpParser.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/3.0/xmpbox/src/main/java/org/apache/xmpbox/xml/DomXmpParser.java?rev=1911976&r1=1911975&r2=1911976&view=diff
==============================================================================
--- pdfbox/branches/3.0/xmpbox/src/main/java/org/apache/xmpbox/xml/DomXmpParser.java (original)
+++ pdfbox/branches/3.0/xmpbox/src/main/java/org/apache/xmpbox/xml/DomXmpParser.java Tue Aug 29 06:32:07 2023
@@ -227,12 +227,14 @@ public class DomXmpParser
                 }
                 else if (XMLConstants.XMLNS_ATTRIBUTE.equals(attr.getPrefix()))
                 {
-                    if (!strictParsing)
+                    String namespace = attr.getValue();
+                    if (!strictParsing && !tm.isStructuredTypeNamespace(namespace))
                     {
-                        // Add the schema on the fly if it can't be found
+                        // PDFBOX-5128: Add the schema on the fly if it can't be found
+                        // PDFBOX-5649: But only if the namespace isn't already known
+                        // because this adds a namespace without property descriptions
                         String prefix = attr.getLocalName();
-                        String namespace = attr.getValue();
-                        
+
                         XMPSchema schema = xmp.getSchema(namespace);
                         if (schema == null && tm.getSchemaFactory(namespace) == null)
                         {