@Override protected void scanComment() throws IOException { final String s = nextContent(30); // [if ... if (s.startsWith("[if ") && s.contains("]>")) { final String condition = StringUtils.substringBefore(s.substring(4), "]>"); try { if (IEConditionalCommentExpressionEvaluator.evaluate(condition, browserVersion_)) { // skip until ">" for (int i = 0; i < condition.length() + 6; ++i) { read(); } return; } } catch (final Exception e) { // incorrect expression => handle it as plain text // TODO: report it! final XMLStringBuffer buffer = new XMLStringBuffer("<!--"); scanMarkupContent(buffer, '-'); buffer.append("-->"); fDocumentHandler.characters(buffer, locationAugs()); return; } } // this is a normal comment, not a conditional comment for IE super.scanComment(); } }
int beginColumnNumber = fBeginColumnNumber; int beginCharacterOffset = fBeginCharacterOffset; while (scanAttribute(fAttributes, empty)) { final int index2 = content.indexOf(';', index1); final String charset = index2 != -1 ? content.substring(index1+8, index2) : content.substring(index1+8); changeEncoding(charset);
final String next = nextContent(8) + " "; if (next.length() >= 8 && "/script".equalsIgnoreCase(next.substring(0, 7)) && ('>' == next.charAt(7) || Character.isWhitespace(next.charAt(7)))) {
attributes.setSpecified(attributes.getLength()-1, true); if (fAugmentations) { addLocationItem(attributes, attributes.getLength() - 1); attributes.setSpecified(attributes.getLength()-1, true); if (fAugmentations) { addLocationItem(attributes, attributes.getLength() - 1); attributes.setNonNormalizedValue(lastattr, fNonNormAttr.toString()); if (fAugmentations) { addLocationItem(attributes, attributes.getLength() - 1); attributes.setNonNormalizedValue(lastattr, fNonNormAttr.toString()); if (fAugmentations) { addLocationItem(attributes, attributes.getLength() - 1); fCurrentEntity.columnNumber--; if (fAugmentations) { addLocationItem(attributes, attributes.getLength() - 1);
attributes.setSpecified(attributes.getLength()-1, true); if (fAugmentations) { addLocationItem(attributes, attributes.getLength() - 1); attributes.setSpecified(attributes.getLength()-1, true); if (fAugmentations) { addLocationItem(attributes, attributes.getLength() - 1); attributes.setNonNormalizedValue(lastattr, fNonNormAttr.toString()); if (fAugmentations) { addLocationItem(attributes, attributes.getLength() - 1); attributes.setNonNormalizedValue(lastattr, fNonNormAttr.toString()); if (fAugmentations) { addLocationItem(attributes, attributes.getLength() - 1); fCurrentEntity.rewind(); if (fAugmentations) { addLocationItem(attributes, attributes.getLength() - 1);
fCurrentEntity.characterOffset--; fCurrentEntity.columnNumber--; scanCharacters(); if (c == '!') { if (skip("--", false)) { scanComment(); scanCDATA(); scanPI(); scanEndElement(); fElementCount++; fSingleBoolean[0] = false; final String ename = scanStartElement(fSingleBoolean); fBeginLineNumber = fCurrentEntity.lineNumber; fBeginColumnNumber = fCurrentEntity.columnNumber; fBeginCharacterOffset = fCurrentEntity.characterOffset; if ("script".equalsIgnoreCase(ename)) { scanScriptContent(); scanNoScriptContent(); && (!ename.equalsIgnoreCase("TITLE") || isEnded(ename))) { setScanner(fSpecialScanner.setElementName(ename)); setScannerState(STATE_CONTENT);
scanCharacters(); if (c == '!') { if (skip("--", false)) { scanComment(); scanCDATA(); scanPI(); scanEndElement(); fElementCount++; fSingleBoolean[0] = false; final String ename = scanStartElement(fSingleBoolean); final String enameLC = ename == null ? null : ename.toLowerCase(); fBeginLineNumber = fCurrentEntity.getLineNumber(); fBeginCharacterOffset = fCurrentEntity.getCharacterOffset(); if ("script".equals(enameLC)) { scanScriptContent(); scanUntilEndTag("iframe"); scanUntilEndTag("noscript"); scanUntilEndTag("noframes"); && (!ename.equalsIgnoreCase("TITLE") || isEnded(enameLC))) {
fAttributes.removeAllAttributes(); int aindex = 0; while (scanPseudoAttribute(fAttributes)) { final boolean xmlDeclNow = fIgnoreSpecifiedCharset || !changeEncoding(encoding); if (xmlDeclNow) { fBeginLineNumber = beginLineNumber;
fAttributes.removeAllAttributes(); int aindex = 0; while (scanPseudoAttribute(fAttributes)) { final boolean xmlDeclNow = fIgnoreSpecifiedCharset || !changeEncoding(encoding); if (xmlDeclNow) { fBeginLineNumber = beginLineNumber;
int beginColumnNumber = fBeginColumnNumber; int beginCharacterOffset = fBeginCharacterOffset; while (scanAttribute(fAttributes, empty)) { content = removeSpaces(content); int index1 = content.toLowerCase().indexOf("charset="); if (index1 != -1) { final int index2 = content.indexOf(';', index1); final String charset = index2 != -1 ? content.substring(index1+8, index2) : content.substring(index1+8); changeEncoding(charset); final String metaCharset = getValue(fAttributes, "charset"); if (metaCharset != null) { changeEncoding(metaCharset);
fEndCharacterOffset = fCurrentEntity.characterOffset; XMLStringBuffer buffer = new XMLStringBuffer(); boolean eof = scanMarkupContent(buffer, '-');
fStringBuffer.append("[CDATA["); boolean eof = scanMarkupContent(fStringBuffer, ']'); if (!fCDATASections) { fStringBuffer.append("]]");
fEndCharacterOffset = fCurrentEntity.getCharacterOffset(); XMLStringBuffer buffer = new XMLStringBuffer(); boolean eof = scanMarkupContent(buffer, '-');
final String next = nextContent(10) + " "; if (next.length() >= 10 && "/noscript".equalsIgnoreCase(next.substring(0, 9)) && ('>' == next.charAt(9) || Character.isWhitespace(next.charAt(9)))) {
final String next = nextContent(8) + " "; if (next.length() >= 8 && "/script".equalsIgnoreCase(next.substring(0, 7)) && ('>' == next.charAt(7) || Character.isWhitespace(next.charAt(7)))) {
final String next = nextContent(lengthToScan) + " "; if (next.length() >= lengthToScan && end.equalsIgnoreCase(next.substring(0, end.length())) && ('>' == next.charAt(lengthToScan - 1) || Character.isWhitespace(next.charAt(lengthToScan - 1)))) {
fStringBuffer.append("[CDATA["); boolean eof = scanMarkupContent(fStringBuffer, ']'); if (!fCDATASections) { fStringBuffer.append("]]");
@Override protected void scanComment() throws IOException { final String s = nextContent(30); // [if ... if (s.startsWith("[if ") && s.contains("]>")) { final String condition = StringUtils.substringBefore(s.substring(4), "]>"); try { if (IEConditionalCommentExpressionEvaluator.evaluate(condition, browserVersion_)) { // skip until ">" for (int i = 0; i < condition.length() + 6; ++i) { read(); } return; } } catch (final Exception e) { // incorrect expression => handle it as plain text // TODO: report it! final XMLStringBuffer buffer = new XMLStringBuffer("<!--"); scanMarkupContent(buffer, '-'); buffer.append("-->"); fDocumentHandler.characters(buffer, locationAugs()); return; } } // this is a normal comment, not a conditional comment for IE super.scanComment(); } }
@Override protected void scanComment() throws IOException { final String s = nextContent(30); // [if ... if (s.startsWith("[if ") && s.contains("]>")) { final String condition = StringUtils.substringBefore(s.substring(4), "]>"); try { if (IEConditionalCommentExpressionEvaluator.evaluate(condition, browserVersion_)) { // skip until ">" for (int i = 0; i < condition.length() + 6; ++i) { read(); } return; } } catch (final Exception e) { // incorrect expression => handle it as plain text // TODO: report it! final XMLStringBuffer buffer = new XMLStringBuffer("<!--"); scanMarkupContent(buffer, '-'); buffer.append("-->"); fDocumentHandler.characters(buffer, locationAugs()); return; } } // this is a normal comment, not a conditional comment for IE super.scanComment(); } }
/** * Scans a real attribute. * * @param attributes The list of attributes. * @param empty Is used for a second return value to indicate * whether the start element tag is empty * (e.g. "/>"). */ protected boolean scanAttribute(XMLAttributesImpl attributes, boolean[] empty) throws IOException { return scanAttribute(attributes,empty,'/'); } // scanAttribute(XMLAttributesImpl,boolean[]):boolean