But parseInt isn't the best solution for this. parseInt gets the first integer from a string, and that's not always what you need. Here are some proofs:
code:
parseInt("85") -> 85 //parseInt finds the integer 85.
parseInt("85.999") -> 85 //parseInt searches until a non-decimal or period is found, and thus only finds 85.
parseInt(" 85.999") -> 85 //parseInt searches from the first non-whitespace character, and finds 85.
parseInt("a85.999") -> NaN //parseInt returns NaN if the first character is not a decimal or a white-space character.
Thus, if you have decimals in your "textual number", parseInt will discard them. However, parseInt is a good choice to convert from numeric systems to the decimal system. Like:
code:
parseInt("0xFF", 16) -> 255 //From hexadecimal to decimal
parseInt("100", 8) -> 64 //From octal to decimal
parseInt("1010", 2) -> 10 //From binary to decimal
Of course, in this case you are allowed to choose, since you expect that the XML contains only integers. But personally, I rely more on the type conversions of JScript than on parseInt, especially because parseInt does more than you actually need.