]> source.dussan.org Git - poi.git/commitdiff
Fix bug 57162: Content_types.xml and .rels files had elements with wrong namespace...
authorUwe Schindler <uschindler@apache.org>
Sun, 2 Nov 2014 20:53:02 +0000 (20:53 +0000)
committerUwe Schindler <uschindler@apache.org>
Sun, 2 Nov 2014 20:53:02 +0000 (20:53 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1636188 13f79535-47bb-0310-9956-ffa450edef68

src/ooxml/java/org/apache/poi/openxml4j/opc/internal/ContentTypeManager.java
src/ooxml/java/org/apache/poi/openxml4j/opc/internal/marshallers/ZipPartMarshaller.java

index 59801d3aeeb2cde37634c0118c77bd7d50367360..d03a40ba02fcd93dce6201e55973aa053ee696a6 100644 (file)
@@ -444,7 +444,7 @@ public abstract class ContentTypeManager {
         */
        private void appendSpecificTypes(Element root,
                        Entry<PackagePartName, String> entry) {
-        Element specificType = root.getOwnerDocument().createElement(OVERRIDE_TAG_NAME);
+        Element specificType = root.getOwnerDocument().createElementNS(TYPES_NAMESPACE_URI, OVERRIDE_TAG_NAME);
         specificType.setAttribute(PART_NAME_ATTRIBUTE_NAME, entry.getKey().getName());
         specificType.setAttribute(CONTENT_TYPE_ATTRIBUTE_NAME, entry.getValue());
         root.appendChild(specificType);
@@ -460,7 +460,7 @@ public abstract class ContentTypeManager {
         * @see #save(java.io.OutputStream)
         */
        private void appendDefaultType(Element root, Entry<String, String> entry) {
-        Element defaultType = root.getOwnerDocument().createElement(DEFAULT_TAG_NAME);
+        Element defaultType = root.getOwnerDocument().createElementNS(TYPES_NAMESPACE_URI, DEFAULT_TAG_NAME);
         defaultType.setAttribute(EXTENSION_ATTRIBUTE_NAME, entry.getKey());
         defaultType.setAttribute(CONTENT_TYPE_ATTRIBUTE_NAME, entry.getValue());
         root.appendChild(defaultType);
index 37a538dc26796f43c70c68fd9a473d183386fef7..296f7a6c67a507ce90287e9663c1f1078b80536b 100644 (file)
@@ -36,8 +36,8 @@ import org.apache.poi.openxml4j.opc.TargetMode;
 import org.apache.poi.openxml4j.opc.internal.PartMarshaller;
 import org.apache.poi.openxml4j.opc.internal.ZipHelper;
 import org.apache.poi.util.DocumentHelper;
-import org.apache.poi.util.POILogger;
 import org.apache.poi.util.POILogFactory;
+import org.apache.poi.util.POILogger;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
@@ -134,7 +134,7 @@ public final class ZipPartMarshaller implements PartMarshaller {
 
                for (PackageRelationship rel : rels) {
                        // the relationship element
-            Element relElem = xmlOutDoc.createElement(PackageRelationship.RELATIONSHIP_TAG_NAME);
+            Element relElem = xmlOutDoc.createElementNS(PackageNamespaces.RELATIONSHIPS, PackageRelationship.RELATIONSHIP_TAG_NAME);
             root.appendChild(relElem);
 
                        // the relationship ID