pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1681594 - /pdfbox/branches/1.8/xmpbox/src/main/java/org/apache/xmpbox/xml/PdfaExtensionHelper.java
Date Mon, 25 May 2015 15:20:18 GMT
Author: tilman
Date: Mon May 25 15:20:17 2015
New Revision: 1681594

URL: http://svn.apache.org/r1681594
Log:
PDFBOX-1642: apply trunk changes from rev 1546743 and 1546750 to 1.8 branch

Modified:
    pdfbox/branches/1.8/xmpbox/src/main/java/org/apache/xmpbox/xml/PdfaExtensionHelper.java

Modified: pdfbox/branches/1.8/xmpbox/src/main/java/org/apache/xmpbox/xml/PdfaExtensionHelper.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/1.8/xmpbox/src/main/java/org/apache/xmpbox/xml/PdfaExtensionHelper.java?rev=1681594&r1=1681593&r2=1681594&view=diff
==============================================================================
--- pdfbox/branches/1.8/xmpbox/src/main/java/org/apache/xmpbox/xml/PdfaExtensionHelper.java
(original)
+++ pdfbox/branches/1.8/xmpbox/src/main/java/org/apache/xmpbox/xml/PdfaExtensionHelper.java
Mon May 25 15:20:17 2015
@@ -49,6 +49,9 @@ import org.w3c.dom.NamedNodeMap;
 
 public final class PdfaExtensionHelper
 {
+    public static final String CLOSED_CHOICE = "closed Choice of ";
+
+    public static final String OPEN_CHOICE = "open Choice of ";
 
     private PdfaExtensionHelper()
     {
@@ -112,7 +115,7 @@ public final class PdfaExtensionHelper
                     if (af instanceof PDFASchemaType)
                     {
                         PDFASchemaType st = (PDFASchemaType) af;
-                        String namespaceUri = st.getNamespaceURI();
+                        String namespaceUri = st.getNamespaceURI().trim();
                         String prefix = st.getPrefixValue();
                         ArrayProperty properties = st.getProperty();
                         ArrayProperty valueTypes = st.getValueType();
@@ -245,6 +248,14 @@ public final class PdfaExtensionHelper
             return TypeMapping.createPropertyType(Types.LangAlt, Cardinality.Simple);
         }
         // else all other cases
+        if (valueType.startsWith(CLOSED_CHOICE))
+        {
+            valueType = valueType.substring(CLOSED_CHOICE.length());
+        }
+        else if (valueType.startsWith(OPEN_CHOICE))
+        {
+            valueType = valueType.substring(OPEN_CHOICE.length());
+        }
         int pos = valueType.indexOf(' ');
         Cardinality card = Cardinality.Simple;
         if (pos > 0)



Mime
View raw message