File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed
xmpbox/src/main/java/org/apache/xmpbox/xml Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -232,18 +232,13 @@ else if (attr.getPrefix() == null && XmpConstants.ABOUT_NAME.equals(attr.getLoca
232232 else if (XMLConstants .XMLNS_ATTRIBUTE .equals (attr .getPrefix ()))
233233 {
234234 String namespace = attr .getValue ();
235- if (!strictParsing && !tm .isStructuredTypeNamespace (namespace ))
235+ if (!strictParsing && !tm .isStructuredTypeNamespace (namespace ) &&
236+ xmp .getSchema (namespace ) == null && tm .getSchemaFactory (namespace ) == null )
236237 {
237238 // PDFBOX-5128: Add the schema on the fly if it can't be found
238239 // PDFBOX-5649: But only if the namespace isn't already known
239240 // because this adds a namespace without property descriptions
240- String prefix = attr .getLocalName ();
241-
242- XMPSchema schema = xmp .getSchema (namespace );
243- if (schema == null && tm .getSchemaFactory (namespace ) == null )
244- {
245- tm .addNewNameSpace (namespace , prefix );
246- }
241+ tm .addNewNameSpace (namespace , attr .getLocalName ());
247242 }
248243 }
249244 else
You can’t perform that action at this time.
0 commit comments