/** * Get closing node for this node, if any. * @param node Node to find closing sibling for * @return node or null */ public static Node endTag(Node node) { // No copying required since the node is not modified and has no children. return node instanceof Tag ? ((Tag) node).getEndTag() : null; }
/** * Get closing node for this node, if any. * @param node Node to find closing sibling for * @return node or null */ public static Node endTag(Node node) { // No copying required since the node is not modified and has no children. return node instanceof Tag ? ((Tag) node).getEndTag() : null; }
/** * @see org.htmlparser.Tag#getEndTag() */ public Tag getEndTag() { return m_decorated.getEndTag(); }
/** * @see org.htmlparser.Tag#getEndTag() */ public Tag getEndTag() { return m_decorated.getEndTag(); }
/** * @see org.htmlparser.Tag#getEndTag() */ public Tag getEndTag() { return m_decorated.getEndTag(); }
/** * Finish off a tag. * Perhap add a virtual end tag. * Set the end tag parent as this tag. * Perform the semantic acton. * @param tag The tag to finish off. * @param lexer A lexer positioned at the end of the tag. */ protected void finishTag (Tag tag, Lexer lexer) throws ParserException { if (null == tag.getEndTag ()) tag.setEndTag (createVirtualEndTag (tag, lexer, lexer.getPage (), lexer.getCursor ().getPosition ())); tag.getEndTag ().setParent (tag); tag.doSemanticAction (); }
/** * Finish off a tag. * Perhap add a virtual end tag. * Set the end tag parent as this tag. * Perform the semantic acton. * @param tag The tag to finish off. * @param lexer A lexer positioned at the end of the tag. */ protected void finishTag (Tag tag, Lexer lexer) throws ParserException { if (null == tag.getEndTag ()) tag.setEndTag (createVirtualEndTag (tag, lexer, lexer.getPage (), lexer.getCursor ().getPosition ())); tag.getEndTag ().setParent (tag); tag.doSemanticAction (); }
public void visitTag(Tag tag) { String name = getName(tag); Type type = getType(name, cas); boolean tagClosed = isTagClosed(tag); boolean tagStillOpen = false; int begin = getBeginOffset(tag); int end = begin; if (tagClosed) { end = getEndOffset(tag); } else { Tag endTag = tag.getEndTag(); if (endTag != null) { end = getEndOffset(endTag); } else { end = getEndOffset(tag); tagStillOpen = true; } } AnnotationFS annotation = cas.createAnnotation(type, begin, end); processAttributes(annotation, tag); Feature nameFeature = annotation.getType().getFeatureByBaseName("name"); annotation.setStringValue(nameFeature, name); if (tagStillOpen) { annotationStack.add(annotation); } else { annotations.add(annotation); } }
@Override public void visitTag(Tag tag) { String name = getName(tag); Type type = getType(name, cas); boolean tagClosed = isTagClosed(tag); boolean tagStillOpen = false; int begin = getBeginOffset(tag); int end = begin; if (tagClosed) { end = getEndOffset(tag); } else { Tag endTag = tag.getEndTag(); if (endTag != null) { end = getEndOffset(endTag); } else { end = getEndOffset(tag); tagStillOpen = true; } } AnnotationFS annotation = cas.createAnnotation(type, begin, end); processAttributes(annotation, tag); Feature nameFeature = annotation.getType().getFeatureByBaseName("name"); annotation.setStringValue(nameFeature, name); if (tagStillOpen) { annotationStack.add(annotation); } else { annotations.add(annotation); } }
for (int i = 0; i < children.size (); i++) doSAX (children.elementAt (i)); end = tag.getEndTag (); if (null != end)
for (int i = 0; i < children.size (); i++) doSAX (children.elementAt (i)); end = tag.getEndTag (); if (null != end)
if (tag.getEndTag() != null) { recurse = false;