Skip to content

Commit

Permalink
optimizing
Browse files Browse the repository at this point in the history
Issue imixs#212
  • Loading branch information
rsoika committed Mar 11, 2023
1 parent 0921741 commit a6de4b9
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public static String cleanCDATAWhiteSpace(String xml) {
if (pos > backwardTagPos - 1) {
xml = xml.substring(0, backwardTagPos + 1) + xml.substring(pos);
}
lastPos = pos + 1;
lastPos = backwardTagPos + 9;
/**
* next search for
* CDATA end ']]>'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,31 @@ public class TestCleanCDATA {
@Test
public void testSimple() {

String xml = "<imixs:value> \n <![CDATA[ some data ]]>\n </imixs:value>";
String xml = "<imixs:value>\n<![CDATA[ some data ]]>\n</imixs:value>";

System.out.println(xml);
String result = BPMNXMLUtil.cleanCDATAWhiteSpace(xml);

System.out.println(result);

}

@Test
public void testNoneWhitespace() {

String xml = "<imixs:value><![CDATA[ some data ]]></imixs:value>";

System.out.println(xml);
String result = BPMNXMLUtil.cleanCDATAWhiteSpace(xml);

System.out.println(result);

}

@Test
public void testMoreWhitespace() {

String xml = "<imixs:value> \n <![CDATA[ some data ]]>\n </imixs:value>";

System.out.println(xml);
String result = BPMNXMLUtil.cleanCDATAWhiteSpace(xml);
Expand Down

0 comments on commit a6de4b9

Please sign in to comment.