Package com.dotcms.repackage.org.w3c.dom

Examples of com.dotcms.repackage.org.w3c.dom.Document


      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");
        String srcText = srcNode.getNodeValue();
        String newText = getRealPath(srcText, host, url);
View Full Code Here


      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 {
            Element item = (Element) items.item(i);
            // Get the title
            NodeList titles = item.getElementsByTagName("title");
View Full Code Here

  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();
    for(int i= 0; i < responseLength; i++){
     
      UPSResponseObject object = new UPSResponseObject();
     
      list = document.getElementsByTagName("ResponseStatusCode");
      if(list.item(i) != null && list.item(i).getFirstChild() != null)
        object.setStatusCode(list.item(i).getFirstChild().getNodeValue());
     
      list = document.getElementsByTagName("ResponseStatusDescription");
      if(list.item(i) != null && list.item(i).getFirstChild() != null)
        object.setStatusDescription(list.item(i).getFirstChild().getNodeValue());
     
      list = document.getElementsByTagName("ErrorCode");
      if(list.item(i) != null && list.item(i).getFirstChild() != null)
        object.setErrorCode(list.item(i).getFirstChild().getNodeValue());
     
      list = document.getElementsByTagName("ErrorDescription");
      if(list.item(i) != null && list.item(i).getFirstChild() != null)
        object.setErrorDescription(list.item(i).getFirstChild().getNodeValue());
           
      list = document.getElementsByTagName("TotalCharges");
      if(list.item(i) != null && list.item(i).getFirstChild() != null){
       
        list = document.getElementsByTagName("CurrencyCode");
        if(list.item(i) != null && list.item(i).getFirstChild() != null)
          object.setCurrencyCode(list.item(i).getFirstChild().getNodeValue());
       
        list = document.getElementsByTagName("MonetaryValue");
        if(list.item(i) != null && list.item(i).getFirstChild() != null)
          object.setTotalValue(list.item(i).getFirstChild().getNodeValue());
       
       
      }     
View Full Code Here

      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())) {
          Element nodeTM = (Element) GSPChildNodes.item(0);
          result.setSearchTime(nodeTM.getChildNodes().item(0)
              .getNodeValue());
View Full Code Here

TOP

Related Classes of com.dotcms.repackage.org.w3c.dom.Document

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.