You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ms...@apache.org on 2015/07/21 09:58:41 UTC
svn commit: r1692060 -
/pdfbox/trunk/xmpbox/src/main/java/org/apache/xmpbox/xml/XmpSerializer.java
Author: msahyoun
Date: Tue Jul 21 07:58:41 2015
New Revision: 1692060
URL: http://svn.apache.org/r1692060
Log:
PDFBOX-2896: serialize attributes for simple properties
Modified:
pdfbox/trunk/xmpbox/src/main/java/org/apache/xmpbox/xml/XmpSerializer.java
Modified: pdfbox/trunk/xmpbox/src/main/java/org/apache/xmpbox/xml/XmpSerializer.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/xmpbox/src/main/java/org/apache/xmpbox/xml/XmpSerializer.java?rev=1692060&r1=1692059&r2=1692060&view=diff
==============================================================================
--- pdfbox/trunk/xmpbox/src/main/java/org/apache/xmpbox/xml/XmpSerializer.java (original)
+++ pdfbox/trunk/xmpbox/src/main/java/org/apache/xmpbox/xml/XmpSerializer.java Tue Jul 21 07:58:41 2015
@@ -110,6 +110,11 @@ public class XmpSerializer
AbstractSimpleProperty simple = (AbstractSimpleProperty) field;
Element esimple = doc.createElement(simple.getPrefix() + ":" + simple.getPropertyName());
esimple.setTextContent(simple.getStringValue());
+ List<Attribute> attributes = simple.getAllAttributes();
+ for (Attribute attribute : attributes)
+ {
+ esimple.setAttributeNS(attribute.getNamespace(), attribute.getName(), attribute.getValue());
+ }
parent.appendChild(esimple);
}
else if (field instanceof ArrayProperty)