/** * @see org.htmlparser.Tag#getRawTagName() */ public String getRawTagName() { return m_decorated.getRawTagName(); }
/** * @see org.htmlparser.Tag#getRawTagName() */ public String getRawTagName() { return m_decorated.getRawTagName(); }
/** * @see org.htmlparser.Tag#getRawTagName() */ public String getRawTagName() { return m_decorated.getRawTagName(); }
private boolean isTagClosed(Tag tag) { return tag.getRawTagName().endsWith("/"); }
private boolean isTagClosed(Tag tag) { return tag.getRawTagName().endsWith("/"); }
private String getName(Tag tag) { String result = tag.getRawTagName().toUpperCase(); if (result.endsWith("/")) { result = result.substring(0, result.length() - 1); } if (result.startsWith("/")) { result = result.substring(1); } return result; }
private String getName(Tag tag) { String result = tag.getRawTagName().toUpperCase(); if (result.endsWith("/")) { result = result.substring(0, result.length() - 1); } if (result.startsWith("/")) { result = result.substring(1); } return result; }
public void visitTag(Tag tag) { if (tag.getRawTagName().equalsIgnoreCase("img")) { String imageValue = tag.getAttribute("src"); if (imageValue.contains("base64")) { String contentId = getContentId(); tag.setAttribute("src", "cid:" + contentId); base64ImagesMap.put(contentId, imageValue.substring(imageValue.indexOf("base64") + 7, imageValue.length())); } } }
private boolean isOpenClose(org.htmlparser.Tag tag) { if (tag.getRawTagName().endsWith("/")) { return true; } else { List<?> atts = tag.getAttributesEx(); Attribute a = (Attribute) atts.get(atts.size() - 1); return a.getName() != null && a.getName().equals("/"); } }
/** * Creates an end tag with the same name as the given tag. * @param tag The tag to end. * @param lexer The object containg the node factory. * @param page The page the tag is on (virtually). * @param position The offset into the page at which the tag is to * be anchored. * @return An end tag with the name '"/" + tag.getTagName()' and a start * and end position at the given position. The fact these positions are * equal may be used to distinguish it as a virtual tag later on. */ protected Tag createVirtualEndTag (Tag tag, Lexer lexer, Page page, int position) throws ParserException { Tag ret; String name; Vector attributes; name = "/" + tag.getRawTagName (); attributes = new Vector (); attributes.addElement (new Attribute (name, (String)null)); ret = lexer.getNodeFactory ().createTagNode ( page, position, position, attributes); return (ret); }
/** * Creates an end tag with the same name as the given tag. * @param tag The tag to end. * @param lexer The object containg the node factory. * @param page The page the tag is on (virtually). * @param position The offset into the page at which the tag is to * be anchored. * @return An end tag with the name '"/" + tag.getTagName()' and a start * and end position at the given position. The fact these positions are * equal may be used to distinguish it as a virtual tag later on. */ protected Tag createVirtualEndTag (Tag tag, Lexer lexer, Page page, int position) throws ParserException { Tag ret; String name; List attributes; name = "/" + tag.getRawTagName (); attributes = new ArrayList (); attributes.add (new Attribute (name, (String)null)); ret = lexer.getNodeFactory ().createTagNode ( page, position, position, attributes); return (ret); }
private void processTag(List<AbstractContainer> nodes, int current, List<Item> items, org.htmlparser.Tag tag) { final Tag.Type type; final String rawName = tag.getRawTagName(); if (rawName.startsWith("/")) { type = Tag.Type.CLOSE; } else if (isOpenClose(tag)) { type = Tag.Type.OPEN_CLOSE; } else { type = Tag.Type.OPEN; } final String tagName = tag.getTagName().toLowerCase(); if ("!doctype".equals(tagName)) { this.doctype = tag.toHtml(); } else if (type == Tag.Type.CLOSE) { if (!isKnownBrixTag(tagName)) { Map<String, String> attributes = Collections.emptyMap(); items.add(new SimpleTag(tagName, type, attributes)); } } else { Map<String, String> attributes = getAttributes(tag); if (isKnownBrixTag(tagName)) { processBrixTag(nodes, current, items, tagName, getAttributes(tag), type); } else { items.add(new SimpleTag(tagName, type, attributes)); } } }
buf.append('<').append(tag.getRawTagName()); for (Attribute attr : attrs) buf.append('<').append(tag.getRawTagName()).append('>');
buf.append('<').append(tag.getRawTagName()); for (Attribute attr : attrs) buf.append('<').append(tag.getRawTagName()).append('>');
buf.append('<').append(tag.getRawTagName()); for (Attribute attr : attrs) buf.append('<').append(tag.getRawTagName()).append('>'); processNodes(buf, tag.getChildren().elements(), encode, false); if (tag.getEndTag() != null)
tagNode.setTagName(tag.getRawTagName()); Iterator<PageAttribute> iterator = attributes.iterator();