pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1752454 - /pdfbox/trunk/xmpbox/src/main/java/org/apache/xmpbox/xml/DomXmpParser.java
Date Wed, 13 Jul 2016 16:44:50 GMT
Author: tilman
Date: Wed Jul 13 16:44:50 2016
New Revision: 1752454

URL: http://svn.apache.org/viewvc?rev=1752454&view=rev
Log:
PDFBOX-3419: pass type to parseLiElement from above instead of assuming text

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

Modified: pdfbox/trunk/xmpbox/src/main/java/org/apache/xmpbox/xml/DomXmpParser.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/xmpbox/src/main/java/org/apache/xmpbox/xml/DomXmpParser.java?rev=1752454&r1=1752453&r2=1752454&view=diff
==============================================================================
--- pdfbox/trunk/xmpbox/src/main/java/org/apache/xmpbox/xml/DomXmpParser.java (original)
+++ pdfbox/trunk/xmpbox/src/main/java/org/apache/xmpbox/xml/DomXmpParser.java Wed Jul 13 16:44:50
2016
@@ -461,7 +461,7 @@ public class DomXmpParser
         for (Element element : lis)
         {
             QName propertyQName = new QName(element.getLocalName());
-            AbstractField ast = parseLiElement(xmp, propertyQName, element);
+            AbstractField ast = parseLiElement(xmp, propertyQName, element, type.type());
             if (ast != null)
             {
                 array.addProperty(ast);
@@ -498,7 +498,7 @@ public class DomXmpParser
         }
     }
 
-    private AbstractField parseLiElement(XMPMetadata xmp, QName descriptor, Element liElement)
+    private AbstractField parseLiElement(XMPMetadata xmp, QName descriptor, Element liElement,
Types type)
             throws XmpParsingException
     {
         if (DomHelper.isParseTypeResource(liElement))
@@ -514,11 +514,11 @@ public class DomXmpParser
         }
         else
         {
-            // no child, so consider as simple text
+            // no child
             String text = liElement.getTextContent();
             TypeMapping tm = xmp.getTypeMapping();
             AbstractSimpleProperty sp = tm.instanciateSimpleProperty(descriptor.getNamespaceURI(),
-                    descriptor.getPrefix(), descriptor.getLocalPart(), text, Types.Text);
+                    descriptor.getPrefix(), descriptor.getLocalPart(), text, type);
             loadAttributes(sp, liElement);
             return sp;
         }
@@ -599,7 +599,7 @@ public class DomXmpParser
                 List<Element> lis = DomHelper.getElementChildren(bagOrSeq);
                 for (Element element2 : lis)
                 {
-                    AbstractField ast2 = parseLiElement(xmp, descriptor, element2);
+                    AbstractField ast2 = parseLiElement(xmp, descriptor, element2, type.type());
                     if (ast2 != null)
                     {
                         array.addProperty(ast2);



Mime
View raw message