Search Results

Search found 3176 results on 128 pages for 'parsing'.

Page 78/128 | < Previous Page | 74 75 76 77 78 79 80 81 82 83 84 85  | Next Page >

  • Can't parse XML from AJAX response.

    - by Pavel
    Hi everyone. I'm having some problems with parsing the xml response from my ajax script. The XML looks like this: <IMAGE> <a href="address"> <img width="300" height="300" src="image.png class="image" alt="" title="LINKING"/> </a> </IMAGE> <LINK> www.address.com </LINK> <TITLE> This <i>is title</i> </TITLE> <EXCERPT> <p> And some excerpt </p> </EXCERPT> The code for js looks like this. function loadTab(id) { if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { xmlDoc=xmlhttp.responseXML; var title=""; var image=""; x=xmlDoc.getElementsByTagName("TITLE"); for (i=0;i<1;i++) { title=title + x[i].childNodes[0].nodeValue; } document.getElementById("ntt").innerHTML=title; x1=xmlDoc.getElementsByTagName("IMAGE"); for (j=0;j<1;j++) { image=image + x1[j].childNodes[0].nodeValue; } document.getElementById("nttI").innerHTML=image; } } var url = 'http://www.factmag.com/staging/page/?id='+id; xmlhttp.open("GET",url,true); xmlhttp.send(); } When I'm parsing it it pulls out the title but not the IMAGE tag contents. What I'm doing wrong? Can someone please tell me? Thanks in advance!

    Read the article

  • File Operations in Java

    - by Amir Rachum
    I'm working on a small application in Java that takes a directory structure and renames the files according to a certain format, after parsing the original name. What is the best Java class / methodology to use in order to facilitate these file operations? Edit: the question is only regarding the file operations part, I got the "getting the formatted name" down :)

    Read the article

  • How to pass non-fatal warnings from a library

    - by wRAR
    A library function parses a file and returns an object. If a parser encounters unknown data, missing values etc., it shouldn't throw an exception and stop parsing (because this is not fatal), but there should be a way to pass information about these things to a caller (so that warnings can be displayed in the UI, for example). How can these warning be returned? I'm thinking of passing a callback function/object into the library, are there any other possible solutions?

    Read the article

  • Benchmark of Java Try/Catch Block

    - by hectorg87
    I know that going into a catch block has some significance cost when executing a program, however, I was wondering if entering a try{} block also had any impact so I started looking for an answer in google with many opinions, but no benchmarking at all. Some answers I found were: Java try/catch performance, is it recommended to keep what is inside the try clause to a minimum? Try Catch Performance Java Java try catch blocks However they didn't answer my question with facts, so I decided to try it for myself. Here's what I did. I have a csv file with this format: host;ip;number;date;status;email;uid;name;lastname;promo_code; where everything after status is optional and will not even have the corresponding ; , so when parsing a validation has to be done to see if the value is there, here's where the try/catch issue came to my mind. The current code that in inherited in my company does this: StringTokenizer st=new StringTokenizer(line,";"); String host = st.nextToken(); String ip = st.nextToken(); String number = st.nextToken(); String date = st.nextToken(); String status = st.nextToken(); String email = ""; try{ email = st.nextToken(); }catch(NoSuchElementException e){ email = ""; } and it repeats what it's done for email with uid, name, lastname and promo_code. and I changed everything to: if(st.hasMoreTokens()){ email = st.nextToken(); } and in fact it performs faster. When parsing a file that doesn't have the optional columns. Here are the average times: --- Trying:122 milliseconds --- Checking:33 milliseconds however, here's what confused me and the reason I'm asking: When running the example with values for the optional columns in all 8000 lines of the CSV, the if() version still performs better than the try/catch version, so my question is Does really the try block does not have any performance impact on my code? The average times for this example are: --- Trying:105 milliseconds --- Checking:43 milliseconds Can somebody explain what's going on here? Thanks a lot

    Read the article

  • Main Memory Database with C++ Interface

    - by myahya
    I am looking for a main memory database with a C++ interface. I am looking for a database with a programmatic query interface and preferably one that works with native C++ types. SQLLite, for example, takes queries as string and needs to perform parsing ... which is time consuming. The operations I am looking for are: Creation of tables of arbitrary dimensions (number of attributes) capable of storing integer types. Support for insertion, deletion, selection, projection and (not a priority) joins.

    Read the article

  • Is it possible to use the CommonJS libraries yet?

    - by Jon Winstanley
    I am interested in getting started with CommonJS. With JavaScript frameworks getting faster all the time, and parsing engines and compilers making JavaScript incredibly quick, it is surprising that a project such as CommonJS has not been initiated sooner. What steps are involved in getting a test project up and running with what has been created so far?

    Read the article

  • Python urlparse, correct or incorrect?

    - by omfgroflmao
    Python's urlparse function parses an url into six components (scheme, netloc, path and others stuff) Now I've found that parsing "example.com/path/file.ext" return no netloc but a path "example.com/path/file.ext". Should't it be netloc = "example.com" and path = "/path/file.ext"? Do we really need a "://" to determine wether or not a netloc exists? Python's ticket: http://bugs.python.org/issue8284

    Read the article

  • I want increase the scrolling performance in my table view with images in iphone?

    - by Warrior
    I am new to iphone development.I am parsing a xml and display the title,date,contents and image in the cell,Now the scrolling is not smooth, it struck.How can i increase it.I have already applied lazy loading in another view, i am not able to apply in the new view.So how can i increase the scrolling performance.Can i check for any condition that if image is already loaded in the image view,if so i can stop once again the loading of image view. Please help me out.Thanks.

    Read the article

  • GWT + XML documents with namespaces

    - by chris_l
    I'd like to get a quick overview of available solutions (libraries, ...) that allow me to work with XML documents with namespaces on a DOM level - in GWT's client side. Additionally, I'm looking for an XPath solution that can work on that DOM (even if it requires writing my own XPath Navigator). XML parsing and serialization isn't necessary on the client - this can be done on the server.

    Read the article

  • Query parameter using JS framework ?

    - by Maxim Veksler
    Hi, I seem to not be able to find implementation from the common Ajax libraries (JQuery, mootools, prototypejs...) that would allow the operation of parsing the window.location.href for request parameter. I would expect something like: $P{"param1"} == "param1_value" Am I missing something? p.s. The web does contains implementation examples for such operations

    Read the article

  • Download HTML from website URL in objective C (iphone)

    - by Jonathan
    I'm trying to get the HTML data of a website so that I can parse it. I have parsing bit sorted out but using the following code doesn't seem to work: NSData *data = [[NSData alloc] initWithContentsOfURL: [NSURL URLWithString:@"http://thewebsite.net"]]; Is this the way I should be doing it or is there another way?

    Read the article

  • What is the most robust way of determining the current codepage from a shell script?

    - by rewbs
    Hi all, I'd like to determine the environment's current codepage at runtime from a Unix shell script. What's the most reliable way of doing this? I'm looking into parsing environment variable $LC_ALL, but it isn't always set to a useful value, and its format seems to vary (can be <locale, or <locale.<code page, or <locale.<code page@<modifier etc...). Is there a better way? I'm essentially after a shell equivalent of what I'd get if I called nl_langinfo(CODESET) from C.

    Read the article

  • Get info about Http Post field order

    - by Eugene
    Is it possible to get information about post field order in ASP.NET? I need to know whether some field was the last one or not. I know I can do it through Request.InputStream, but I’m looking for a more high level solution without manually stream parsing. Generally I’m doing testing of http post sent by my application and there is no practical usage for this in ASP.NET.

    Read the article

  • How to determine whether there is date in the string or not with different date format ?

    - by Harikrishna
    I am parsing table information from the html table.Now I want to check whether there is date in the records for one particular column.Means I want to check whether there is date in the string or not .And date can be in different format like the string can be FUTIDX 26FEB2009 NIFTY 0 -- There is date in the string. FUTIDX MINIFTY 30 Jul 2009 -- There is date in the string. FUTSTK ONGC 27 Mar 2008 -- There is date in the string. How can I do that ?

    Read the article

  • How do I do OuterHTML in firefox?

    - by SLC
    Part of my code I get the OuterHTML propery "<LI onclick="TabClicked(this, 'SearchName', 'TabGroup1');">Name " so I can do stuff involing parsing it. There is no OuterHTML property in javascript on firefox though and I can't find an alternative way to get this string. Ideas?

    Read the article

  • Get document from Javascript HREFS

    - by Jojo
    Hello Everyone, I am currently designing a focused webcrawler. I have it tested with some websites until i encountered below anchor ("the <a href="..."): href="javascript: openDocument('DATA//PCP200803.pdf');" My html parsing routine results to javascript: openDocument('DATA//PCP200803.pdf'); Does anyone have any idea on how to download the referenced document? Thanks a lot.

    Read the article

< Previous Page | 74 75 76 77 78 79 80 81 82 83 84 85  | Next Page >