pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gbaill...@apache.org
Subject svn commit: r1549032 - /pdfbox/trunk/xmpbox/src/main/java/org/apache/xmpbox/xml/XmpSerializer.java
Date Sun, 08 Dec 2013 14:45:18 GMT
Author: gbailleul
Date: Sun Dec  8 14:45:17 2013
New Revision: 1549032

URL: http://svn.apache.org/r1549032
Log:
PDFBOX-1801:
* fixed serialization

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=1549032&r1=1549031&r2=1549032&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 Sun Dec  8
14:45:17 2013
@@ -95,12 +95,12 @@ public class XmpSerializer
         fillElementWithAttributes(selem, schema);
         // the content
         List<AbstractField> fields = schema.getAllProperties();
-        serializeFields(doc, selem, fields, true);
+        serializeFields(doc, selem, fields,schema.getPrefix(), true);
         // return created schema
         return selem;
     }
 
-    public void serializeFields(Document doc, Element parent, List<AbstractField> fields,
boolean wrapWithProperty)
+    public void serializeFields(Document doc, Element parent, List<AbstractField> fields,
String resourceNS, boolean wrapWithProperty)
     {
         for (AbstractField field : fields)
         {
@@ -125,7 +125,7 @@ public class XmpSerializer
                 asimple.appendChild(econtainer);
                 // for each element of the array
                 List<AbstractField> innerFields = array.getAllProperties();
-                serializeFields(doc, econtainer, innerFields, false);
+                serializeFields(doc, econtainer, innerFields,resourceNS, false);
             }
             else if (field instanceof AbstractStructuredType)
             {
@@ -136,7 +136,7 @@ public class XmpSerializer
                 if (wrapWithProperty)
                 {
                     Element nstructured = doc
-                            .createElement(structured.getPrefix() + ":" + structured.getPropertyName());
+                            .createElement(resourceNS + ":" + structured.getPropertyName());
                     parent.appendChild(nstructured);
                     listParent = nstructured;
                 }
@@ -148,7 +148,7 @@ public class XmpSerializer
                 {
                     estructured.setAttribute("rdf:parseType", "Resource");
                     // all properties
-                    serializeFields(doc, estructured, innerFields, true);
+                    serializeFields(doc, estructured, innerFields,resourceNS, true);
                 }
                 else
                 {
@@ -156,7 +156,7 @@ public class XmpSerializer
                     Element econtainer = doc.createElement(XmpConstants.DEFAULT_RDF_PREFIX
+ ":" + "Description");
                     estructured.appendChild(econtainer);
                     // all properties
-                    serializeFields(doc, econtainer, innerFields, true);
+                    serializeFields(doc, econtainer, innerFields,resourceNS, true);
                 }
             }
             else



Mime
View raw message