Package net.htmlparser.jericho

Examples of net.htmlparser.jericho.OutputDocument.replace()


        } else {
          URL = imageDirName + "/" + baseFilename + "_" + index + ".png";
          index++;
        }

        outputDocument.replace(element, "<img src=\""+URL+"\" />");
        diagramList.put(URL, element.getContent().toString());
      }
    }
   
    if(diagramList.isEmpty()){
View Full Code Here


                  sb.append("/* ").append(href).append(" */\n");
                }
                sb.append(styleSheetContent)
                        .append("\n</style>");

                document.replace(linkTag, sb.toString());
            }
        }

        return document.toString();
    }
View Full Code Here

                        String value = originalValue;
                        for (HtmlTagAttributeVisitor visitor : visitors) {
                            value = visitor.visit(value, context, resource);
                        }
                        if (originalValue != value && originalValue != null && !originalValue.equals(value)) {
                            document.replace(attribute.getValueSegment(), value);
                        }
                    }
                }
            }
        }
View Full Code Here

        StartTag startTag = tagElement.getStartTag();
        Attributes attributes = startTag.getAttributes();
        if (attributes != null) {
          for (Attribute attribute : startTag.getAttributes()) {
            if (uppercase) {
              outputDocument.replace(attribute.getNameSegment(), attribute.getNameSegment().toString()
                  .toUpperCase());
            } else {
              outputDocument.replace(attribute.getNameSegment(), attribute.getNameSegment().toString()
                  .toLowerCase());
            }
View Full Code Here

          for (Attribute attribute : startTag.getAttributes()) {
            if (uppercase) {
              outputDocument.replace(attribute.getNameSegment(), attribute.getNameSegment().toString()
                  .toUpperCase());
            } else {
              outputDocument.replace(attribute.getNameSegment(), attribute.getNameSegment().toString()
                  .toLowerCase());
            }
          }
        }
        if (uppercase) {
View Full Code Here

                  .toLowerCase());
            }
          }
        }
        if (uppercase) {
          outputDocument.replace(tag.getNameSegment(), tag.getNameSegment().toString().toUpperCase());
        } else {
          outputDocument.replace(tag.getNameSegment(), tag.getNameSegment().toString().toLowerCase());
        }
        pos = tag.getEnd();
      }
View Full Code Here

          }
        }
        if (uppercase) {
          outputDocument.replace(tag.getNameSegment(), tag.getNameSegment().toString().toUpperCase());
        } else {
          outputDocument.replace(tag.getNameSegment(), tag.getNameSegment().toString().toLowerCase());
        }
        pos = tag.getEnd();
      }
    }
    return outputDocument.toString();
View Full Code Here

            String labelId = reference.getAttributeValue("href").replace("#", "");
            Element label = source.getElementById(labelId);

            Element div = findLabelContainer(label);
            if (!isValidDiv(div)) {
                outputDocument.replace(reference, reference.toString().replace("*", "?"));
                LOG.warn("Could not resolve label: " + labelId);
                continue;
            }

            String text = extractTextToReplaceReference(div, label);
View Full Code Here

                LOG.warn("Could not resolve label: " + labelId);
                continue;
            }

            String text = extractTextToReplaceReference(div, label);
            outputDocument.replace(reference, reference.toString().replace("*", text));
        }
        return outputDocument.toString();
    }

    private Element findLabelContainer(Element label) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.