(Node parent)
| 1200 | * CDSect? )* ETag ) | <TRANSLATION_ERROR> |
| 1201 | */ |
| 1202 | private void parseXMLTemplateText(Node parent) throws JasperException { |
| 1203 | reader.skipSpaces(); |
| 1204 | if (!reader.matches("/>")) { |
| 1205 | if (!reader.matches(">")) { |
| 1206 | err.jspError(start, "jsp.error.unterminated", "<jsp:text>"); |
| 1207 | } |
| 1208 | CharArrayWriter ttext = new CharArrayWriter(); |
| 1209 | int ch = reader.nextChar(); |
| 1210 | while (ch != -1) { |
| 1211 | if (ch == '<') { |
| 1212 | // Check for <![CDATA[ |
| 1213 | if (!reader.matches("![CDATA[")) { |
| 1214 | break; |
| 1215 | } |
| 1216 | start = reader.mark(); |
| 1217 | Mark stop = reader.skipUntil("]]>"); |
| 1218 | if (stop == null) { |
| 1219 | err.jspError(start, "jsp.error.unterminated", "CDATA"); |
| 1220 | } |
| 1221 | String text = reader.getText(start, stop); |
| 1222 | ttext.write(text, 0, text.length()); |
| 1223 | } else if (ch == '\\') { |
| 1224 | int next = reader.peekChar(0); |
| 1225 | if (next == '$' || next == '#') { |
| 1226 | ttext.write(reader.nextChar()); |
| 1227 | } else { |
| 1228 | ttext.write('\\'); |
| 1229 | } |
| 1230 | } else if (ch == '$' || ch == '#') { |
| 1231 | if (reader.peekChar(0) == '{') { |
| 1232 | // Swallow the '{' |
| 1233 | reader.nextChar(); |
| 1234 | |
| 1235 | // Create a template text node |
| 1236 | @SuppressWarnings("unused") |
| 1237 | Node unused = new Node.TemplateText(ttext.toString(), start, parent); |
| 1238 | |
| 1239 | // Mark and parse the EL expression and create its node: |
| 1240 | parseELExpression(parent, (char) ch); |
| 1241 | |
| 1242 | start = reader.mark(); |
| 1243 | ttext.reset(); |
| 1244 | } else { |
| 1245 | ttext.write(ch); |
| 1246 | } |
| 1247 | } else { |
| 1248 | ttext.write(ch); |
| 1249 | } |
| 1250 | ch = reader.nextChar(); |
| 1251 | } |
| 1252 | |
| 1253 | @SuppressWarnings("unused") |
| 1254 | Node unused = new Node.TemplateText(ttext.toString(), start, parent); |
| 1255 | |
| 1256 | if (!reader.hasMoreInput()) { |
| 1257 | err.jspError(start, "jsp.error.unterminated", "<jsp:text>"); |
| 1258 | } else if (!reader.matchesETagWithoutLessThan("jsp:text")) { |
| 1259 | err.jspError(start, "jsp.error.jsptext.badcontent"); |
no test coverage detected