private int validateTextSource(IDOMNode text) { try { SourceValidator validator = new SourceValidator(text); validator.validateSource(text.getSource()); } catch (InvalidCharacterException ex) { return ex.getOffset(); } return -1; }
/** */ public void setValueSource(String source) { if (!isDataEditable()) { throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String()); } SourceValidator validator = new SourceValidator(this); setTextSource(validator.convertSource(source)); }
if (acceptTag) { if (endTagName != null) { if (!matchEndTag(source, i + 1, endTagName)) continue; } else { int skip = skipTag(source, i + 1); if (skip >= 0) { i += skip; continue; if (acceptEntityRef) { int skip = skipEntityRef(source, i + 1); if (skip >= 0) { i += skip;
if (acceptTag) { if (endTagName != null) { if (!matchEndTag(source, i + 1, endTagName)) continue; } else { int skip = skipTag(source, i + 1); if (skip >= 0) { i += skip; if (endTagName != null) continue; int skip = skipEntityRef(source, i + 1); if (skip >= 0) { i += skip;
/** */ public void setSource(String source) throws InvalidCharacterException { if (!isDataEditable()) { throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, new String()); } SourceValidator validator = new SourceValidator(this); if (validator.validateSource(source)) setTextSource(source); }
/** */ public String generateAttrValue(Attr attr, char quote) { if (attr == null) return null; String name = attr.getName(); SourceValidator validator = new SourceValidator(attr); String value = validator.convertSource(((IDOMNode) attr).getValueSource()); if (value == null || value.length() == 0) { if (name != null && name.startsWith(JSPTag.TAG_OPEN)) return null; if (isBooleanAttr(attr)) { if (((AttrImpl) attr).isXMLAttr()) { // generate the name as value value = attr.getName(); } else { // not to generate '=' and value for HTML boolean return null; } } } return generateAttrValue(value, quote); }
TextImpl impl = (TextImpl) text; if (impl.isJSPContent() || impl.isCDATAContent()) { return new SourceValidator(impl).convertSource(data);