Package com.dotcms.repackage.javax.xml.parsers

Examples of com.dotcms.repackage.javax.xml.parsers.DocumentBuilder


      VelocityEngine ve = VelocityUtil.getEngine();
      ve.getTemplate("/" + location + "/" + pageIdent + "." + VELOCITY_HTMLPAGE_EXTENSION).merge(context, sw);
      ITextRenderer renderer = new ITextRenderer();
      DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
      documentBuilderFactory.setValidating(false);
      DocumentBuilder builder = documentBuilderFactory.newDocumentBuilder();
      builder.setEntityResolver(new DTDResolver());
      String s = sw.toString();
      s = escapeEspecialCharacter(s);

      s = processCSSPath(s, host, "css", "\\(", "\\)", ")", url);
      s = processCSSPath(s, host, "css", "\\\"", "\\\"", "\"", url);
      Tidy tidy = new Tidy();
      tidy.setXHTML(true);

      ByteArrayInputStream is = new ByteArrayInputStream(s.getBytes());
      ByteArrayOutputStream os = new ByteArrayOutputStream();
      tidy.parse(is, os);
      s = os.toString();

      is = new ByteArrayInputStream(s.getBytes());
      Document doc = builder.parse(is);

      NodeList nl = doc.getElementsByTagName("img");
      for (int i = 0; i < nl.getLength(); i++) {
        Node n = nl.item(i);
        Node srcNode = n.getAttributes().getNamedItem("src");
View Full Code Here


    public ArrayList<HashMap<String, String>> ingest(String uri, String userAgent) {
      ArrayList<HashMap<String, String>> returnValue = new ArrayList<HashMap<String, String>>();
      try {
        DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
        builderFactory.setValidating(false);
        DocumentBuilder builder = builderFactory.newDocumentBuilder();
        Document doc;
        if (UtilMethods.isSet(userAgent)) {
          URL urlObject = new URL(uri);
          URLConnection con = urlObject.openConnection();
          con.setReadTimeout(15000);
          con.setRequestProperty("User-Agent", userAgent);
          InputStream st = con.getInputStream();
          doc  = builder.parse(st);
        } else {
          doc = builder.parse(uri);
        }
       
        NodeList items = doc.getElementsByTagName("item");
        for (int i = 0; i < items.getLength(); i++) {
          try {
View Full Code Here

public static Vector getObjectShippingPrices(String uriXML) {
  try {
   
    InputSource is = new InputSource(new StringReader(uriXML));
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = factory.newDocumentBuilder();
    Document document = builder.parse( is );
    objectList = new Vector<UPSResponseObject>();
   
    NodeList list = document.getElementsByTagName("RatingServiceSelectionResponse");
   
    int responseLength = list.getLength();
View Full Code Here

    try {
      DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory
          .newInstance();
      docBuilderFactory.setValidating(false);
      DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
      stream = new URL(searchURL.toString()).openStream();
      Document doc = docBuilder.parse(stream);
      if ((doc != null) && (doc.getChildNodes() != null)) {
        result = new GoogleMiniSearch();
        Element nodeGSP = (Element) doc.getChildNodes().item(0);
        NodeList GSPChildNodes = nodeGSP.getElementsByTagName("TM");
        if ((GSPChildNodes != null) && (0 < GSPChildNodes.getLength())) {
View Full Code Here

TOP

Related Classes of com.dotcms.repackage.javax.xml.parsers.DocumentBuilder

Copyright © 2018 www.massapicom. 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.