Skip to content

Commit

Permalink
Merge branch 'master' into gh.core
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas Pelaia II committed Apr 12, 2016
2 parents 392e904 + be2c75f commit 18ea5c4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/xal/tools/xml/XmlWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public class XmlWriter {
static final Pattern LEFT_ANGLE_BRACKET_PATTERN;
static final Pattern QUOTE_PATTERN;
static final Pattern APOSTROPHE_PATTERN;
static final Pattern LINEBREAK_PATTERN;

Document document;
Writer writer;
Expand All @@ -43,6 +44,7 @@ public class XmlWriter {
LEFT_ANGLE_BRACKET_PATTERN = Pattern.compile("<");
QUOTE_PATTERN = Pattern.compile("\"");
APOSTROPHE_PATTERN = Pattern.compile("\'");
LINEBREAK_PATTERN = Pattern.compile("\n");
}


Expand Down Expand Up @@ -208,6 +210,7 @@ private String escapedValue(String value) {
escapedValue = LEFT_ANGLE_BRACKET_PATTERN.matcher(escapedValue).replaceAll("&lt;");
escapedValue = QUOTE_PATTERN.matcher(escapedValue).replaceAll("&quot;");
escapedValue = APOSTROPHE_PATTERN.matcher(escapedValue).replaceAll("&apos;");
escapedValue = LINEBREAK_PATTERN.matcher(escapedValue).replaceAll("&#x0A;");
return escapedValue;
}

Expand Down

0 comments on commit 18ea5c4

Please sign in to comment.