Skip to content

Commit cd6389b

Browse files
committed
PDFBOX-6125: default to text in lenient mode
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1930664 13f79535-47bb-0310-9956-ffa450edef68
1 parent 36abf2a commit cd6389b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

xmpbox/src/main/java/org/apache/xmpbox/xml/DomXmpParser.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,13 @@ private void manageArray(XMPMetadata xmp, Element property, PropertyType type, C
544544
{
545545
whatFound = firstChild instanceof Text ? "Text" : firstChild.getClass().getName();
546546
}
547+
if (!strictParsing && firstChild instanceof Text)
548+
{
549+
// Default to text in lenient mode
550+
// Improvement idea in the future: create an array and add the text item.
551+
manageSimpleType(xmp, property, Types.Text, container);
552+
return;
553+
}
547554
throw new XmpParsingException(ErrorType.Format, "Invalid array definition, expecting " + type.card()
548555
+ " and found "
549556
+ whatFound

0 commit comments

Comments
 (0)