Examples of DOMParser


Examples of org.cyberneko.html.parsers.DOMParser

  public List<Contact> parseContacts() throws ContactsException {
    try {
      String sid = getSid(indexPage, "folder");
      String content = doGet(contactsUrl.replaceFirst("%sid", sid));
      List<Contact> contacts = new ArrayList<Contact>();
      DOMParser parser = new DOMParser();
      InputSource is = new InputSource(new ByteArrayInputStream(content
          .getBytes("GBK")));
      is.setEncoding("GBK");
      parser.parse(is);
      NodeList nodes = parser.getDocument().getElementsByTagName("td");
      for (int i = 0; i < nodes.getLength(); i++) {
        Node node = nodes.item(i);
         if (node.getAttributes().getNamedItem("class") != null &&
                                        node.getAttributes().getNamedItem("class").getNodeValue().equals("Addr_Td_Name")) {
          String username = node.getTextContent().trim();
View Full Code Here

Examples of org.cyberneko.html.parsers.DOMParser

            List<Contact> contacts = new ArrayList<Contact>();
            while (true) {
                boolean empty = true;
                String contactsUrl = lastUrl.substring(0, lastUrl.indexOf("/webmail/")) + "/webmail/addressBookList.do?groupId=-1&page=" + page;
                String content = doGet(contactsUrl);
                DOMParser parser = new DOMParser();
                InputSource is = new InputSource(new ByteArrayInputStream(content.getBytes()));
                parser.parse(is);
                NodeList nodes = parser.getDocument().getElementsByTagName("td");
                for (int i = 0; i < nodes.getLength(); i++) {
                    Node node = nodes.item(i);
                    if (node.getAttributes().getNamedItem("class") != null) {
                        if (node.getAttributes().getNamedItem("class").getNodeValue().equals("mtb1-td2")) {
                            String username_text = node.getTextContent();
View Full Code Here

Examples of org.cyberneko.html.parsers.DOMParser

    public List<Contact> parseContacts() throws ContactsException {
        try {
            String sid = getSid(indexPage, "folder");
            String content = doGet(contactsUrl.replaceFirst("%sid", sid) + "&gid=all");
            List<Contact> contacts = new ArrayList<Contact>();
            DOMParser parser = new DOMParser();
            InputSource is = new InputSource(new ByteArrayInputStream(content.getBytes("GBK")));
            is.setEncoding("GBK");
            parser.parse(is);
            NodeList nodes = parser.getDocument().getElementsByTagName("td");
            for (int i = 0; i < nodes.getLength(); i++) {
                Node node = nodes.item(i);
                if (node.getFirstChild().getNodeName().equalsIgnoreCase("input")) {
                    i++;
                    String username = "";
View Full Code Here

Examples of org.cyberneko.html.parsers.DOMParser

    public List<Contact> parseContacts() throws ContactsException {
        try {
            String contactsUrl = lastUrl.replace("main", "address/addrlist") + "&gid=all";
            String content = doGet(contactsUrl);
            List<Contact> contacts = new ArrayList<Contact>();
            DOMParser parser = new DOMParser();
            InputSource is = new InputSource(new ByteArrayInputStream(content.getBytes("GBK")));
            is.setEncoding("GBK");
            parser.parse(is);
            NodeList nodes = parser.getDocument().getElementsByTagName("td");
            for (int i = 0; i < nodes.getLength(); i++) {
                Node node = nodes.item(i);
                if (node.getAttributes().getNamedItem("class").getNodeValue().equals("Ibx_Td_addrName")) {
                    String username = node.getFirstChild().getTextContent().trim();
                    i++;
View Full Code Here

Examples of org.cyberneko.html.parsers.DOMParser

   */
  public List<Contact> parseContacts() throws ContactsException {
    try {
      String content = doGet(contactsUrl);
      List<Contact> contacts = new ArrayList<Contact>();
      DOMParser parser = new DOMParser();
      parser.parse(new InputSource(new ByteArrayInputStream(content
          .getBytes())));
      NodeList nodes = parser.getDocument().getElementsByTagName("td");
      for (int i = 0; i < nodes.getLength(); i++) {
        Node node = nodes.item(i);
                                if (node.getAttributes().getNamedItem("class") != null &&
                                        node.getAttributes().getNamedItem("class").getNodeValue().equals("nobottom")) {
                                    String username = node.getChildNodes().item(1).getTextContent().trim();
View Full Code Here

Examples of org.cyberneko.html.parsers.DOMParser

        final Resource r = request.getResource();
        final Node n = r.adaptTo(Node.class);
        final String pageTitle = getTitle(r, n);

        // Parse script using the NekoHTML permissive HTML parser
        final DOMParser parser = new DOMParser();
        try {
            parser.setFeature("http://xml.org/sax/features/namespaces", false);
            parser.setProperty("http://cyberneko.org/html/properties/names/elems", "lower");
            parser.setProperty("http://cyberneko.org/html/properties/names/attrs", "lower");
            parser.parse(new InputSource(scriptStream));
        } catch(Exception e) {
            final ScriptException se = new ScriptException("Error parsing script " + scriptPath);
            se.initCause(e);
            throw se;
        }
        final Document template = parser.getDocument();

        // compute default rendering
        final StringWriter defaultRendering = new StringWriter();
        if(n!=null) {
            final PrintWriter pw = new PrintWriter(defaultRendering);
View Full Code Here

Examples of org.eclipse.wst.wsi.internal.core.xml.dom.DOMParser

   */
  public DocumentBuilderImpl(DocumentBuilderFactory dbFactory, Hashtable attributes)
    throws SAXException
  {
    // Create parser
    domParser = new DOMParser();

    // Set namespace aware
    domParser.setFeature(NAMESPACES_FEATURE, dbFactory.isNamespaceAware());

    // Set validating
View Full Code Here

Examples of org.geotools.xml.DOMParser

            root.setAttribute("xsi:schemaLocation",
                config.getNamespaceURI() + " " + config.getSchemaFileURL());
        }
       

        DOMParser parser = new DOMParser(config, document);

        return parser.parse();
    }
View Full Code Here

Examples of org.milyn.delivery.dom.DOMParser

    config = new SmooksResourceConfiguration();
        config.setResource(EDIReader.class.getName());
    // Set the mapping config on the resource config...
        config.setParameter(EDIReader.MODEL_CONFIG_KEY, TEST_XML_MAPPING_XML_URI);

    DOMParser parser;

    // Create 1st parser using the config, and run a parse through it...
    parser = new DOMParser(smooks.createExecutionContext(), config);
    parser.parse(new StreamSource(new ByteArrayInputStream(input)));

    // Check make sure the parsed and validated model was cached...
    Hashtable mappingTable = EDIReader.getMappingTable(smooks.getApplicationContext());
    assertNotNull("No mapping table in context!", mappingTable);

        EdifactModel mappingModel_request1 = (EdifactModel) mappingTable.get(config);
        assertNotNull("No mapping model in mapping table!", mappingModel_request1);

    // Create 2nd parser using the same config, and run a parse through it...
    parser = new DOMParser(smooks.createExecutionContext(), config);
    parser.parse(new StreamSource(new ByteArrayInputStream(input)));

    // Make sure the cached model was used on the 2nd parse...
    assertEquals("Not the same model instance => cache not working properly!", mappingModel_request1, (EdifactModel) mappingTable.get(config));
  }
View Full Code Here

Examples of sos.scheduler.editor.app.DomParser

      org.eclipse.swt.custom.CTabItem currentTab  = MainWindow.getContainer().getCurrentTab();
      if(currentTab != null && currentTab.getData("ftp_title") != null &&
          currentTab.getData("ftp_title").toString().length()>0) {

        String remoteDir = currentTab.getData("ftp_remote_directory").toString();
        DomParser currdom = MainWindow.getSpecifiedDom();
        if(currdom == null)
          return;

        if( currdom instanceof SchedulerDom && ((SchedulerDom)currdom).isDirectory()) {       
          remoteDir = remoteDir + "/" + new File(xmlFilename).getName();
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.