public void startElement(String namespaceURI, String localName, String qName, Attributes atts) { flushText(); if (builder != null) { builderStack.push(builder); } Location loc = makeLocation(); builder = schemaBuilder.makeElementAnnotationBuilder(namespaceURI, localName, findPrefix(qName, namespaceURI), loc, getComments(), getContext()); int len = atts.getLength(); for (int i = 0; i < len; i++) { String uri = atts.getURI(i); builder.addAttribute(uri, atts.getLocalName(i), findPrefix(atts.getQName(i), uri), atts.getValue(i), loc); } }
public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException { xmlBaseHandler.startElement(); if (isRelaxNGElement(namespaceURI)) { State state = createChildState(localName); if (state == null) { xr.setContentHandler(new Skipper(this)); return; } state.setParent(this); state.set(); state.attributes(atts); } else { checkForeignElement(); ForeignElementHandler feh = new ForeignElementHandler(this, getComments()); feh.startElement(namespaceURI, localName, qName, atts); xr.setContentHandler(feh); } }
public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException { xmlBaseHandler.startElement(); if (isRelaxNGElement(namespaceURI)) { State state = createChildState(localName); if (state == null) { xr.setContentHandler(new Skipper(this)); return; } state.setParent(this); state.set(); state.attributes(atts); } else { checkForeignElement(); ForeignElementHandler feh = new ForeignElementHandler(this, getComments()); feh.startElement(namespaceURI, localName, qName, atts); xr.setContentHandler(feh); } }
public void startElement(String namespaceURI, String localName, String qName, Attributes atts) { flushText(); if (builder != null) builderStack.push(builder); Location loc = makeLocation(); builder = schemaBuilder.makeElementAnnotationBuilder(namespaceURI, localName, findPrefix(qName, namespaceURI), loc, getComments(), getContext()); int len = atts.getLength(); for (int i = 0; i < len; i++) { String uri = atts.getURI(i); builder.addAttribute(uri, atts.getLocalName(i), findPrefix(atts.getQName(i), uri), atts.getValue(i), loc); } }
public void endElement(String namespaceURI, String localName, String qName) { flushText(); if (comments != null) builder.addComment(getComments()); ParsedElementAnnotation ea = builder.makeElementAnnotation(); if (builderStack.empty()) { nextState.endForeignChild(ea); nextState.set(); } else { builder = (ElementAnnotationBuilder)builderStack.pop(); builder.addElement(ea); } }
public void endElement(String namespaceURI, String localName, String qName) { flushText(); if (comments != null) { builder.addComment(getComments()); } ParsedElementAnnotation ea = builder.makeElementAnnotation(); if (builderStack.empty()) { nextState.endForeignChild(ea); nextState.set(); } else { builder = (ElementAnnotationBuilder) builderStack.pop(); builder.addElement(ea); } }
void flushText() { if (textBuf != null && textBuf.length() != 0) { builder.addText(textBuf.toString(), textLoc, getComments()); textBuf.setLength(0); } textLoc = null; } }
public void comment(String value) { flushText(); super.comment(value); }
@Override public void comment(String value) { flushText(); super.comment(value); }
void flushText() { if (textBuf != null && textBuf.length() != 0) { builder.addText(textBuf.toString(), textLoc, getComments()); textBuf.setLength(0); } textLoc = null; } }