Refine search
/** Comment. */ public void comment(XMLString text, Augmentations augs) throws XNIException { fSeenAnything = true; consumeEarlyTextIfNeeded(); if (fDocumentHandler != null) { fDocumentHandler.comment(text, augs); } } // comment(XMLString,Augmentations)
/** Doctype declaration. */ public void doctypeDecl(String rootElementName, String publicId, String systemId, Augmentations augs) throws XNIException { fSeenAnything = true; if (fReportErrors) { if (fSeenRootElement) { fErrorReporter.reportError("HTML2010", null); } else if (fSeenDoctype) { fErrorReporter.reportError("HTML2011", null); } } if (!fSeenRootElement && !fSeenDoctype) { fSeenDoctype = true; if (fDocumentHandler != null) { fDocumentHandler.doctypeDecl(rootElementName, publicId, systemId, augs); } } } // doctypeDecl(String,String,String,Augmentations)
/** Call document handler end element. */ protected final void callEndElement(QName element, Augmentations augs) throws XNIException { fDocumentHandler.endElement(element, augs); } // callEndElement(QName,Augmentations)
/** Element reference in mixed or children content model. */ public void element(String name, Augmentations augs) throws XNIException { if (fDocumentHandler != null) { fAttributes.removeAllAttributes(); fAttributes.addAttribute(A_NAME, "NMTOKEN", name); fAttributes.setSpecified(0, true); fDocumentHandler.emptyElement(E_ELEMENT, fAttributes, augs); } } // element(String,Augmentations)
@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(); } }
/** Start content model. */ public void startContentModel(String ename, Augmentations augs) throws XNIException { if (fDocumentHandler != null) { fAttributes.removeAllAttributes(); fAttributes.addAttribute(A_ENAME, "NMTOKEN", ename); fAttributes.setSpecified(0, true); fDocumentHandler.startElement(E_CONTENT_MODEL, fAttributes, augs); } } // startContentModel(String,Augmentations)
throws IOException, XNIException { fStringBuffer2.clear(); int ch = scanCharReferenceValue(fStringBuffer2, null); fMarkupDepth--; fDocumentHandler.startGeneralEntity(fCharRefLiteral, null, null, null); augs.putItem(Constants.CHAR_REF_PROBABLE_WS, Boolean.TRUE); fDocumentHandler.characters(fStringBuffer2, augs); if (fNotifyCharRefs) { fDocumentHandler.endGeneralEntity(fCharRefLiteral, null);
/** Scans an end element. */ protected void scanEndElement() throws IOException { String ename = scanName(); if (fReportErrors && ename == null) { fErrorReporter.reportError("HTML1012", null); } skipMarkup(false); if (ename != null) { ename = modifyName(ename, fNamesElems); if (fDocumentHandler != null && fElementCount >= fElementDepth) { fQName.setValues(null, ename, ename, null); if (DEBUG_CALLBACKS) { System.out.println("endElement("+fQName+")"); } fEndLineNumber = fCurrentEntity.lineNumber; fEndColumnNumber = fCurrentEntity.columnNumber; fEndCharacterOffset = fCurrentEntity.characterOffset; fDocumentHandler.endElement(fQName, locationAugs()); } } } // scanEndElement()
fDocumentHandler.characters(text, augs);
fQName.setValues(null, body, body, null); callEndElement(fQName, synthesizedAugs()); fQName.setValues(null, ename, ename, null); callEndElement(fQName, synthesizedAugs()); fDocumentHandler.endDocument(augs);
fErrorReporter.reportWarning("HTML2002", new Object[]{ename,pname}); final QName qname = new QName(null, pname, pname, null); final boolean parentCreated = forceStartElement(qname, null, synthesizedAugs()); if (!parentCreated) { if (depth == -1) { // no parent found final String pname = modifyName(preferedParent.name, fNamesElems); final QName qname = new QName(null, pname, pname, null); if (fReportErrors) { String ename = elem.rawname; fDocumentHandler.emptyElement(elem, attrs, augs);
/** Parsed character data for mixed content model. */ public void pcdata(Augmentations augs) throws XNIException { if (fDocumentHandler != null) { fAttributes.removeAllAttributes(); fDocumentHandler.emptyElement(E_PCDATA, fAttributes, augs); } } // pcdata(Augmentations)
/** Start mixed or children content model group. */ public void startGroup(Augmentations augs) throws XNIException { if (fDocumentHandler != null) { fAttributes.removeAllAttributes(); fDocumentHandler.startElement(E_GROUP, fAttributes, augs); } } // startGroup(Augmentations)
/** End DTD. */ public void endDTD(Augmentations augs) throws XNIException { if (fDocumentHandler != null) { fDocumentHandler.endElement(E_DTD, augs); fDocumentHandler.endDocument(augs); } } // endDTD(Augmentations)
/** End CDATA section. */ public void endCDATA(Augmentations augs) throws XNIException { // check for end of document if (fSeenRootElementEnd) { return; } // call handler if (fDocumentHandler != null) { fDocumentHandler.endCDATA(augs); } } // endCDATA(Augmentations)
/** Processing instruction. */ public void processingInstruction(String target, XMLString data, Augmentations augs) throws XNIException { fSeenAnything = true; consumeEarlyTextIfNeeded(); if (fDocumentHandler != null) { fDocumentHandler.processingInstruction(target, data, augs); } } // processingInstruction(String,XMLString,Augmentations)
/** End entity. */ public void endGeneralEntity(String name, Augmentations augs) throws XNIException { // check for end of document if (fSeenRootElementEnd) { return; } // call handler if (fDocumentHandler != null) { fDocumentHandler.endGeneralEntity(name, augs); } } // endGeneralEntity(String,Augmentations)
/** * End document. */ public void endDocument(Augmentations augs) throws XNIException { if (fDocumentHandler != null) { fDocumentHandler.endDocument(augs); } } // endDocument(Augmentations)
int newlines = skipNewlines(); for (int i = 0; i < newlines; i++) { buffer.append('\n'); fEndColumnNumber = fCurrentEntity.getColumnNumber(); fEndCharacterOffset = fCurrentEntity.getCharacterOffset(); fDocumentHandler.characters(buffer, locationAugs());
/** Call document handler start element. */ protected final void callStartElement(QName element, XMLAttributes attrs, Augmentations augs) throws XNIException { fDocumentHandler.startElement(element, attrs, augs); } // callStartElement(QName,XMLAttributes,Augmentations)