Skip to content
This repository was archived by the owner on Nov 9, 2020. It is now read-only.

fix(ooxml): regexp does not replace the whole tag in every case #28

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -9,7 +9,6 @@
import java.io.OutputStream;
import java.nio.charset.StandardCharsets;

import org.apache.poi.openxml4j.exceptions.InvalidOperationException;
import org.apache.poi.openxml4j.opc.PackagePart;
import org.apache.poi.openxml4j.opc.ZipPackagePart;
import org.slf4j.Logger;
@@ -30,8 +29,8 @@ public class OOXMLTagHelper {
private static final String XML_EXTENSION = "xml";
private static final String XML_COMMENT_BLEACHED = "<!-- bleached -->";
private static final String TAG_EXTERNAL_DATA = "externalData";
/** The regexp try to catch the whole tag, including namespace and attributes */
private static final String REGEXP_EXTERNAL_DATA = "<.." + TAG_EXTERNAL_DATA + ".*?/>";
/** The regexp tries to catch the whole tag, including namespace and attributes (<n:externalData ...>...</n:externalData>) */
private static final String REGEXP_EXTERNAL_DATA = "<.." + TAG_EXTERNAL_DATA + "(.*</.." + TAG_EXTERNAL_DATA + ">|.*?/>)";

private OOXMLTagHelper() {
}