@Override protected void maybeErrAttributesOnEndTag(HtmlAttributes attrs) throws SAXException { if (attrs.getLength() != 0) { /* * When an end tag token is emitted with attributes, that is a parse * error. */ err("End tag had attributes."); } }
@Override protected void maybeErrAttributesOnEndTag(HtmlAttributes attrs) throws SAXException { if (attrs.getLength() != 0) { /* * When an end tag token is emitted with attributes, that is a parse * error. */ err("End tag had attributes."); } }
@Override protected void maybeErrAttributesOnEndTag(HtmlAttributes attrs) throws SAXException { if (attrs.getLength() != 0) { /* * When an end tag token is emitted with attributes, that is a parse * error. */ err("End tag had attributes."); } }
@Override protected void addAttributesToElement(Attributes element, HtmlAttributes attributes) throws SAXException { Attributes existingAttrs = element; for (int i = 0; i < attributes.getLength(); i++) { String qName = attributes.getQName(i); if (existingAttrs.getIndex(qName) < 0) { fatal(); } } }
/** * * @see nu.validator.htmlparser.impl.TreeBuilder#createHtmlElementSetAsRoot(nu.validator.htmlparser.impl.HtmlAttributes) */ @Override protected Element createHtmlElementSetAsRoot( HtmlAttributes attributes) throws SAXException { try { Element rv = document.createElementNS( "http://www.w3.org/1999/xhtml", "html"); for (int i = 0; i < attributes.getLength(); i++) { rv.setAttributeNS(attributes.getURI(i), attributes.getLocalName(i), attributes.getValue(i)); } document.appendChild(rv); return rv; } catch (DOMException e) { fatal(e); throw new RuntimeException("Unreachable"); } }
@Override protected void addAttributesToElement(Attributes element, HtmlAttributes attributes) throws SAXException { Attributes existingAttrs = element; for (int i = 0; i < attributes.getLength(); i++) { String qName = attributes.getQNameNoBoundsCheck(i); if (existingAttrs.getIndex(qName) < 0) { fatal(); } } }
@Override protected void addAttributesToElement(Attributes element, HtmlAttributes attributes) throws SAXException { Attributes existingAttrs = element; for (int i = 0; i < attributes.getLength(); i++) { String qName = attributes.getQNameNoBoundsCheck(i); if (existingAttrs.getIndex(qName) < 0) { fatal(); } } }
public void merge(HtmlAttributes attributes) throws SAXException { int len = attributes.getLength(); for (int i = 0; i < len; i++) { AttributeName name = attributes.getAttributeNameNoBoundsCheck(i); if (!contains(name)) { addAttribute(name, attributes.getValueNoBoundsCheck(i), XmlViolationPolicy.ALLOW); } } } }
public void merge(HtmlAttributes attributes) throws SAXException { int len = attributes.getLength(); for (int i = 0; i < len; i++) { AttributeName name = attributes.getAttributeName(i); if (!contains(name)) { addAttribute(name, attributes.getValue(i), XmlViolationPolicy.ALLOW); } } }
public void merge(HtmlAttributes attributes) throws SAXException { int len = attributes.getLength(); for (int i = 0; i < len; i++) { AttributeName name = attributes.getAttributeNameNoBoundsCheck(i); if (!contains(name)) { addAttribute(name, attributes.getValueNoBoundsCheck(i), XmlViolationPolicy.ALLOW); } } } }
/** * * @see nu.validator.htmlparser.impl.TreeBuilder#addAttributesToElement(java.lang.Object, * nu.validator.htmlparser.impl.HtmlAttributes) */ @Override protected void addAttributesToElement(Element element, HtmlAttributes attributes) throws SAXException { try { for (int i = 0; i < attributes.getLength(); i++) { String localName = attributes.getLocalName(i); String uri = attributes.getURI(i); if (!element.hasAttributeNS(uri, localName)) { element.setAttributeNS(uri, localName, attributes.getValue(i)); } } } catch (DOMException e) { fatal(e); } }
/** * * @see nu.validator.htmlparser.impl.TreeBuilder#addAttributesToElement(java.lang.Object, * nu.validator.htmlparser.impl.HtmlAttributes) */ @Override protected void addAttributesToElement(Element element, HtmlAttributes attributes) throws SAXException { try { for (int i = 0; i < attributes.getLength(); i++) { String localName = attributes.getLocalNameNoBoundsCheck(i); String uri = attributes.getURINoBoundsCheck(i); if (!element.hasAttributeNS(uri, localName)) { element.setAttributeNS(uri, localName, attributes.getValueNoBoundsCheck(i)); } } } catch (DOMException e) { fatal(e); } }
/** * * @see nu.validator.htmlparser.impl.TreeBuilder#addAttributesToElement(java.lang.Object, * nu.validator.htmlparser.impl.HtmlAttributes) */ @Override protected void addAttributesToElement(Element element, HtmlAttributes attributes) throws SAXException { try { for (int i = 0; i < attributes.getLength(); i++) { String localName = attributes.getLocalNameNoBoundsCheck(i); String uri = attributes.getURINoBoundsCheck(i); if (!element.hasAttributeNS(uri, localName)) { element.setAttributeNS(uri, localName, attributes.getValueNoBoundsCheck(i)); } } } catch (DOMException e) { fatal(e); } }
@Override protected Element createElement(String ns, String name, HtmlAttributes attributes) throws SAXException { try { Element rv = nodeFactory.makeElement(name, ns); for (int i = 0; i < attributes.getLength(); i++) { rv.addAttribute(nodeFactory.makeAttribute( attributes.getLocalName(i), attributes.getURI(i), attributes.getValue(i), attributes.getType(i) == "ID" ? Attribute.Type.ID : Attribute.Type.CDATA)); } return rv; } catch (XMLException e) { fatal(e); throw new RuntimeException("Unreachable"); } }
@Override protected Element createElement(String ns, String name, HtmlAttributes attributes, Element intendedParent) throws SAXException { try { Element rv = nodeFactory.makeElement(name, ns); for (int i = 0; i < attributes.getLength(); i++) { rv.addAttribute(nodeFactory.makeAttribute( attributes.getLocalNameNoBoundsCheck(i), attributes.getURINoBoundsCheck(i), attributes.getValueNoBoundsCheck(i), attributes.getTypeNoBoundsCheck(i) == "ID" ? Attribute.Type.ID : Attribute.Type.CDATA)); } return rv; } catch (XMLException e) { fatal(e); throw new RuntimeException("Unreachable"); } }
@Override protected Element createElement(String ns, String name, HtmlAttributes attributes, Element intendedParent) throws SAXException { try { Element rv = nodeFactory.makeElement(name, ns); for (int i = 0; i < attributes.getLength(); i++) { rv.addAttribute(nodeFactory.makeAttribute( attributes.getLocalNameNoBoundsCheck(i), attributes.getURINoBoundsCheck(i), attributes.getValueNoBoundsCheck(i), attributes.getTypeNoBoundsCheck(i) == "ID" ? Attribute.Type.ID : Attribute.Type.CDATA)); } return rv; } catch (XMLException e) { fatal(e); throw new RuntimeException("Unreachable"); } }
@Override protected Element createHtmlElementSetAsRoot(HtmlAttributes attributes) throws SAXException { try { Element rv = nodeFactory.makeElement("html", "http://www.w3.org/1999/xhtml"); for (int i = 0; i < attributes.getLength(); i++) { rv.addAttribute(nodeFactory.makeAttribute( attributes.getLocalName(i), attributes.getURI(i), attributes.getValue(i), attributes.getType(i) == "ID" ? Attribute.Type.ID : Attribute.Type.CDATA)); } document.setRootElement(rv); return rv; } catch (XMLException e) { fatal(e); throw new RuntimeException("Unreachable"); } }
@Override protected void addAttributesToElement(Element element, HtmlAttributes attributes) throws SAXException { try { for (int i = 0; i < attributes.getLength(); i++) { String localName = attributes.getLocalName(i); String uri = attributes.getURI(i); if (element.getAttribute(localName, uri) == null) { element.addAttribute(nodeFactory.makeAttribute(localName, uri, attributes.getValue(i), attributes.getType(i) == "ID" ? Attribute.Type.ID : Attribute.Type.CDATA)); } } } catch (XMLException e) { fatal(e); } }
@Override protected void addAttributesToElement(Element element, HtmlAttributes attributes) throws SAXException { try { for (int i = 0; i < attributes.getLength(); i++) { String localName = attributes.getLocalNameNoBoundsCheck(i); String uri = attributes.getURINoBoundsCheck(i); if (element.getAttribute(localName, uri) == null) { element.addAttribute(nodeFactory.makeAttribute( localName, uri, attributes.getValueNoBoundsCheck(i), attributes.getTypeNoBoundsCheck(i) == "ID" ? Attribute.Type.ID : Attribute.Type.CDATA)); } } } catch (XMLException e) { fatal(e); } }
@Override protected void addAttributesToElement(Element element, HtmlAttributes attributes) throws SAXException { try { for (int i = 0; i < attributes.getLength(); i++) { String localName = attributes.getLocalNameNoBoundsCheck(i); String uri = attributes.getURINoBoundsCheck(i); if (element.getAttribute(localName, uri) == null) { element.addAttribute(nodeFactory.makeAttribute( localName, uri, attributes.getValueNoBoundsCheck(i), attributes.getTypeNoBoundsCheck(i) == "ID" ? Attribute.Type.ID : Attribute.Type.CDATA)); } } } catch (XMLException e) { fatal(e); } }