/** Returns a set of empty attributes. */ protected final XMLAttributes emptyAttributes() { fEmptyAttrs.removeAllAttributes(); return fEmptyAttrs; } // emptyAttributes():XMLAttributes
/** Call document handler end element. */ protected final void callEndElement(QName element, Augmentations augs) throws XNIException { fDocumentHandler.endElement(element, augs); } // callEndElement(QName,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)
QName qname, XMLAttributes attributes) { this.element = element; this.qname = new QName(qname); if (attributes != null) { int length = attributes.getLength(); if (length > 0) { QName aqname = new QName(); XMLAttributes newattrs = new XMLAttributesImpl(); for (int i = 0; i < length; i++) { attributes.getName(i, aqname); String type = attributes.getType(i); String value = attributes.getValue(i); String nonNormalizedValue = attributes.getNonNormalizedValue(i); boolean specified = attributes.isSpecified(i); newattrs.addAttribute(aqname, type, value); newattrs.setNonNormalizedValue(i, nonNormalizedValue); newattrs.setSpecified(i, specified);
/** Internal entity declaration. */ public void internalEntityDecl(String name, XMLString value, XMLString nonvalue, Augmentations augs) throws XNIException { if (fDocumentHandler != null) { fAttributes.removeAllAttributes(); fAttributes.addAttribute(A_NAME, "NMTOKEN", name); fAttributes.setSpecified(0, true); fAttributes.addAttribute(A_VALUE, "CDATA", value.toString()); fAttributes.setSpecified(1, true); fDocumentHandler.emptyElement(E_INTERNAL_ENTITY_DECL, fAttributes, augs); } } // internalEntityDecl(String,XMLString,XMLString,Augmentations)
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);
ElementEntry(final QName element, final Augmentations augs) { name_ = new QName(element); augs_ = (augs == null) ? null : new HTMLAugmentations(augs); } }
fQName.setValues(null, body, body, null); callEndElement(fQName, synthesizedAugs()); fQName.setValues(null, ename, ename, null); callEndElement(fQName, synthesizedAugs()); fDocumentHandler.endDocument(augs);
fErrorReporter.reportWarning("HTML2009", new Object[]{hname,bname}); fQName.setValues(null, hname, hname, null); endElement(fQName, synthesizedAugs()); insertBody = true; fDocumentHandler.startGeneralEntity(name, id, encoding, augs);
/** 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)
/** XML declaration. */ public void xmlDecl(String version, String encoding, String standalone, Augmentations augs) throws XNIException { if (!fSeenAnything && fDocumentHandler != null) { fDocumentHandler.xmlDecl(version, encoding, standalone, augs); } } // xmlDecl(String,String,String,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)
/** Text declaration. */ public void textDecl(String version, String encoding, Augmentations augs) throws XNIException { fSeenAnything = true; // check for end of document if (fSeenRootElementEnd) { return; } // call handler if (fDocumentHandler != null) { fDocumentHandler.textDecl(version, encoding, augs); } } // textDecl(String,String,Augmentations)
fDocumentHandler.characters(text, augs);
/** Comment. */ public void comment(XMLString text, Augmentations augs) throws XNIException { fSeenAnything = true; consumeEarlyTextIfNeeded(); if (fDocumentHandler != null) { fDocumentHandler.comment(text, augs); } } // comment(XMLString,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)
/** 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)
/** Start CDATA section. */ public void startCDATA(Augmentations augs) throws XNIException { fSeenAnything = true; consumeEarlyTextIfNeeded(); // check for end of document if (fSeenRootElementEnd) { return; } // call handler if (fDocumentHandler != null) { fDocumentHandler.startCDATA(augs); } } // startCDATA(Augmentations)
/** * Forces an element start, taking care to set the information to allow startElement to "see" that's * the element has been forced. * @return <code>true</code> if creation could be done (TABLE's creation for instance can't be forced) */ private boolean forceStartElement(final QName elem, XMLAttributes attrs, final Augmentations augs) throws XNIException { forcedStartElement_ = true; startElement(elem, attrs, augs); return fElementStack.top > 0 && elem.equals(fElementStack.peek().qname); }
private QName createQName(String tagName) { tagName = modifyName(tagName, fNamesElems); return new QName(null, tagName, tagName, NamespaceBinder.XHTML_1_0_URI); }