/** * * @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.getURINoBoundsCheck(i), attributes.getLocalNameNoBoundsCheck(i), attributes.getValueNoBoundsCheck(i)); } document.appendChild(rv); return rv; } catch (DOMException e) { fatal(e); throw new RuntimeException("Unreachable"); } }
/** * * @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.getURINoBoundsCheck(i), attributes.getLocalNameNoBoundsCheck(i), attributes.getValueNoBoundsCheck(i)); } document.appendChild(rv); return rv; } catch (DOMException e) { fatal(e); throw new RuntimeException("Unreachable"); } }
/** * * @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); } }
/** * * @see nu.validator.htmlparser.impl.TreeBuilder#createElement(String, String, nu.validator.htmlparser.impl.HtmlAttributes, Object) */ @Override protected Element createElement(String ns, String name, HtmlAttributes attributes, Element intendedParent) throws SAXException { try { Element rv = document.createElementNS(ns, name); for (int i = 0; i < attributes.getLength(); i++) { rv.setAttributeNS(attributes.getURINoBoundsCheck(i), attributes.getLocalNameNoBoundsCheck(i), attributes.getValueNoBoundsCheck(i)); if (attributes.getTypeNoBoundsCheck(i) == "ID") { rv.setIdAttributeNS(null, attributes.getLocalName(i), true); } } return rv; } catch (DOMException e) { fatal(e); throw new RuntimeException("Unreachable"); } }
/** * * @see nu.validator.htmlparser.impl.TreeBuilder#createElement(String, String, nu.validator.htmlparser.impl.HtmlAttributes, Object) */ @Override protected Element createElement(String ns, String name, HtmlAttributes attributes, Element intendedParent) throws SAXException { try { Element rv = document.createElementNS(ns, name); for (int i = 0; i < attributes.getLength(); i++) { rv.setAttributeNS(attributes.getURINoBoundsCheck(i), attributes.getLocalNameNoBoundsCheck(i), attributes.getValueNoBoundsCheck(i)); if (attributes.getTypeNoBoundsCheck(i) == "ID") { rv.setIdAttributeNS(null, attributes.getLocalName(i), true); } } return rv; } catch (DOMException 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"); } }
/** * @see nu.validator.htmlparser.impl.TreeBuilder#createElement(String, * java.lang.String, org.xml.sax.Attributes, java.lang.Object) */ @Override protected Element createElement(String ns, String name, HtmlAttributes attributes, Element form, Element intendedParent) throws SAXException { try { Element rv = nodeFactory.makeElement(name, ns, form); for (int i = 0; i < attributes.getLength(); i++) { rv.addAttribute(nodeFactory.makeAttribute( attributes.getLocalName(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"); } }
/** * @see nu.validator.htmlparser.impl.TreeBuilder#createElement(String, * java.lang.String, org.xml.sax.Attributes, java.lang.Object) */ @Override protected Element createElement(String ns, String name, HtmlAttributes attributes, Element form, Element intendedParent) throws SAXException { try { Element rv = nodeFactory.makeElement(name, ns, form); for (int i = 0; i < attributes.getLength(); i++) { rv.addAttribute(nodeFactory.makeAttribute( attributes.getLocalName(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.getLocalNameNoBoundsCheck(i), attributes.getURINoBoundsCheck(i), attributes.getValueNoBoundsCheck(i), attributes.getTypeNoBoundsCheck(i) == "ID" ? Attribute.Type.ID : Attribute.Type.CDATA)); } document.setRootElement(rv); 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.getLocalNameNoBoundsCheck(i), attributes.getURINoBoundsCheck(i), attributes.getValueNoBoundsCheck(i), attributes.getTypeNoBoundsCheck(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.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); } }