document.xml.rels adding extra target information
Status: Beta
Brought to you by:
neodante
After editing the core document and saving the file with Package save, the document.xml.rels is updating the Target node with extraneous information This is only when the TargetMode has a value of "External" . If the TargetMode="External" and Target="mypdf.pdf" for example after a save the docx will have "null://mypdf.pdf" as the new Target value. After a second same the Target value is "null://"
I've got the same problems. The bug is located in the method
org.openxml4j.opc.internal.marshallers.ZipPartMarshaller.marshallRelationshipPart(PackageRelationshipCollection rels, PackagePartName relPartName, ZipOutputStream zos):
targetValue = (new StringBuilder()).append(uri.getScheme()).append("://").append(uri.getPath()).toString();
On the one hand I think somthing like uri.getHost() and uri.getPort() is missing.
On the other hand this implementation would not work with the PDF file example above or URIs like "mailto:someone@anywhere.org"