Xmla.js 350 KB
Newer Older
Boris Kocherov's avatar
Boris Kocherov committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769 5770 5771 5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782 5783 5784 5785 5786 5787 5788 5789 5790 5791 5792 5793 5794 5795 5796 5797 5798 5799 5800 5801 5802 5803 5804 5805 5806 5807 5808 5809 5810 5811 5812 5813 5814 5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830 5831 5832 5833 5834 5835 5836 5837 5838 5839 5840 5841 5842 5843 5844 5845 5846 5847 5848 5849 5850 5851 5852 5853 5854 5855 5856 5857 5858 5859 5860 5861 5862 5863 5864 5865 5866 5867 5868 5869 5870 5871 5872 5873 5874 5875 5876 5877 5878 5879 5880 5881 5882 5883 5884 5885 5886 5887 5888 5889 5890 5891 5892 5893 5894 5895 5896 5897 5898 5899 5900 5901 5902 5903 5904 5905 5906 5907 5908 5909 5910 5911 5912 5913 5914 5915 5916 5917 5918 5919 5920 5921 5922 5923 5924 5925 5926 5927 5928 5929 5930 5931 5932 5933 5934 5935 5936 5937 5938 5939 5940 5941 5942 5943 5944 5945 5946 5947 5948 5949 5950 5951 5952 5953 5954 5955 5956 5957 5958 5959 5960 5961 5962 5963 5964 5965 5966 5967 5968 5969 5970 5971 5972 5973 5974 5975 5976 5977 5978 5979 5980 5981 5982 5983 5984 5985 5986 5987 5988 5989 5990 5991 5992 5993 5994 5995 5996 5997 5998 5999 6000 6001 6002 6003 6004 6005 6006 6007 6008 6009 6010 6011 6012 6013 6014 6015 6016 6017 6018 6019 6020 6021 6022 6023 6024 6025 6026 6027 6028 6029 6030 6031 6032 6033 6034 6035 6036 6037 6038 6039 6040 6041 6042 6043 6044 6045 6046 6047 6048 6049 6050 6051 6052 6053 6054 6055 6056 6057 6058 6059 6060 6061 6062 6063 6064 6065 6066 6067 6068 6069 6070 6071 6072 6073 6074 6075 6076 6077 6078 6079 6080 6081 6082 6083 6084 6085 6086 6087 6088 6089 6090 6091 6092 6093 6094 6095 6096 6097 6098 6099 6100 6101 6102 6103 6104 6105 6106 6107 6108 6109 6110 6111 6112 6113 6114 6115 6116 6117 6118 6119 6120 6121 6122 6123 6124 6125 6126 6127 6128 6129 6130 6131 6132 6133 6134 6135 6136 6137 6138 6139 6140 6141 6142 6143 6144 6145 6146 6147 6148 6149 6150 6151 6152 6153 6154 6155 6156 6157 6158 6159 6160 6161 6162 6163 6164 6165 6166 6167 6168 6169 6170 6171 6172 6173 6174 6175 6176 6177 6178 6179 6180 6181 6182 6183 6184 6185 6186 6187 6188 6189 6190 6191 6192 6193 6194 6195 6196 6197 6198 6199 6200 6201 6202 6203 6204 6205 6206 6207 6208 6209 6210 6211 6212 6213 6214 6215 6216 6217 6218 6219 6220 6221 6222 6223 6224 6225 6226 6227 6228 6229 6230 6231 6232 6233 6234 6235 6236 6237 6238 6239 6240 6241 6242 6243 6244 6245 6246 6247 6248 6249 6250 6251 6252 6253 6254 6255 6256 6257 6258 6259 6260 6261 6262 6263 6264 6265 6266 6267 6268 6269 6270 6271 6272 6273 6274 6275 6276 6277 6278 6279 6280 6281 6282 6283 6284 6285 6286 6287 6288 6289 6290 6291 6292 6293 6294 6295 6296 6297 6298 6299 6300 6301 6302 6303 6304 6305 6306 6307 6308 6309 6310 6311 6312 6313 6314 6315 6316 6317 6318 6319 6320 6321 6322 6323 6324 6325 6326 6327 6328 6329 6330 6331 6332 6333 6334 6335 6336 6337 6338 6339 6340 6341 6342 6343 6344 6345 6346 6347 6348 6349 6350 6351 6352 6353 6354 6355 6356 6357 6358 6359 6360 6361 6362 6363 6364 6365 6366 6367 6368 6369 6370 6371 6372 6373 6374 6375 6376 6377 6378 6379 6380 6381 6382 6383 6384 6385 6386 6387 6388 6389 6390 6391 6392 6393 6394 6395 6396 6397 6398 6399 6400 6401 6402 6403 6404 6405 6406 6407 6408 6409 6410 6411 6412 6413 6414 6415 6416 6417 6418 6419 6420 6421 6422 6423 6424 6425 6426 6427 6428 6429 6430 6431 6432 6433 6434 6435 6436 6437 6438 6439 6440 6441 6442 6443 6444 6445 6446 6447 6448 6449 6450 6451 6452 6453 6454 6455 6456 6457 6458 6459 6460 6461 6462 6463 6464 6465 6466 6467 6468 6469 6470 6471 6472 6473 6474 6475 6476 6477 6478 6479 6480 6481 6482 6483 6484 6485 6486 6487 6488 6489 6490 6491 6492 6493 6494 6495 6496 6497 6498 6499 6500 6501 6502 6503 6504 6505 6506 6507 6508 6509 6510 6511 6512 6513 6514 6515 6516 6517 6518 6519 6520 6521 6522 6523 6524 6525 6526 6527 6528 6529 6530 6531 6532 6533 6534 6535 6536 6537 6538 6539 6540 6541 6542 6543 6544 6545 6546 6547 6548 6549 6550 6551 6552 6553 6554 6555 6556 6557 6558 6559 6560 6561 6562 6563 6564 6565 6566 6567 6568 6569 6570 6571 6572 6573 6574 6575 6576 6577 6578 6579 6580 6581 6582 6583 6584 6585 6586 6587 6588 6589 6590 6591 6592 6593 6594 6595 6596 6597 6598 6599 6600 6601 6602 6603 6604 6605 6606 6607 6608 6609 6610 6611 6612 6613 6614 6615 6616 6617 6618 6619 6620 6621 6622 6623 6624 6625 6626 6627 6628 6629 6630 6631 6632 6633 6634 6635 6636 6637 6638 6639 6640 6641 6642 6643 6644 6645 6646 6647 6648 6649 6650 6651 6652 6653 6654 6655 6656 6657 6658 6659 6660 6661 6662 6663 6664 6665 6666 6667 6668 6669 6670 6671 6672 6673 6674 6675 6676 6677 6678 6679 6680 6681 6682 6683 6684 6685 6686 6687 6688 6689 6690 6691 6692 6693 6694 6695 6696 6697 6698 6699 6700 6701 6702 6703 6704 6705 6706 6707 6708 6709 6710 6711 6712 6713 6714 6715 6716 6717 6718 6719 6720 6721 6722 6723 6724 6725 6726 6727 6728 6729 6730 6731 6732 6733 6734 6735 6736 6737 6738 6739 6740 6741 6742 6743 6744 6745 6746 6747 6748 6749 6750 6751 6752 6753 6754 6755 6756 6757 6758 6759 6760 6761 6762 6763 6764 6765 6766 6767 6768 6769 6770 6771 6772 6773 6774 6775 6776 6777 6778 6779 6780 6781 6782 6783 6784 6785 6786 6787 6788 6789 6790 6791 6792 6793 6794 6795 6796 6797 6798 6799 6800 6801 6802 6803 6804 6805 6806 6807 6808 6809 6810 6811 6812 6813 6814 6815 6816 6817 6818 6819 6820 6821 6822 6823 6824 6825 6826 6827 6828 6829 6830 6831 6832 6833 6834 6835 6836 6837 6838 6839 6840 6841 6842 6843 6844 6845 6846 6847 6848 6849 6850 6851 6852 6853 6854 6855 6856 6857 6858 6859 6860 6861 6862 6863 6864 6865 6866 6867 6868 6869 6870 6871 6872 6873 6874 6875 6876 6877 6878 6879 6880 6881 6882 6883 6884 6885 6886 6887 6888 6889 6890 6891 6892 6893 6894 6895 6896 6897 6898 6899 6900 6901 6902 6903 6904 6905 6906 6907 6908 6909 6910 6911 6912 6913 6914 6915 6916 6917 6918 6919 6920 6921 6922 6923 6924 6925 6926 6927 6928 6929 6930 6931 6932 6933 6934 6935 6936 6937 6938 6939 6940 6941 6942 6943 6944 6945 6946 6947 6948 6949 6950 6951 6952 6953 6954 6955 6956 6957 6958 6959 6960 6961 6962 6963 6964 6965 6966 6967 6968 6969 6970 6971 6972 6973 6974 6975 6976 6977 6978 6979 6980 6981 6982 6983 6984 6985 6986 6987 6988 6989 6990 6991 6992 6993 6994 6995 6996 6997 6998 6999 7000 7001 7002 7003 7004 7005 7006 7007 7008 7009 7010 7011 7012 7013 7014 7015 7016 7017 7018 7019 7020 7021 7022 7023 7024 7025 7026 7027 7028 7029 7030 7031 7032 7033 7034 7035 7036 7037 7038 7039 7040 7041 7042 7043 7044 7045 7046 7047 7048 7049 7050 7051 7052 7053 7054 7055 7056 7057 7058 7059 7060 7061 7062 7063 7064 7065 7066 7067 7068 7069 7070 7071 7072 7073 7074 7075 7076 7077 7078 7079 7080 7081 7082 7083 7084 7085 7086 7087 7088 7089 7090 7091 7092 7093 7094 7095 7096 7097 7098 7099 7100 7101 7102 7103 7104 7105 7106 7107 7108 7109 7110 7111 7112 7113 7114 7115 7116 7117 7118 7119 7120 7121 7122 7123 7124 7125 7126 7127 7128 7129 7130 7131 7132 7133 7134 7135 7136 7137 7138 7139 7140 7141 7142 7143 7144 7145 7146 7147 7148 7149 7150 7151 7152 7153 7154 7155 7156 7157 7158 7159 7160 7161 7162 7163 7164 7165 7166 7167 7168 7169 7170 7171 7172 7173 7174 7175 7176 7177 7178 7179 7180 7181 7182 7183 7184 7185 7186 7187 7188 7189 7190 7191 7192 7193 7194 7195 7196 7197 7198 7199 7200 7201 7202 7203 7204 7205 7206 7207 7208 7209 7210 7211 7212 7213 7214 7215 7216 7217 7218 7219 7220 7221 7222 7223 7224 7225 7226 7227 7228 7229 7230 7231 7232 7233 7234 7235 7236 7237 7238 7239 7240 7241 7242 7243 7244 7245 7246 7247 7248 7249 7250 7251 7252 7253 7254 7255 7256 7257 7258 7259 7260 7261 7262 7263 7264 7265 7266 7267 7268 7269 7270 7271 7272 7273 7274 7275 7276 7277 7278 7279 7280 7281 7282 7283 7284 7285 7286 7287 7288 7289 7290 7291 7292 7293 7294 7295 7296 7297 7298 7299 7300 7301 7302 7303 7304 7305 7306 7307 7308 7309 7310 7311 7312 7313 7314 7315 7316 7317 7318 7319 7320 7321 7322 7323 7324 7325 7326 7327 7328 7329 7330 7331 7332 7333 7334 7335 7336 7337 7338 7339 7340 7341 7342 7343 7344 7345 7346 7347 7348 7349 7350 7351 7352 7353 7354 7355 7356 7357 7358 7359 7360 7361 7362 7363 7364 7365 7366 7367 7368 7369 7370 7371 7372 7373 7374 7375 7376 7377 7378 7379 7380 7381 7382 7383 7384 7385 7386 7387 7388 7389 7390 7391 7392 7393 7394 7395 7396 7397 7398 7399 7400 7401 7402 7403 7404 7405 7406 7407 7408 7409 7410 7411 7412 7413 7414 7415 7416 7417 7418 7419 7420 7421 7422 7423 7424 7425 7426 7427 7428 7429 7430 7431 7432 7433 7434 7435 7436 7437 7438 7439 7440 7441 7442 7443 7444 7445 7446 7447 7448 7449 7450 7451 7452 7453 7454 7455 7456 7457 7458 7459 7460 7461 7462 7463 7464 7465 7466 7467 7468 7469 7470 7471 7472 7473 7474 7475 7476 7477 7478 7479 7480 7481 7482 7483 7484 7485 7486 7487 7488 7489 7490 7491 7492 7493 7494 7495 7496 7497 7498 7499 7500 7501 7502 7503 7504 7505 7506 7507 7508 7509 7510 7511 7512 7513 7514 7515 7516 7517 7518 7519 7520 7521 7522 7523 7524 7525 7526 7527 7528 7529 7530 7531 7532 7533 7534 7535 7536 7537 7538 7539 7540 7541 7542 7543 7544 7545 7546 7547 7548 7549 7550 7551 7552 7553 7554 7555 7556 7557 7558 7559 7560 7561 7562 7563 7564 7565 7566 7567 7568 7569 7570 7571 7572 7573 7574 7575 7576 7577 7578 7579 7580 7581 7582 7583 7584 7585 7586 7587 7588 7589 7590 7591 7592 7593 7594 7595 7596 7597 7598 7599 7600 7601 7602 7603 7604 7605 7606 7607 7608 7609 7610 7611 7612 7613 7614 7615 7616 7617 7618 7619 7620 7621 7622 7623 7624 7625 7626 7627 7628 7629 7630 7631 7632 7633 7634 7635 7636 7637 7638 7639 7640 7641 7642 7643 7644 7645 7646 7647 7648 7649 7650 7651 7652 7653 7654 7655 7656 7657 7658 7659 7660 7661 7662 7663 7664 7665 7666 7667 7668 7669 7670 7671 7672 7673 7674 7675 7676 7677 7678 7679 7680 7681 7682 7683 7684 7685 7686 7687 7688 7689 7690 7691 7692 7693 7694 7695 7696 7697 7698 7699 7700 7701 7702 7703 7704 7705 7706 7707 7708 7709 7710 7711 7712 7713 7714 7715 7716 7717 7718 7719 7720 7721 7722 7723 7724 7725 7726 7727 7728 7729 7730 7731 7732 7733 7734 7735 7736 7737 7738 7739 7740 7741 7742 7743 7744 7745 7746 7747 7748 7749 7750 7751 7752 7753 7754 7755 7756 7757 7758 7759 7760 7761 7762 7763 7764 7765 7766 7767 7768 7769 7770 7771 7772 7773 7774 7775 7776 7777 7778 7779 7780 7781 7782 7783 7784 7785 7786 7787 7788 7789 7790 7791 7792 7793 7794 7795 7796 7797 7798 7799 7800 7801 7802 7803 7804 7805 7806 7807 7808 7809 7810 7811 7812 7813 7814 7815 7816 7817 7818 7819 7820 7821 7822 7823 7824 7825 7826 7827 7828 7829 7830 7831 7832 7833 7834 7835 7836 7837 7838 7839 7840 7841 7842 7843 7844 7845 7846 7847 7848 7849 7850 7851 7852 7853 7854 7855 7856 7857 7858 7859 7860 7861 7862 7863 7864 7865 7866 7867 7868 7869 7870 7871 7872 7873 7874 7875 7876 7877 7878 7879 7880 7881 7882 7883 7884 7885 7886 7887 7888 7889 7890 7891 7892 7893 7894 7895 7896 7897 7898 7899 7900 7901 7902 7903 7904 7905 7906 7907 7908 7909 7910 7911 7912 7913 7914 7915 7916 7917 7918 7919 7920 7921 7922 7923 7924 7925 7926 7927 7928 7929 7930 7931 7932 7933 7934 7935 7936 7937 7938 7939 7940 7941 7942 7943 7944 7945 7946 7947 7948 7949 7950 7951 7952 7953 7954 7955 7956 7957 7958 7959 7960 7961 7962 7963 7964 7965 7966 7967 7968 7969 7970 7971 7972 7973 7974 7975 7976 7977 7978 7979 7980 7981 7982 7983 7984 7985 7986 7987 7988 7989 7990 7991 7992 7993 7994 7995 7996 7997 7998 7999 8000 8001 8002 8003 8004 8005 8006 8007 8008 8009 8010 8011 8012 8013 8014 8015 8016 8017 8018 8019 8020 8021 8022 8023 8024 8025 8026 8027 8028 8029 8030 8031 8032 8033 8034 8035 8036 8037 8038 8039 8040 8041 8042 8043 8044 8045 8046 8047 8048 8049 8050 8051 8052 8053 8054 8055 8056 8057 8058 8059 8060 8061 8062 8063 8064 8065 8066 8067 8068 8069 8070 8071 8072 8073 8074 8075 8076 8077 8078 8079 8080 8081 8082 8083 8084 8085 8086 8087 8088 8089 8090 8091 8092 8093 8094 8095 8096 8097 8098 8099 8100 8101 8102 8103 8104 8105 8106 8107 8108 8109 8110 8111 8112 8113 8114 8115 8116 8117 8118 8119 8120 8121 8122 8123 8124 8125 8126 8127 8128 8129 8130 8131 8132 8133 8134 8135 8136 8137 8138 8139 8140 8141 8142 8143 8144 8145 8146 8147 8148 8149 8150 8151 8152 8153 8154 8155 8156 8157 8158 8159 8160 8161 8162 8163 8164 8165 8166 8167 8168 8169 8170 8171 8172 8173 8174 8175 8176 8177 8178 8179 8180 8181 8182 8183 8184 8185 8186 8187 8188 8189 8190 8191 8192 8193 8194 8195 8196 8197 8198 8199 8200 8201 8202 8203 8204 8205 8206 8207 8208 8209 8210 8211 8212 8213 8214 8215 8216 8217 8218 8219 8220 8221 8222 8223 8224 8225 8226 8227 8228 8229 8230 8231 8232 8233 8234 8235 8236 8237 8238 8239 8240 8241 8242 8243 8244 8245 8246 8247 8248 8249 8250 8251 8252 8253 8254 8255 8256 8257 8258 8259 8260 8261 8262 8263 8264 8265 8266 8267 8268 8269 8270 8271 8272 8273 8274 8275 8276 8277 8278 8279 8280 8281 8282 8283 8284 8285 8286 8287 8288 8289 8290 8291 8292 8293 8294 8295 8296 8297 8298 8299 8300 8301 8302 8303 8304 8305 8306 8307 8308 8309 8310 8311 8312 8313 8314 8315 8316 8317 8318 8319 8320 8321 8322 8323 8324 8325 8326 8327 8328 8329 8330 8331 8332 8333 8334 8335 8336 8337 8338 8339 8340 8341 8342 8343 8344 8345 8346 8347 8348 8349 8350 8351 8352 8353 8354 8355 8356 8357 8358 8359 8360 8361 8362 8363 8364 8365 8366 8367 8368 8369 8370 8371 8372 8373 8374 8375 8376 8377 8378 8379 8380 8381 8382 8383 8384 8385 8386 8387 8388 8389 8390 8391 8392 8393 8394 8395 8396 8397 8398 8399 8400 8401 8402 8403 8404 8405 8406 8407 8408 8409 8410 8411 8412 8413 8414 8415 8416 8417 8418 8419 8420 8421 8422 8423 8424 8425 8426 8427 8428 8429 8430 8431 8432 8433 8434 8435 8436 8437 8438 8439 8440 8441 8442 8443 8444 8445 8446 8447 8448 8449 8450 8451 8452 8453 8454 8455 8456 8457 8458 8459 8460 8461 8462 8463 8464 8465 8466 8467 8468 8469 8470 8471 8472 8473 8474 8475 8476 8477 8478 8479 8480 8481 8482 8483 8484 8485 8486 8487 8488 8489 8490 8491 8492 8493 8494 8495 8496 8497 8498 8499 8500 8501 8502 8503 8504 8505 8506 8507 8508 8509 8510 8511
/*
    Copyright 2009 - 2016 Roland Bouman
    contact: Roland.Bouman@gmail.com ~ http://rpbouman.blogspot.com/ ~ https://github.com/rpbouman/xmla4js
    twitter: @rolandbouman

    This is xmla4js - a stand-alone javascript library for working with "XML for Analysis".
    XML for Analysis (XML/A) is a vendor-neutral industry-standard protocol for OLAP services over HTTP.
    Xmla4js is cross-browser and node.js compatible and enables web-browser-based analytical business intelligence applications.
    Xmla4js can be loaded as a common js or amd module.

    This file contains human-readable javascript source along with the YUI Doc compatible annotations.
    Note: some portions of the API documentation were adopted from the original XML/A specification.
    I believe that this constitutes fair use, but if you have reason to believe that the documentation
    violates any copyright, or is otherwise incompatible with the LGPL license please contact me.

    Include this in your web-pages for debug and development purposes only.
    For production purposes, consider using the minified/obfuscated versions in the /js directory.

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

*/
/**
*
*  This is xmla4js - a stand-alone javascript library for working with "XML for Analysis".
*  XML for Analysis (XML/A) is a vendor-neutral industry-standard protocol for OLAP services over HTTP.
*  Xmla4js is cross-browser and node.js compatible and enables web-browser-based analytical business intelligence applications.
*  Xmla4js can be loaded as a common js or amd module.
*  @module xmla
*  @title Xmla
*/
(function(window) {
var Xmla,
    _soap = "http://schemas.xmlsoap.org/soap/",
    _xmlnsSOAPenvelope = _soap + "envelope/",
    _xmlnsSOAPenvelopePrefix = "SOAP-ENV",
    _xmlnsIsSOAPenvelope = "xmlns:" + _xmlnsSOAPenvelopePrefix + "=\"" + _xmlnsSOAPenvelope + "\"",
    _SOAPencodingStyle = _xmlnsSOAPenvelopePrefix + ":encodingStyle=\"" + _soap + "encoding/\"",
    _ms = "urn:schemas-microsoft-com:",
    _xmlnsXmla = _ms + "xml-analysis",
    _xmlnsIsXmla = "xmlns=\"" + _xmlnsXmla + "\"",
    _xmlnsSQLPrefix = "sql",
    _xmlnsSQL = _ms + "xml-sql",
    _xmlnsSchema = "http://www.w3.org/2001/XMLSchema",
    _xmlnsSchemaPrefix = "xsd",
    _xmlnsSchemaInstance = "http://www.w3.org/2001/XMLSchema-instance",
    _xmlnsSchemaInstancePrefix = "xsi",
    _xmlnsRowset = _xmlnsXmla + ":rowset",
    _xmlnsDataset = _xmlnsXmla + ":mddataset"
;

var _createXhr;
if (window.XMLHttpRequest) _createXhr = function(){
    return new window.XMLHttpRequest();
}
else
if (window.ActiveXObject) _createXhr = function(){
    return new window.ActiveXObject("MSXML2.XMLHTTP.3.0");
}
else
if (typeof(require)==="function") _createXhr = function(){
    var xhr;
    (xhr = function() {
        this.readyState = 0;
        this.status = -1;
        this.statusText = "Not sent";
        this.responseText = null;
    }).prototype = {
        changeStatus: function(statusCode, readyState){
            this.status = statusCode;
            this.statusText = statusCode;
            this.readyState = readyState;
            if (_isFun(this.onreadystatechange)) {
                this.onreadystatechange.call(this, this);
            }
        },
        open: function(method, url, async, username, password){
            if (async !== true) {
                throw "Synchronous mode not supported in this environment."
            }
            var options = require("url").parse(url);
            if (options.host.length > options.hostname.length) {
                //for some reason, host includes the port, this confuses http.request
                //so, overwrite host with hostname (which does not include the port)
                //and kill hostname so that we end up with only host.
                options.host = options.hostname;
                delete options.hostname;
            }
            if (!options.path && options.pathname) {
                //old versions of node may not give the path, so we need to create it ourselves.
                options.path = options.pathname + (options.search || "");
            }
            options.method = "POST";//method;
            options.headers = {};
            if (username) {
              options.headers.Authorization = "Basic " + (new Buffer(username + ":" + (password || ""))).toString("base64");
            }
            this.options = options;
            this.changeStatus(-1, 1);
        },
        send: function(data){
            var me = this,
                options = me.options,
                client
            ;
            options.headers["Content-Length"] = Buffer.byteLength(data);
            switch (options.protocol) {
                case "http:":
                    client = require("http");
                    if (!options.port) options.port = "80";
                    break;
                case "https:":
                    client = require("https");
                    if (!options.port) options.port = "443";
                    break;
                default:
                    throw "Unsupported protocol " + options.protocol;
            }
            me.responseText = "";
            var request = client.request(options, function(response){
                response.setEncoding("utf8");
                me.changeStatus(-1, 2);
                response.on("data", function(chunk){
                    me.responseText += chunk;
                    me.changeStatus(response.statusCode, 3);
                });
                response.on("error", function(error){
                    me.changeStatus(response.statusCode, 4);
                });
                response.on("end", function(){
                    me.changeStatus(response.statusCode, 4);
                });
            });
            request.on("error", function(e){
                me.responseText = e;
                me.changeStatus(500, 4);
            });
            /* does not work, maybe only not in old node versions.
            request.setTimeout(this.timeout, function(){
                request.abort();
                me.changeStatus(500, 0);
            });
            */
            if (data) request.write(data);
            request.end();
        },
        setRequestHeader: function(name, value){
            this.options.headers[name] = value;
        }
    };
    return new xhr();
}
else Xmla.Exception._newError(
    "ERROR_INSTANTIATING_XMLHTTPREQUEST",
    "_ajax",
    null
)._throw();


function _ajax(options){
    var xhr, args, headers, header,
        handlerCalled = false,
        handler = function(){
            handlerCalled = true;
            switch (xhr.readyState){
                case 0:
                    if (_isFun(options.aborted)) {
                      options.aborted(xhr);
                    }
                    break;
                case 4:
                    if (xhr.status === 200) {
                      options.complete(xhr)
                    }
                    else {
                        var err = Xmla.Exception._newError(
                                "HTTP_ERROR",
                                "_ajax",
                                {
                                    request: options,
                                    status: this.status,
                                    statusText: this.statusText,
                                    xhr: xhr
                                }
                            )
                        //console.log(err);
                        //When I have an error in HTTP, this allows better debugging
                        //So made an extra call instead of _newError inside func call
                        options.error(err);
                    }
                break;
            }
        };

    xhr = _createXhr();
    args = ["POST", options.url, options.async];
    if (options.username && options.password) {
      args = args.concat([options.username, options.password]);
    }
    xhr.open.apply(xhr, args);
    //see http://www.w3.org/TR/XMLHttpRequest/#the-timeout-attribute
    if (!_isUnd(options.requestTimeout) && (options.async || !(window && window.document))) {
      xhr.timeout = options.requestTimeout;
    }
    xhr.onreadystatechange = handler;
    xhr.setRequestHeader("Accept", "text/xml, application/xml, application/soap+xml");
    xhr.setRequestHeader("Content-Type", "text/xml");
    if (headers = options.headers) {
      for (header in headers) {
        xhr.setRequestHeader(header, headers[header]);
      }
    }
    xhr.send(options.data);
    if (!options.async && !handlerCalled) {
      handler.call(xhr);
    }
    return xhr;
};

function _isUnd(arg){
    return typeof(arg)==="undefined";
};
function _isArr(arg){
    return arg && arg.constructor === Array;
};
function _isNum(arg){
    return typeof(arg)==="number";
};
function _isFun(arg){
    return typeof(arg)==="function";
};
function _isStr(arg) {
    return typeof(arg)==="string";
};
function _isObj(arg) {
    return arg && typeof(arg)==="object";
};
function _xmlEncode(value){
  var value;
  switch (typeof(value)) {
    case "string":
      value = value.replace(/\&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
      break;
    case "undefined":
      value = "";
      break;
    case "object":
      if (value === null) {
        value = "";
      }
  }
  return value;
};

function _decodeXmlaTagName(tagName) {
    return tagName.replace(/_x(\d\d\d\d)_/g, function(match, hex, offset){
        return String.fromCharCode(parseInt(hex, 16));
    });
}
//this is here to support (partial) dom interface on top of our own document implementation
//we don't need this in the browser, it's here when running in environments without a native xhr
//where the xhr object does not offer a DOM responseXML object.
function _getElements(parent, list, criteria){
    var childNodes = parent.childNodes;
    if (!childNodes) return list;
    for (var node, i = 0, n = childNodes.length; i < n; i++){
        node = childNodes[i];
        if (criteria && criteria.call(null, node) === true) list.push(node);
        _getElements(node, list, criteria);
    }
};

var _getElementsByTagName = function(node, tagName){
    var func;
    if ("getElementsByTagName" in node) {
        func = function(node, tagName) {
            return node.getElementsByTagName(tagName);
        };
    }
    else {
        var checkCriteria = function(node){
          if (node.nodeType !== 1) {
            return false;
          }
          var nodePrefix = (node.namespaceURI === "" ? "" : node.prefix);
          if (nodePrefix) {
            nodePrefix += ":";
          }
          var nodeName = nodePrefix + tagName;
          return nodeName === tagName;
        };
        func = function(node, tagName){
          var criteria;
          if (tagName === "*") {
            criteria = null;
          }
          else {
            criteria = checkCriteria;
          }

          var list = [];
          _getElements(node, list, criteria);

          return list;
        };
    }
    return (_getElementsByTagName = func)(node, tagName);
};

var _getElementsByTagNameNS = function(node, ns, prefix, tagName){
    var func;
    if ("getElementsByTagNameNS" in node) {
        func = function(node, ns, prefix, tagName) {
            return node.getElementsByTagNameNS(ns, tagName);
        };
    }
    else
    if ("getElementsByTagName" in node) {
        func = function(node, ns, prefix, tagName){
            return node.getElementsByTagName((prefix ? prefix + ":" : "") + tagName);
        };
    }
    else {
        func = function(node, ns, prefix, tagName){
            var list = [], criteria;
            if (tagName === "*") {
                criteria = function(_node){
                    return (_node.nodeType === 1 && _node.namespaceURI === ns);
                };
            }
            else {
                criteria = function(_node){
                    return (_node.nodeType === 1 && _node.namespaceURI === ns && _node.nodeName === tagName);
                };
            }
            _getElements(node, list, criteria);
            return list;
        };
    }
    _getElementsByTagNameNS = func;
    return func(node, ns, prefix, tagName);
};

var _getAttributeNS = function(element, ns, prefix, attributeName) {
    var func;
    if ("getAttributeNS" in element) {
        func = function(element, ns, prefix, attributeName){
            return element.getAttributeNS(ns, attributeName);
        };
    }
    else
    if ("getAttribute" in element) {
        func = function(element, ns, prefix, attributeName){
            return element.getAttribute((prefix ? prefix + ":" : "") + attributeName);
        };
    }
    else {
        func = function(element, namespaceURI, prefix, attributeName){
            var attributes = element.attributes;
            if (!attributes) return null;
            for (var attr, i = 0, n = attributes.length; i < n; i++) {
                attr = attributes[i];
                if (attr.namespaceURI === namespaceURI && attr.nodeName === attributeName) return attr.value;
            }
            return null;
        };
    }
    return (_getAttributeNS = func)(element, ns, prefix, attributeName);
};

var _getAttribute = function(node, name){
    var func;
    if ("getAttribute" in node) {
        func = function(node, name){
            return node.getAttribute(name);
        };
    }
    else {
        func = function(node, name) {
            var attributes = node.attributes;
            if (!attributes) return null;
            for (var attr, i = 0, n = attributes.length; i < n; i++) {
                attr = attributes[i];
                if (attr.nodeName === name) return attr.value;
            }
            return null;
        };
    }
    return (_getAttribute = func)(node, name);
};

function _getElementText(el){
    //on first call, we examine the properies of the argument element
    //to try and find a native (and presumably optimized) method to grab
    //the text value of the element.
    //We then overwrite the original _getElementText
    //to use the optimized one in any subsequent calls
    var func;
    if ("textContent" in el) {       //ff, chrome
        func = function(el){
            return el.textContent;
        };
    }
    else
    if ("nodeTypedValue" in el) {    //ie8
        func = function(el){
            return el.nodeTypedValue;
        };
    }
    else
    if ("innerText" in el) {         //ie
        func = function(el){
            return el.innerText;
        };
    }
    else
    if ("normalize" in el){
        func = function(el) {
            el.normalize();
            if (el.firstChild){
                return el.firstChild.data;
            }
            else {
                return null;
            }
        }
    }
    else {                      //generic
        func = function(el) {
            var text = [], childNode,
                childNodes = el.childNodes, i,
                n = childNodes ? childNodes.length : 0
            ;
            for (i = 0; i < n; i++){
                childNode = childNodes[i];
                if (childNode.data !== null) text.push(childNode.data);
            }
            return text.length ? text.join("") : null;
        }
    }
    _getElementText = func;
    return func(el);
};

function _getXmlaSoapList(container, listType, items, indent){
    if (!indent) indent = "";
    var n, i, entry, property, item, msg = "\n" + indent + "<" + container + ">";
    if (items) {
        msg += "\n" + indent + " <" + listType + ">";
        for (property in items){
            if (items.hasOwnProperty(property)) {
                item = items[property];
                msg += "\n" + indent + "  <" + property + ">";
                if (_isArr(item)){
                    n = item.length;
                    for (i = 0; i < n; i++){
                        entry = item[i];
                        msg += "<Value>" + _xmlEncode(entry) + "</Value>";
                    }
                } else {
                    msg += _xmlEncode(item);
                }
                msg += "</" + property + ">";
            }
        }
        msg += "\n" + indent + " </" + listType + ">";
    }
    msg += "\n" + indent + "</" + container + ">";
    return msg;
};

var _xmlRequestType = "RequestType";

function _applyProps(object, properties, overwrite){
    if (properties && (!object)) {
        object = {};
    }
    var property;
    for (property in properties){
        if (properties.hasOwnProperty(property)){
            if (overwrite || _isUnd(object[property])) {
                object[property] = properties[property];
            }
        }
    }
    return object;
};

function _xjs(xml) {
  //         1234          5        6          789          10          11   12          13  14                 15
  var re = /<(((([\w\-\.]+):)?([\w\-\.]+))([^>]+)?|\/((([\w\-\.]+):)?([\w\-\.]+))|\?(\w+)([^\?]+)?\?|(!--([^\-]|-[^\-])*--))>|([^<>]+)/ig,
      match, name, prefix, atts, ePrefix, eName, piTarget, text,
      ns = {"": ""}, newNs, nsUri, doc, parentNode, namespaces = [], nextParent, node = null
  ;
  doc = parentNode = {
    nodeType: 9,
    childNodes: []
  };

  function Ns(){
      namespaces.push(ns);
      var _ns = new (function(){});
      _ns.constructor.prototype = ns;
      ns = new _ns.constructor();
      node.namespaces = ns;
      newNs = true;
  }
  function popNs() {
      ns = namespaces.pop();
  }
  function unescapeEntities(text) {
    return text.replace(/&((\w+)|#(x?)([0-9a-fA-F]+));/g, function(match, g1, g2, g3, g4, idx, str){
      if (g2) {
        var v = ({
          lt: "<",
          gt: ">",
          amp: "&",
          apos: "'",
          quot: "\""
        })[g2];
        if (v) {
          return v;
        }
        else {
          throw "Illegal named entity: " + g2;
        }
      }
      else {
        return String.fromCharCode(parseInt(g4, g3 ? 16: 10));
      }
    });
  }
  while (match = re.exec(xml)) {
      node = null;
      if (name = match[5]) {
          newNs = false;
          node = {
              offset: match.index,
              parentNode: parentNode,
              nodeType: 1,
              nodeName: name
          };
          nextParent = node;
          if (atts = match[6]) {
              if (atts.length && atts.substr(atts.length - 1, 1) === "\/") {
                  nextParent = node.parentNode;
                  if (ns === node.namespaces) popNs();
                  atts = atts.substr(0, atts.length - 1);
              }
              var attMatch, att;
              //           123          4               5 6         7
              var attRe = /((([\w\-]+):)?([\w\-]+))\s*=\s*('([^']*)'|"([^"]*)")/g;
              while(attMatch = attRe.exec(atts)) {
                  var pfx = attMatch[3] || "",
                      value = attMatch[attMatch[6] ? 6 : 7]
                  ;
                  if (attMatch[1].indexOf("xmlns")) {
                      if (!node.attributes) node.attributes = [];
                      att = {
                          nodeType: 2,
                          prefix: pfx,
                          nodeName: attMatch[4],
                          value: unescapeEntities(value)
                      };
                      nsUri = (pfx === "") ? "" : ns[pfx];
                      if (_isUnd(nsUri)) {
                          throw "Unrecognized namespace with prefix \"" + prefix + "\"";
                      }
                      att.namespaceURI = nsUri;
                      node.attributes.push(att);
                  }
                  else {
                      if (!newNs) Ns();
                      ns[attMatch[3] ? attMatch[4] : ""] = value;
                  }
              }
              attRe.lastIndex = 0;
          }
          prefix = match[4] || "";
          node.prefix = prefix;
          nsUri = ns[prefix];
          if (_isUnd(nsUri)) {
              throw "Unrecognized namespace with prefix \"" + prefix + "\"";
          }
          node.namespaceURI = nsUri;
      }
      else
      if (eName = match[10]) {
          ePrefix = match[9] || "";
          if (parentNode.nodeName === eName && parentNode.prefix === ePrefix) {
              nextParent = parentNode.parentNode;
              if (ns === parentNode.namespaces) popNs();
          }
          else throw "Unclosed tag " + ePrefix + ":" + eName;
      }
      else
      if (piTarget = match[11]) {
          node = {
              offset: match.index,
              parentNode: parentNode,
              target: piTarget,
              data: match[12],
              nodeType: 7
          };
      }
      else
      if (match[13]) {
          node = {
              offset: match.index,
              parentNode: parentNode,
              nodeType: 8,
              data: match[14]
          };
      }
      else
      if ((text = match[15]) && (!/^\s+$/.test(text))) {
          node = {
              offset: match.index,
              parentNode: parentNode,
              nodeType: 3,
              data: unescapeEntities(text)
          };
      }
      if (node) {
          if (!parentNode.childNodes) parentNode.childNodes = [];
          parentNode.childNodes.push(node);
      }
      if (nextParent) parentNode = nextParent;
  }
  return doc;
};

/**
*
*   The Xmla class provides a javascript API to communicate XML for Analysis (XML/A) over HTTP.
*   XML/A is an industry standard protocol that allows webclients to work with OLAP servers.
*   To fully understand the scope and purpose of this utility, it is highly recommended
*   to read <a href="http://xmla.org/xmla1.1.doc">the XML/A specification</a>
*   (MS Word format. For other formats,
*   see: <a href="http://code.google.com/p/xmla4js/source/browse/#svn/trunk/doc/xmla1.1 specification">http://code.google.com/p/xmla4js/source/browse/#svn/trunk/doc/xmla1.1 specification</a>).
*
*   The optional options parameter sets standard options for this Xmla instnace.
*   If ommitted, a copy of the <code><a href="#property_defaultOptions">defaultOptions</code></a> will be used.
*
*   @class Xmla
*   @constructor
*   @param options Object standard options
*/
Xmla = function(options){

    this.listeners = {};
    this.listeners[Xmla.EVENT_REQUEST] = [];
    this.listeners[Xmla.EVENT_SUCCESS] = [];
    this.listeners[Xmla.EVENT_ERROR] = [];

    this.listeners[Xmla.EVENT_DISCOVER] = [];
    this.listeners[Xmla.EVENT_DISCOVER_SUCCESS] = [];
    this.listeners[Xmla.EVENT_DISCOVER_ERROR] = [];

    this.listeners[Xmla.EVENT_EXECUTE] = [];
    this.listeners[Xmla.EVENT_EXECUTE_SUCCESS] = [];
    this.listeners[Xmla.EVENT_EXECUTE_ERROR] = [];

    this.options = _applyProps(
        _applyProps({}, Xmla.defaultOptions, true),
        options, true
    );
    var listeners = this.options.listeners;
    if (listeners) this.addListener(listeners);
    return this;
};

/**
* These are the default options used for new Xmla instances in case no custom properties are set.
* It sets the following properties:
* <ul>
*   <li><code>requestTimeout</code> int: 30000 - number of milliseconds before a request to the XML/A server will timeout </li>
*   <li><code>async</code> boolean: false - determines whether synchronous or asynchronous communication with the XML/A server will be used.</li>
*   <li><code>addFieldGetters</code> boolean: true - determines whether Xml.Rowset objects will be created with a getter method for each column.</li>
*   <li><code>forceResponseXMLEmulation</code> boolean: false - determines whether to parse responseText or to use the native responseXML from the xhr object.</li>
* </ul>
*
*  @property defaultOptions
*  @static
*  @type object
**/
Xmla.defaultOptions = {
    requestTimeout: 30000,            //by default, we bail out after 30 seconds
    async: false,                     //by default, we do a synchronous request
    addFieldGetters: true,            //true to augment rowsets with a method to fetch a specific field.
    //forceResponseXMLEmulation: true   //true to use our own XML parser instead of XHR's native responseXML. Useful for testing.
    forceResponseXMLEmulation: false   //true to use our own XML parser instead of XHR's native responseXML. Useful for testing.
};

/**
*   Can be used as value for the method option in the options object passed to the
*   <code><a href="#method_request">request()</a></code> method to invoke the XML/A Discover method on the server.
*   Instead of explicitly setting the method yourself, consider using the <code><a href="#method_request">discover()</a></code> method.
*   The <code>discover()</code> method automatically sets the method option to <code>METHOD_DISCOVER</code>.
*   @property METHOD_DISCOVER
*   @static
*   @final
*   @type string
*   @default Discover
*/
Xmla.METHOD_DISCOVER = "Discover";
/**
*   Can be used as value for the method option property in the options objecct passed to the
*   <code><a href="#method_request">request()</code></a> method to invoke the XML/A Execute method on the server.
*   Instead of explicitly setting the method yourself, consider using the <code><a href="#method_execute">execute()</a></code> method.
*   The <code>execute()</code> method automatically sets the method option to <code>METHOD_EXECUTE</code>.
*   @property METHOD_EXECUTE
*   @static
*   @final
*   @type string
*   @default Discover
*/
Xmla.METHOD_EXECUTE = "Execute";

var _xmlaDISCOVER = "DISCOVER_";
var _xmlaMDSCHEMA = "MDSCHEMA_";
var _xmlaDBSCHEMA = "DBSCHEMA_";

/**
*   Can be used as value for the <code>requestType</code> option in the options object passed to the to
*   <code><a href="#method_request">request()</a></code> method to invoke the XML/A Discover method on the server to return the <code>DISCOVER_DATASOURCES</code> schema rowset.
*   The <code>requestType</code> option applies only to Discover requests.
*   Instead of passing this constant as requestType yourself, consider calling the <code><a href="#method_discoverDataSources">discoverDataSources()</a></code> method.
*   The <code>discoverDataSources()</code> method passes <code>DISCOVER_DATASOURCES</code> automatically as requestType for Discover requests.
*
*   @property DISCOVER_DATASOURCES
*   @static
*   @final
*   @type string
*   @default DISCOVER_DATASOURCES
*/
Xmla.DISCOVER_DATASOURCES =     _xmlaDISCOVER + "DATASOURCES";
/**
*   Can be used as value for the <code>requestType</code> option in the options object passed to the to
*   <code><a href="#method_request">request()</a></code> method to invoke the XML/A Discover method on the server to return the <code>DISCOVER_PROPERTIES</code> schema rowset.
*   The <code>requestType</code> option applies only to Discover requests.
*   Instead of passing this <code>requestType</code> yourself, consider calling the <code><a href="#method_discoverProperties">discoverProperties()</a></code> method.
*   The <code>discoverProperties()</code> method passes <code>DISCOVER_PROPERTIES</code> automatically as requestType for Discover requests.
*
*   @property DISCOVER_PROPERTIES
*   @static
*   @final
*   @type string
*   @default DISCOVER_PROPERTIES
*/
Xmla.DISCOVER_PROPERTIES =      _xmlaDISCOVER + "PROPERTIES";
/**
*   Can be used as value for the <code>requestType</code> option in the options object passed to the to
*   <code><a href="#method_request">request()</a></code> method to invoke the XML/A Discover method on the server to return the <code>DISCOVER_SCHEMA_ROWSETS</code> schema rowset.
*   The <code>requestType</code> option applies only to Discover requests.
*   Instead of passing this <code>requestType</code> yourself, consider calling the <code><a href="#method_discoverSchemaRowsets">discoverSchemaRowsets()</a></code> method.
*   The <code>discoverProperties()</code> method passes <code>DISCOVER_PROPERTIES</code> automatically as requestType for Discover requests.
*
*   @property DISCOVER_SCHEMA_ROWSETS
*   @static
*   @final
*   @type string
*   @default DISCOVER_SCHEMA_ROWSETS
*/
Xmla.DISCOVER_SCHEMA_ROWSETS =  _xmlaDISCOVER + "SCHEMA_ROWSETS";
/**
*   Can be used as value for the <code>requestType</code> option in the options object passed to the to
*   <code><a href="#method_request">request()</a></code> method to invoke the XML/A Discover method on the server to return the <code>DISCOVER_ENUMERATORS</code> schema rowset.
*   The <code>requestType</code> option applies only to Discover requests.
*   Instead of passing this <code>requestType</code> yourself, consider calling the <code><a href="#method_discoverEnumerators">discoverEnumerators()</a></code> method.
*   The <code>discoverSchemaRowsets()</code> method issues a request to invoke the Discover method using <code>DISCOVER_SCHEMA_ROWSETS</code> as requestType.
*
*   @property DISCOVER_ENUMERATORS
*   @static
*   @final
*   @type string
*   @default DISCOVER_ENUMERATORS
*/
Xmla.DISCOVER_ENUMERATORS =     _xmlaDISCOVER + "ENUMERATORS";
/**
*   Can be used as value for the <code>requestType</code> option in the options object passed to the to
*   <code><a href="#method_request">request()</a></code> method to invoke the XML/A Discover method on the server to return the <code>DISCOVER_KEYWORDS</code> schema rowset.
*   The <code>requestType</code> option applies only to Discover requests.
*   Instead of passing this requestType yourself, consider calling the <code><a href="#method_discoverLiterals">discoverKeywords()</a></code> method.
*   The <code>discoverKeywords()</code> method issues a request to invoke the Discover method using DISCOVER_KEYWORDS as requestType.
*
*   @property DISCOVER_KEYWORDS
*   @static
*   @final
*   @type string
*   @default DISCOVER_KEYWORDS
*/
Xmla.DISCOVER_KEYWORDS =        _xmlaDISCOVER + "KEYWORDS";
/**
*   Can be used as value for the <code>requestType</code> option in the options object passed to the to
*   <code><a href="#method_request">request()</a></code> method to invoke the XML/A Discover method on the server to return the <code>DISCOVER_LITERALS</code> schema rowset.
*   The <code>requestType</code> option applies only to Discover requests.
*   Instead of passing this <code>requestType</code> yourself, consider calling the <code><a href="#method_discoverLiterals">discoverLiterals()</a></code> method.
*   The <code>discoverLiterals()</code> method issues a request to invoke the Discover method using DISCOVER_LITERALS as requestType.
*
*   @property DISCOVER_LITERALS
*   @static
*   @final
*   @type string
*   @default DISCOVER_LITERALS
*/
Xmla.DISCOVER_LITERALS =        _xmlaDISCOVER + "LITERALS";
/**
*   Can be used as value for the <code>requestType</code> option in the options object passed to the to
*   <code><a href="#method_request">request()</a></code> method to invoke the XML/A Discover method on the server to return the <code>DBSCHEMA_CATALOGS</code> schema rowset.
*   The <code>requestType</code> option applies only to Discover requests.
*   Instead of passing this <code>requestType</code> yourself, consider calling the <code><a href="#method_discoverDBCatalogs">discoverDBCatalogs()</a></code> method.
*   The <code>discoverDBCatalogs()</code> method issues a request to invoke the Discover method using <code>DBSCHEMA_CATALOGS</code> as requestType.
*
*   @property DBSCHEMA_CATALOGS
*   @static
*   @final
*   @type string
*   @default DBSCHEMA_CATALOGS
*/
Xmla.DBSCHEMA_CATALOGS =       _xmlaDBSCHEMA + "CATALOGS";
/**
*   Can be used as value for the <code>requestType</code> option in the options object passed to the to
*   <code><a href="#method_request">request()</a></code> method to invoke the XML/A Discover method on the server to return the <code>DBSCHEMA_COLUMNS</code> schema rowset.
*   The <code>requestType</code> option applies only to Discover requests.
*   Instead of passing this <code>requestType</code> yourself, consider calling the <code><a href="#method_discoverDBColumns">discoverDBColumns()</a></code> method.
*   The <code>discoverDBColumns()</code> method issues a request to invoke the Discover method using <code>DBSCHEMA_COLUMNS</code> as requestType.
*
*   @property DBSCHEMA_COLUMNS
*   @static
*   @final
*   @type string
*   @default DBSCHEMA_COLUMNS
*/
Xmla.DBSCHEMA_COLUMNS =        _xmlaDBSCHEMA + "COLUMNS";
/**
*   Can be used as value for the <code>requestType</code> option in the options object passed to the to
*   <code><a href="#method_request">request()</a></code> method to invoke the XML/A Discover method on the server to return the <code>DBSCHEMA_PROVIDER_TYPES</code> schema rowset.
*   The <code>requestType</code> option applies only to Discover requests.
*   Instead of passing this <code>requestType</code> yourself, consider calling the <code><a href="#method_discoverDBProviderTypes">discoverDBProviderTypes()</a></code> method.
*   The <code>discoverDBProviderTypes()</code> method issues a request to invoke the Discover method using <code>DBSCHEMA_PROVIDER_TYPES</code> as requestType.
*
*   @property DBSCHEMA_PROVIDER_TYPES
*   @static
*   @final
*   @type string
*   @default DBSCHEMA_PROVIDER_TYPES
*/
Xmla.DBSCHEMA_PROVIDER_TYPES = _xmlaDBSCHEMA + "PROVIDER_TYPES";
/**
*   Can be used as value for the <code>requestType</code> option in the options object passed to the to
*   <code><a href="#method_request">request()</a></code> method to invoke the XML/A Discover method on the server to return the <code>DBSCHEMA_SCHEMATA</code> schema rowset.
*   The <code>requestType</code> option applies only to Discover requests.
*   Instead of passing this <code>requestType</code> yourself, consider calling the <code><a href="#method_discoverDBSchemata">discoverDBSchemata()</a></code> method.
*   The <code>discoverDBColumns()</code> method issues a request to invoke the Discover method using <code>DBSCHEMA_SCHEMATA</code> as requestType.
*
*   @property DBSCHEMA_SCHEMATA
*   @static
*   @final
*   @type string
*   @default DBSCHEMA_SCHEMATA
*/
Xmla.DBSCHEMA_SCHEMATA =       _xmlaDBSCHEMA + "SCHEMATA";
/**
*   Can be used as value for the <code>requestType</code> option in the options object passed to the to
*   <code><a href="#method_request">request()</a></code> method to invoke the XML/A Discover method on the server to return the <code>DBSCHEMA_TABLES</code> schema rowset.
*   The <code>requestType</code> option applies only to Discover requests.
*   Instead of passing this <code>requestType</code> yourself, consider calling the <code><a href="#method_discoverDBTables">discoverDBTables()</a></code> method.
*   The <code>discoverDBColumns()</code> method issues a request to invoke the Discover method using <code>DBSCHEMA_TABLES</code> as requestType.
*
*   @property DBSCHEMA_TABLES
*   @static
*   @final
*   @type string
*   @default DBSCHEMA_TABLES
*/
Xmla.DBSCHEMA_TABLES =         _xmlaDBSCHEMA + "TABLES";
/**
*   Can be used as value for the <code>requestType</code> option in the options object passed to the to
*   <code><a href="#method_request">request()</a></code> method to invoke the XML/A Discover method on the server to return the <code>DBSCHEMA_TABLES_INFO</code> schema rowset.
*   The <code>requestType</code> option applies only to Discover requests.
*   Instead of passing this <code>requestType</code> yourself, consider calling the
*   <code><a href="#method_discoverDBTablesInfo">discoverDBTablesInfo()</a></code> method.
*   The <code>discoverDBTablesInfo()</code> method issues a request to invoke the Discover method using <code>DBSCHEMA_TABLES_INFO</code> as requestType.
*
*   @property DBSCHEMA_TABLES_INFO
*   @static
*   @final
*   @type string
*   @default <code>DBSCHEMA_TABLES_INFO</code>
*/
Xmla.DBSCHEMA_TABLES_INFO =    _xmlaDBSCHEMA + "TABLES_INFO";
/**
*   Can be used as value for the <code>requestType</code> option in the options object passed to the to
*   <code><a href="#method_request">request()</a></code> method to invoke the XML/A Discover method on the server to return the <code>MDSCHEMA_ACTIONS</code> schema rowset.
*   The <code>requestType</code> option applies only to Discover requests.
*   Instead of passing this <code>requestType</code> yourself, consider calling the
*   <code><a href="#method_discoverMDActions">discoverMDActions()</a></code> method.
*   The <code>discoverMDActions()</code> method issues a request to invoke the Discover method using <code>MDSCHEMA_ACTIONS</code> as requestType.
*
*   @property MDSCHEMA_ACTIONS
*   @static
*   @final
*   @type string
*   @default MDSCHEMA_ACTIONS
*/
Xmla.MDSCHEMA_ACTIONS =        _xmlaMDSCHEMA + "ACTIONS";
/**
*   Can be used as value for the <code>requestType</code> option in the options object passed to the to
*   <code><a href="#method_request">request()</a></code> method to invoke the XML/A Discover method on the server to return the
*   <code>MDSCHEMA_CUBES</code> schema rowset.
*   The <code>requestType</code> option applies only to Discover requests.
*   Instead of passing this <code>requestType</code> yourself, consider calling the
*   <code><a href="#method_discoverMDCubes">discoverMDCubes()</a></code> method.
*   The <code>discoverMDCubes()</code> method issues a request to invoke the Discover method using
*   <code>MDSCHEMA_CUBES</code> as requestType.
*
*   @property MDSCHEMA_CUBES
*   @static
*   @final
*   @type string
*   @default MDSCHEMA_CUBES
*/
Xmla.MDSCHEMA_CUBES =          _xmlaMDSCHEMA + "CUBES";
/**
*   Can be used as value for the <code>requestType</code> option in the options object passed to the to
*   <code><a href="#method_request">request()</a></code> method to invoke the XML/A Discover method on the server to return the
*   <code>MDSCHEMA_DIMENSIONS</code> schema rowset.
*   The <code>requestType</code> option applies only to Discover requests.
*   Instead of passing this <code>requestType</code> yourself, consider calling the
*   <code><a href="#method_discoverMDDimensions">discoverMDDimensions()</a></code> method.
*   The <code>discoverMDDimensions()</code> method issues a request to invoke the Discover method using
*   <code>MDSCHEMA_DIMENSIONS</code> as requestType.
*
*   @property MDSCHEMA_DIMENSIONS
*   @static
*   @final
*   @type string
*   @default MDSCHEMA_DIMENSIONS
*/
Xmla.MDSCHEMA_DIMENSIONS =     _xmlaMDSCHEMA + "DIMENSIONS";
/**
*   Can be used as value for the <code>requestType</code> option in the options object passed to the to
*   <code><a href="#method_request">request()</a></code> method to invoke the XML/A Discover method on the server to return the
*   <code>MDSCHEMA_FUNCTIONS</code> schema rowset.
*   The <code>requestType</code> option applies only to Discover requests.
*   Instead of passing this <code>requestType</code> yourself, consider calling the
*   <code><a href="#method_discoverMDFunctions">discoverMDFunctions()</a></code> method.
*   The <code>discoverMDFunctions()</code> method issues a request to invoke the Discover method using
*   <code>MDSCHEMA_FUNCTIONS</code> as requestType.
*
*   @property MDSCHEMA_FUNCTIONS
*   @static
*   @final
*   @type string
*   @default MDSCHEMA_FUNCTIONS
*/
Xmla.MDSCHEMA_FUNCTIONS =      _xmlaMDSCHEMA + "FUNCTIONS";
/**
*   Can be used as value for the <code>requestType</code> option in the options object passed to the to
*   <code><a href="#method_request">request()</a></code> method to invoke the XML/A Discover method on the server to return the
*   <code>MDSCHEMA_HIERARCHIES</code> schema rowset.
*   The <code>requestType</code> option applies only to Discover requests.
*   Instead of passing this <code>requestType</code> yourself, consider calling the
*   <code><a href="#method_discoverMDHierarchies">discoverMDHierarchies()</a></code> method.
*   The <code>discoverMDHierarchies()</code> method issues a request to invoke the Discover method using
*   <code>MDSCHEMA_HIERARCHIES</code> as requestType.
*
*   @property MDSCHEMA_HIERARCHIES
*   @static
*   @final
*   @type string
*   @default MDSCHEMA_HIERARCHIES
*/
Xmla.MDSCHEMA_HIERARCHIES =    _xmlaMDSCHEMA + "HIERARCHIES";
/**
*   Can be used as value for the <code>requestType</code> option in the options object passed to the to
*   <code><a href="#method_request">request()</a></code> method to invoke the XML/A Discover method on the server to return the
*   <code>MDSCHEMA_LEVELS</code> schema rowset.
*   The <code>requestType</code> option applies only to Discover requests.
*   Instead of passing this <code>requestType</code> yourself, consider calling the
*   <code><a href="#method_discoverMDLevels">discoverMDLevels()</a></code> method.
*   The <code>discoverMDLevels()</code> method issues a request to invoke the Discover method using
*   <code>MDSCHEMA_LEVELS</code> as requestType.
*
*   @property MDSCHEMA_LEVELS
*   @static
*   @final
*   @type string
*   @default MDSCHEMA_LEVELS
*/
Xmla.MDSCHEMA_LEVELS =         _xmlaMDSCHEMA + "LEVELS";
/**
*   Can be used as value for the <code>requestType</code> option in the options object passed to the to
*   <code><a href="#method_request">request()</a></code> method to invoke the XML/A Discover method on the server to return the
*   <code>MDSCHEMA_MEASURES</code> schema rowset.
*   The <code>requestType</code> option applies only to Discover requests.
*   Instead of passing this <code>requestType</code> yourself, consider calling the
*   <code><a href="#method_discoverMDMeasures">discoverMDMeasures()</a></code> method.
*   The <code>discoverMDMeasures()</code> method issues a request to invoke the Discover method using
*   <code>MDSCHEMA_MEASURES</code> as requestType.
*
*   @property MDSCHEMA_MEASURES
*   @static
*   @final
*   @type string
*   @default MDSCHEMA_MEASURES
*/
Xmla.MDSCHEMA_MEASURES =       _xmlaMDSCHEMA + "MEASURES";
/**
*   Can be used as value for the <code>requestType</code> option in the options object passed to the to
*   <code><a href="#method_request">request()</a></code> method to invoke the XML/A Discover method on the server to return the
*   <code>MDSCHEMA_MEMBERS</code> schema rowset.
*   The <code>requestType</code> option applies only to Discover requests.
*   Instead of passing this <code>requestType</code> yourself, consider calling the
*   <code><a href="#method_discoverMDMembers">discoverMDMembers()</a></code> method.
*   The <code>discoverMDMembers()</code> method issues a request to invoke the Discover method using
*   <code>MDSCHEMA_MEMBERS</code> as requestType.
*
*   @property MDSCHEMA_MEMBERS
*   @static
*   @final
*   @type string
*   @default MDSCHEMA_MEMBERS
*/
Xmla.MDSCHEMA_MEMBERS =        _xmlaMDSCHEMA + "MEMBERS";
/**
*   Can be used as value for the <code>requestType</code> option in the options object passed to the to
*   <code><a href="#method_request">request()</a></code> method to invoke the XML/A Discover method on the server to return the
*   <code>MDSCHEMA_PROPERTIES</code> schema rowset.
*   The <code>requestType</code> option applies only to Discover requests.
*   Instead of passing this <code>requestType</code> yourself, consider calling the
*   <code><a href="#method_discoverMDProperties">discoverMDProperties()</a></code> method.
*   The <code>discoverMDProperties()</code> method issues a request to invoke the Discover method using
*   <code>MDSCHEMA_PROPERTIES</code> as requestType.
*
*   @property MDSCHEMA_PROPERTIES
*   @static
*   @final
*   @type string
*   @default MDSCHEMA_PROPERTIES
*/
Xmla.MDSCHEMA_PROPERTIES =     _xmlaMDSCHEMA + "PROPERTIES";
/**
*   Can be used as value for the <code>requestType</code> option in the options object passed to the to
*   <code><a href="#method_request">request()</a></code> method to invoke the XML/A Discover method on the server to return the
*   <code>MDSCHEMA_SETS</code> schema rowset.
*   The <code>requestType</code> option applies only to Discover requests.
*   Instead of passing this <code>requestType</code> yourself, consider calling the
*   <code><a href="#method_discoverMDSets">discoverMDSets()</a></code> method.
*   The <code>discoverMDSets()</code> method issues a request to invoke the Discover method using
*   <code>MDSCHEMA_SETS</code> as requestType.
*
*   @property MDSCHEMA_SETS
*   @static
*   @final
*   @type string
*   @default MDSCHEMA_SETS
*/
Xmla.MDSCHEMA_SETS = _xmlaMDSCHEMA + "SETS";
/**
*   Indicates the <code>request</code> event.
*   This constant can be used as en entry in the events array argument for the <code><a href="#method_addListener">addListener()</a></code> method.
*   The <code>request</code> event is the first event that is fired before submitting a request
*   (see: <code><a href="#method_request">request()</a></code>)
*   to the server, and before firing the method-specific request events
*   (see <code><a href="#property_EVENT_EXECUTE">EVENT_EXECUTE</a></code>
*   and <code><a href="#property_EVENT_DISCOVER">EVENT_DISCOVER</a></code>).
*   The <code>request</code> event itself is not method-specific, and fires for <code>Execute</code> as well as <code>Discover</code> requests.
*   The <code>EVENT_REQUEST</code> event is <em>cancelable</em>:
*   the <code>handler</code> function specified in the listener object passed to <code>addListener</code> should return a boolen, indicating
*   whether the respective operation should be canceled.
*
*   @property EVENT_REQUEST
*   @static
*   @final
*   @type string
*   @default request
*/
Xmla.EVENT_REQUEST = "request";
/**
*   Indicates the <code>success</code> event.
*   This constant can be used as en entry in the events array argument for the <code><a href="#method_addListener">addListener()</a></code> method.
*   The <code>success</code> event  is the last event that is fired after receiving and processing a normal response
*   (that is, a response that does not contain an XML/A <code>SoapFault</code>),
*   after firing the method-specific success events
*   (see <code><a href="#property_EVENT_EXECUTE_SUCCESS">EVENT_EXECUTE_SUCCESS</a></code>
*   and <code><a href="#property_EVENT_DISCOVER_SUCCESS">EVENT_DISCOVER_SUCCESS</a></code>).
*   The <code>success</code> event is not method-specific, and fires for <code>Execute</code> as well as <code>Discover</code> responses.
*   This is event is not cancelable.
*
*   @property EVENT_SUCCESS
*   @static
*   @final
*   @type string
*   @default success
*/
Xmla.EVENT_SUCCESS = "success";
/**
*   Indicates the <code>error</code> event.
*   This constant can be used as en entry in the events array argument for the <code><a href="#method_addListener">addListener()</a></code> method.
*   The <code>error</code> is fired when an error occurs while sending a request or receiving a response.
*   The <code>error</code> event is not method-specific, and fires for errors encountered during both <code>Execute</code> as well as <code>Discover</code> method invocations.
*   This is event is not cancelable.
*
*   @property EVENT_ERROR
*   @static
*   @final
*   @type string
*   @default error
*/
Xmla.EVENT_ERROR = "error";

/**
*   Indicates the <code>execute</code> event.
*   This constant can be used as en entry in the events array argument for the <code><a href="#method_addListener">addListener()</a></code> method.
*   The <code>execute</code> event is method-specific, and is fired before submitting an <code>Execute</code> request
*   (see: <code><a href="#method_execute">execute()</a></code>)
*   to the server, but after firing the <code>request</code> event
*   (see: <code><a href="#property_EVENT_REQUEST">EVENT_REQUEST</a></code>).
*   The <code>EVENT_EXECUTE</code> event is <em>cancelable</em>:
*   the <code>handler</code> function specified in the listener object passed to <code>addListener</code> should return a boolen, indicating
*   whether the respective operation should be canceled.
*
*   @property EVENT_EXECUTE
*   @static
*   @final
*   @type string
*   @default execute
*/
Xmla.EVENT_EXECUTE = "execute";
/**
*   Indicates the <code>executesuccess</code> event.
*   This constant can be used as en entry in the events array argument for the <code><a href="#method_addListener">addListener()</a></code> method.
*   The <code>executesuccess</code> event is method-specific and fired only after receiving and processing a normal response
*   (that is, a response that does not contain a <code>SoapFault</code>)
*   to an incovation of the XML/A <code>Execute</code> method
*   (see: <code><a href="#method_execute">execute()</a></code>).
*   This is event is not cancelable.
*
*   @property EVENT_EXECUTE_SUCCESS
*   @static
*   @final
*   @type string
*   @default executesuccess
*/
Xmla.EVENT_EXECUTE_SUCCESS = "executesuccess";
/**
*   Indicates the <code>executeerror</code> event.
*   This constant can be used as en entry in the events array argument for the <code><a href="#method_addListener">addListener()</a></code> method.
*   The <code>executeerror</code> event is method-specific and fired when an error occurs while sending an <code>Execute</code> request, or receiving a response to an <code>Execute</code method.
*   (see: <code><a href="#method_execute">execute()</a></code>).
*   This is event is not cancelable.
*
*   @property EVENT_EXECUTE_ERROR
*   @static
*   @final
*   @type string
*   @default executeerror
*/
Xmla.EVENT_EXECUTE_ERROR = "executeerror";

/**
*   Indicates the <code>discover</code> event.
*   This constant can be used as en entry in the events array argument for the <code><a href="#method_addListener">addListener()</a></code> method.
*   The <code>discover</code> event is method-specific, and is fired before submitting a <code>Discover</code> request
*   (see: <code><a href="#method_discover">discover()</a></code>)
*   to the server, but after firing the <code>request</code> event
*   (see: <code><a href="#property_EVENT_DISCOVER">EVENT_DISCOVER</a></code>).
*   The <code>EVENT_DISCOVER</code> event is <em>cancelable</em>:
*   the <code>handler</code> function specified in the listener object passed to <code>addListener</code> should return a boolen, indicating
*   whether the respective operation should be canceled.
*
*   @property EVENT_DISCOVER
*   @static
*   @final
*   @type string
*   @default discover
*/
Xmla.EVENT_DISCOVER = "discover";
/**
*   Indicates the <code>discoversuccess</code> event.
*   This constant can be used as en entry in the events array argument for the <code><a href="#method_addListener">addListener()</a></code> method.
*   The <code>discoversuccess</code> event is method-specific and fired only after receiving and processing a normal response
*   (that is, a response that does not contain a <code>SoapFault</code>)
*   to an incovation of the XML/A <code>Discover</code> method
*   (see: <code><a href="#method_discover">discover()</a></code>).
*   This is event is not cancelable.
*
*   @property EVENT_DISCOVER_SUCCESS
*   @static
*   @final
*   @type string
*   @default discoversuccess
*/
Xmla.EVENT_DISCOVER_SUCCESS = "discoversuccess";
/**
*   Indicates the <code>discovererror</code> event.
*   This constant can be used as en entry in the events array argument for the <code><a href="#method_addListener">addListener()</a></code> method.
*   The <code>discovererror</code> is method-specific and fired when an error occurs while sending an <code>Discover</code> request,
*   or receiving a response to an <code>Discover</code method.
*   (see: <code><a href="#method_discover">discover()</a></code>).
*   This is event is not cancelable.
*
*   @property EVENT_DISCOVER_ERROR
*   @static
*   @final
*   @type string
*   @default discovererror
*/
Xmla.EVENT_DISCOVER_ERROR = "discovererror";

/**
*   Unifies all general events, that is, all events that are not method-specific.
*   This constant can be used as events array argument for the <code><a href="#method_addListener">addListener()</a></code> method,
*   or you can use array concatenation to combine it with other arrays of <code>EVENT_XXX</code> constants.
*   This constant is especially intended for asyncronous handling of Schema rowset data.
*
*   @property EVENT_GENERAL
*   @static
*   @final
*   @type string[]
*   @default [EVENT_REQUEST,EVENT_SUCCESS,EVENT_ERROR]
*/
Xmla.EVENT_GENERAL = [
    Xmla.EVENT_REQUEST,
    Xmla.EVENT_SUCCESS,
    Xmla.EVENT_ERROR
];

/**
*   Unifies all events specific for the <code>Discover</code> method.
*   This constant can be used as events array argument for the <code><a href="#method_addListener">addListener()</a></code> method,
*   or you can use array concatenation to combine it with other arrays of <code>EVENT_XXX</code> constants.
*
*   @property EVENT_DISCOVER_ALL
*   @static
*   @final
*   @type string[]
*   @default [EVENT_DISCOVER,EVENT_DISCOVER_SUCCESS,EVENT_DISCOVER_ERROR]
*/
Xmla.EVENT_DISCOVER_ALL = [
    Xmla.EVENT_DISCOVER,
    Xmla.EVENT_DISCOVER_SUCCESS,
    Xmla.EVENT_DISCOVER_ERROR
];

/**
*   Unifies all events specific for the <code>Execute</code> method.
*   This constant can be used as events array argument for the <code><a href="#method_addListener">addListener()</a></code> method,
*   or you can use array concatenation to combine it with other arrays of <code>EVENT_XXX</code> constants.
*
*   @property EVENT_EXECUTE_ALL
*   @static
*   @final
*   @type string[]
*   @default [EVENT_EXECUTE,EVENT_EXECUTE_SUCCESS,EVENT_EXECUTE_ERROR]
*/
Xmla.EVENT_EXECUTE_ALL = [
    Xmla.EVENT_EXECUTE,
    Xmla.EVENT_EXECUTE_SUCCESS,
    Xmla.EVENT_EXECUTE_ERROR
];

/**
*   Unifies all method-specific and non method-specific events.
*   This constant can be used as events array argument for the <code><a href="#method_addListener">addListener()</a></code> method.
*
*   @property EVENT_ALL
*   @static
*   @final
*   @type string[]
*   @default [].concat(Xmla.EVENT_GENERAL, Xmla.EVENT_DISCOVER_ALL, Xmla.EVENT_EXECUTE_ALL)
*/
Xmla.EVENT_ALL = [].concat(
    Xmla.EVENT_GENERAL,
    Xmla.EVENT_DISCOVER_ALL,
    Xmla.EVENT_EXECUTE_ALL
);

/**
*   Can be used as key in the <code>properties</code> member of the <code>options</code> object
*   passed to the <code><a href="#method_request">request()</a></code> method
*   to specify the XML/A <code>DataSourceInfo</code> property.
*   The XML/A <code>DataSourceInfo</code>, together with the XML/A service URL are required to
*   connect to a particular OLAP datasource.
*   Valid values for the <code>DataSourceInfo</code> as well as the corresponding URL should be obtained
*   by querying the <code>DataSourceInfo</code> and <code>URL</code> columns of the <code>DISCOVER_DATASOURCES</code>
*   rowset respectively (see <code><a href="method_discoverDataSources">discoverDataSources()</a></code>).
*
*   @property PROP_DATASOURCEINFO
*   @static
*   @final
*   @type string
*   @default DataSourceInfo
*/
Xmla.PROP_DATASOURCEINFO = "DataSourceInfo";
/**
*   Can be used as key in the <code>properties</code> member of the <code>options</code> object
*   passed to the <code><a href="#method_request">execute()</a></code> method
*   to specify the XML/A <code>Catalog</code> property.
*   The XML/A <code>Catalog</code> spefifies where to look for cubes that are referenced in th MDX statment.
*   Valid values for the <code>Catalog</code> should be obtained
*   by querying the <code>CATALOG_NAME</code> of the <code>DBSCHEMA_CATALOGS</code>
*   rowset (see <code><a href="method_discoverDBCatalogs">discoverDBCatalogs()</a></code>).
*
*   @property PROP_Catalog
*   @static
*   @final
*   @type string
*   @default Catalog
*/
Xmla.PROP_CATALOG = "Catalog";
Xmla.PROP_CUBE = "Cube";

/**
*   Can be used as key in the <code>properties</code> member of the <code>options</code> object
*   passed to the <code><a href="#method_execute">execute()</a></code> method
*   to specify the XML/A <code>Format</code> property.
*   This property controls the structure of the resultset.
*
*   @property PROP_FORMAT
*   @static
*   @final
*   @type string
*   @default Format
*/
Xmla.PROP_FORMAT = "Format";
/**
*   Can be used as value for the
*   <code><a href="#property_PROP_FORMAT>PROP_FORMAT</a></code> key of the
*   <code>properties</code> member of the
*   <code>options</code> object passed to the
*   <code><a href="#method_execute">execute()</a></code> method.
*   When used, this specifies that the multidimensional resultset should be returned in a tabular format,
*   causeing the multidimensional resultset to be represented with an instance of the
*   <code><a href="Xmla.Rowset#class_Xmla.Rowset">Xmla.Rowset</a></code> class.
*
*   @property PROP_FORMAT_TABULAR
*   @static
*   @final
*   @type string
*   @default Tabular
*/
Xmla.PROP_FORMAT_TABULAR = "Tabular";
/**
*   Can be used as value for the
*   <code><a href="#property_PROP_FORMAT>PROP_FORMAT</a></code> key of the
*   <code>properties</code> member of the
*   <code>options</code> object passed to the
*   <code><a href="#method_execute">execute()</a></code> method.
*   When used, this specifies that the multidimensional resultset should be returned in a multidimensional format.
*   Currently, Xmla4js does not provide a class to represent the resultset in this format.
*   However, you can access the results as xml through the
*   <code><a href="#property_responseText">responseText</a></code> and
*   <code><a href="#property_responseXML">responseXML</a></code> properties.
*
*   @property PROP_FORMAT_MULTIDIMENSIONAL
*   @static
*   @final
*   @type string
*   @default Multidimensional
*/
Xmla.PROP_FORMAT_MULTIDIMENSIONAL = "Multidimensional";

/**
*   Can be used as key in the <code>properties</code> member of the <code>options</code> object
*   passed to the <code><a href="#method_execute">execute()</a></code> method
*   to specify the XML/A <code>AxisFormat</code> property.
*   The XML/A <code>AxisFormat</code> property specifies how the client wants to receive the multi-dimensional resultset of a MDX query.
*   Valid values for the <code>AxisFormat</code> property are available as the static final properties
*   <code><a href="#property_PROP_AXISFORMAT_TUPLE">PROP_AXISFORMAT_TUPLE</a></code>,
*   <code><a href="#property_PROP_AXISFORMAT_CLUSTER">PROP_AXISFORMAT_CLUSTER</a></code>,
*   <code><a href="#property_PROP_AXISFORMAT_CUSTOM">PROP_AXISFORMAT_CUSTOM</a></code>.
*
*   @property PROP_AXISFORMAT
*   @static
*   @final
*   @type string
*   @default AxisFormat
*/
Xmla.PROP_AXISFORMAT = "AxisFormat";
/**
*   Can be used as value for the <code>AxisFormat</code> XML/A property
*   (see: <code><a href="#property_PROP_AXISFORMAT">PROP_AXISFORMAT</a></code>)
*   in invocations of the <code>Execute</code> method
*   (see: <code><a href="#method_execute">execute()</a></code>).
*
*   @property PROP_AXISFORMAT_TUPLE
*   @static
*   @final
*   @type string
*   @default TupleFormat
*/
Xmla.PROP_AXISFORMAT_TUPLE = "TupleFormat";
/**
*   Can be used as value for the <code>AxisFormat</code> XML/A property
*   (see: <code><a href="#property_PROP_AXISFORMAT">PROP_AXISFORMAT</a></code>)
*   in invocations of the <code>Execute</code> method
*   (see: <code><a href="#method_execute">execute()</a></code>).
*
*   @property PROP_AXISFORMAT_CLUSTER
*   @static
*   @final
*   @type string
*   @default ClusterFormat
*/
Xmla.PROP_AXISFORMAT_CLUSTER = "ClusterFormat";
/**
*   Can be used as value for the <code>AxisFormat</code> XML/A property
*   (see: <code><a href="#property_PROP_AXISFORMAT">PROP_AXISFORMAT</a></code>)
*   in invocations of the <code>Execute</code> method
*   (see: <code><a href="#method_execute">execute()</a></code>).
*
*   @property PROP_AXISFORMAT_CUSTOM
*   @static
*   @final
*   @type string
*   @default CustomFormat
*/
Xmla.PROP_AXISFORMAT_CUSTOM = "CustomFormat";

/**
*   Can be used as key in the <code>properties</code> member of the <code>options</code> object
*   passed to the <code><a href="#method_request">request()</a></code> method
*   to specify the XML/A <code>Content</code> property.
*   The XML/A <code>Content</code> property specifies whether to return data and/or XML Schema metadata by the <code>Discover</code> and <code>Execute</code> invocations.
*   Valid values for the <code>Content</code> property are available as the static final properties
*   <code><a href="#property_PROP_CONTENT_DATA">PROP_CONTENT_DATA</a></code>,
*   <code><a href="#property_PROP_CONTENT_NONE">PROP_CONTENT_NONE</a></code>,
*   <code><a href="#property_PROP_CONTENT_SCHEMA">PROP_CONTENT_SCHEMA</a></code>,
*   <code><a href="#property_PROP_CONTENT_SCHEMADATA">PROP_CONTENT_SCHEMADATA</a></code>.
*
*   Note: This key is primarily intended for clients that use the low-level <code><a href="#method_request">request()</a></code> method.
*   You should not set this property when calling the <code><a href="#method_request">discover()</a></code> method,
*   the <code><a href="#method_execute">execute()</a></code> method,
*   or any of the <code>discoverXXX()</code> methods.
*
*   @property PROP_CONTENT
*   @static
*   @final
*   @type string
*   @default Content
*/
Xmla.PROP_CONTENT = "Content";
/**
*   Can be used as value for the XML/A <code>Content</code> property
*   (see: <code><a href="#property_PROP_CONTENT">PROP_CONTENT</a></code>).
*   This value specifies that the response should contain only data, but no XML Schema metadata.
*
*   As the <code>Xmla</code> class relies on the XML Schema metadata to construct Rowset and Resultset instances,
*   this option is primarily useful if you know how to process the XML response directly.
*
*   @property PROP_CONTENT_DATA
*   @static
*   @final
*   @type string
*   @default Data
*/
Xmla.PROP_CONTENT_DATA = "Data";
/**
*   Can be used as value for the XML/A <code>Content</code> property
*   (see: <code><a href="#property_PROP_CONTENT">PROP_CONTENT</a></code>).
*   This value specifies that the response should contain neither data nor XML Schema metadata.
*   This is useful to check the validity of the request.
*
*   @property PROP_CONTENT_NONE
*   @static
*   @final
*   @type string
*   @default None
*/
Xmla.PROP_CONTENT_NONE = "None";
/**
*   Can be used as value for the XML/A <code>Content</code> property
*   (see: <code><a href="#property_PROP_CONTENT">PROP_CONTENT</a></code>).
*   This value specifies that the response should only return XML Schema metadata, but no data.
*
*   @property PROP_CONTENT_SCHEMA
*   @static
*   @final
*   @type string
*   @default Schema
*/
Xmla.PROP_CONTENT_SCHEMA = "Schema";
/**
*   Can be used as value for the XML/A <code>Content</code> property
*   (see: <code><a href="#property_PROP_CONTENT">PROP_CONTENT</a></code>).
*   This value specifies that the response should return both data as well as XML Schema metadata.
*
*   @property PROP_CONTENT_SCHEMADATA
*   @static
*   @final
*   @type string
*   @default SchemaData
*/
Xmla.PROP_CONTENT_SCHEMADATA = "SchemaData";

Xmla.prototype = {
/**
*   This object stores listeners.
*   Each key is a listener type (see the static final <code>EVENT_XXX</code> constants),
*   each value is an array of listener objects that are subscribed to that particular event.
*
*   @property listeners
*   @protected
*   @type Object
*   @default <pre>
{
&nbsp;     "request": []
&nbsp;,   "succss": []
&nbsp;,   "error": []
&nbsp;,   "discover": []
&nbsp;,   "discoversuccss": []
&nbsp;,   "discovererror": []
&nbsp;,   "execute": []
&nbsp;,   "executesuccss": []
&nbsp;,   "executeerror": []
}</pre>
*/
    listeners: null,
/**
*   The soap message sent in the last request to the server.
*
*   @property soapMessage
*   @type {string}
*   @default null
*/
    soapMessage: null,
/**
*   This property is set to <code>null</code> right before sending an XML/A request.
*   When a successfull response is received, it is processed and the response object is assigned to this property.
*   The response object is either a
*   <code><a href="Rowset.html#class_Rowset">Rowset</a></code> (after a successful invocation of XML/A <code>Discover</code> method, see: <code><a href="method_discover">discover()</a></code>) or a
*   <code><a href="Resultset.html#class_Resultset">Resultset</a></code> (after a successful invocation of the XML/A <code>Execute</code> method, see: <code><a href="method_execute">execute()</a></code>)
*   instance.
*
*   If you are interested in processing the raw response XML, see
*   <code><a href="#property_responseXML">responseXML</a></code> and
*   <code><a href="#property_responseText">responseText</a></code>.
*
*   Note that it is not safe to read this property immediately after doing an asynchronous request.
*   For asynchronous requests, you can read this property by the time the <code>XXX_SUCCESS</code> event handlers are notified (until it is set to <code>null</code> again by a subsequent request).
*
*   @property response
*   @type Xmla.Rowset|Xmla.Dataset
*   @default null
*/
    response: null,
/**
*   This property is set to <code>null</code> right before sending an XML/A request.
*   When a successfull response is received, the XML response is stored to this property as plain text.
*
*   If you are interested in processing a DOM document rather than the raw XML text, see the
*   <code><a href="#property_responseXML">responseXML</a></code> property.
*
*   If you are interested in traversing the dataset returned in the XML/A response, see the
*   <code><a href="#property_response">response</a></code> property.
*
*   Note that it is not safe to read this property immediately after doing an asynchronous request.
*   For asynchronous requests, you can read this property by the time the <code>XXX_SUCCESS</code> event handlers are notified (until it is set to <code>null</code> again by a subsequent request).
*
*   @property responseText
*   @type {string}
*   @default null
*/
    responseText: null,
/**
*   This property is set to <code>null</code> right before sending an XML/A request.
*   When a successfull response is received, the XML response is stored to this property as a DOM Document.
*
*   If you are interested in processing the raw XML text rather than a DOM document, see the
*   <code><a href="#property_responseText">responseText</a></code> property.
*
*   If you are interested in traversing the dataset returned in the XML/A response, see the
*   <code><a href="#property_response">response</a></code> property.
*
*   Note that it is not safe to read this property immediately after doing an asynchronous request.
*   For asynchronous requests, you can read this property by the time the <code>XXX_SUCCESS</code> event handlers are notified (until it is set to <code>null</code> again by a subsequent request).
*
*   @deprecated
*   @property responseXML
*   @type {DOMDocument}
*   @default null
*   @see getRep
*/
    responseXML: null,
/**
*   @method getResponseXML
*   @return {DOMDocument}
*/
    getResponseXML: function(){
        if (this.options.forceResponseXMLEmulation !== true) {
          return this.responseXML;
        }
        else
        if (this.responseText === this._responseTextForResponseXML && this.responseXML) {
          return this.responseXML;
        }
        
        this.responseXML = _xjs(this.responseText);
        this._responseTextForResponseXML = this.responseText;
        return this.responseXML;
    },
/**
*    This method can be used to set a number of default options for the Xmla instance.
*    This is especially useful if you don't want to pass each and every option to each method call all the time.
*    Where appropriate, information that is missing from the parameter objects passed to the methods of the Xmla object
*   may be augmented with the values set through this method.
*    For example, if you plan to do a series of requests pertaining to one particular datasource,
*    you can set the mandatory options like url, async, datasource and catalog just once:
*    <pre>
&nbsp;   xmla.setOptions({
&nbsp;       url: "http://localhost:8080/pentaho/Xmla",
&nbsp;       async: true,
&nbsp;       properties: {
&nbsp;           DataSourceInfo: "Pentaho Analysis Services",
&nbsp;           Catalog: "Foodmart"
&nbsp;       }
&nbsp;   });
*    </pre>
*    Then, a subsequent <code></code>
*    @method setOptions
*    @param Object
*/
    setOptions: function(options){
        _applyProps(
            this.options,
            options,
            true
        );
    },
/**
*   This method can be used to register one or more listeners. On such listener can listen for one or more events.
*   <p>For a single listener, you can pass a <code>listener</code> object literal with the following structure:</p><pre>{
*       events: ...event name or array of event names...,
*       handler: ...function or array of functions...,
*       scope: object
*   }</pre>
*   <p>
*       You can use <code>event</code> as an alias for <code>events</code>.
*       Likewise, you can use <code>handlers</code> as an alias for <code>handler</code>.
*   </p>
*   <p>
*       Alternatively, you can pass the element as separate arguments instead of as an object literal:
*       <code>addListener(name, func, scope)</code>
*       where name is a valid event name, func is the function that is to be called when the event occurs.
*       The last argument is optional and can be used to specify the scope that will be used as context for executing the function.
*   </p>
*   <p>
*       To register multiple listeners, pass an array of listener objects:
*       <code>addListener([listener1, ..., listenerN])</code>
*   </p>
*   <p>
*       Alternatively, pass multiple listener objects as separate arguments:
*       <code>addListener(listener1, ..., listenerN)</code>
*   </p>
*   <p>
*       Or, pass a single object literal with event names as keys and listener objects or functions as values:
*       <pre>addListener({
*           discover: function() {
*               ...handle discover event...
*           },
*           error: {
*               handler: function() {
*                  ...handle error event...
*               },
*               scope: obj
*           },
*           scope: defaultscope
*       })</pre>
*       In this case, you can use scope as a key to specify the default scope for the handler functions.
*   </p>
*   <p>Below is a more detailed description of the listener object and its components:</p>
*   <dl>
*       <dt><code>events</code></dt>
*       <dd><code>string</code>|<code>string[]</code> REQUIRED.
*         The event or events to listen to.
*         You can specify a single event by using one of the <code>EVENT_XXX</code> string constant values.
*         You can specify multiple events by using an array of <code>EVENT_XXX</code> string constant values.
*         You can also use one of the predefined <code>EVENT_XXX</code> array constant values,
*         or use array concatenation and compose a custom list of event names.
*         To listen to all events, either use <code><a href="#property_EVENT_ALL">EVENT_ALL</a></code>,
*         or otherwise the <code>string</code> value <code>"all"</code>.
*         Below is the list of constants that may be used for the events or events property: <ul>
*           <li><a href="#property_EVENT_ALL">EVENT_ALL</a> - All events. As a convenience, the string alias <code>"all"</code> may also be used.</li>
*           <li><a href="#property_EVENT_DISCOVER">EVENT_DISCOVER</a> - Fires before issueing a <a href="#method_discover">discover()</a> request.</li>
*           <li><a href="#property_EVENT_DISCOVER_ALL">EVENT_DISCOVER_ALL</a> - All events related to <a href="#method_discover">discover()</a> requests, including <a href="#property_EVENT_DISCOVER">EVENT_DISCOVER</a>, <a href="#property_EVENT_DISCOVER">EVENT_DISCOVER_SUCCESS</a> and <a href="#property_EVENT_DISCOVER">EVENT_DISCOVER_ERROR</a>.</li>
*           <li><a href="#property_EVENT_DISCOVER_ERROR">EVENT_DISCOVER_ERROR</a> - Fired when an error occurred while servicing a <a href="#method_discover">discover()</a> request.</li>
*           <li><a href="#property_EVENT_DISCOVER_SUCCESS">EVENT_DISCOVER_SUCCESS</a> - Fired when a <a href="#method_discover">discover()</a> request completes successfully.</li>
*           <li><a href="#property_EVENT_ERROR">EVENT_ERROR</a> - Fired when an error occurred while servicing any request.</li>
*           <li><a href="#property_EVENT_EXECUTE">EVENT_EXECUTE</a> - Fires before issueing a <a href="#method_execute">execute()</a> request.</li>
*           <li><a href="#property_EVENT_EXECUTE_ALL">EVENT_EXECUTE_ALL</a> - All events related to <a href="#method_execute">execute()</a> requests, including <a href="#property_EVENT_EXECUTE">EVENT_EXECUTE</a>, <a href="#property_EVENT_DISCOVER">EVENT_EXECUTE_SUCCESS</a> and <a href="#property_EVENT_EXECUTE">EVENT_EXECUTE_ERROR</a>.</li>
*           <li><a href="#property_EVENT_EXECUTE_ERROR">EVENT_EXECUTE_ERROR</a> - Fired when an error occurred while servicing a <a href="#method_execute">execute()</a> request.</li>
*           <li><a href="#property_EVENT_EXECUTE_SUCCESS">EVENT_EXECUTE_SUCCESS</a> - Fired when a <a href="#method_execute">execute()</a> request completes successfully.</li>
*           <li><a href="#property_EVENT_GENERAL">EVENT_GENERAL</a> - All non-method specific events, including  <a href="#property_EVENT_DISCOVER">EVENT_DISCOVER</a>, <a href="#property_EVENT_SUCCESS">EVENT_SUCCESS</a> and <a href="#property_EVENT_ERROR">EVENT_ERROR</a>.</li>
*           <li><a href="#property_EVENT_REQUEST">EVENT_REQUEST</a> - Fires before issueing any request.</li>
*           <li><a href="#property_EVENT_REQUEST">EVENT_SUCCESS</a> - Fires to indicate a request was successful.</li>
*         </ul>
*       </dd>
*       <dt><code>event</code></dt>
*       <dd><code>string</code>|<code>string[]</code> Alias for <code>events</code></dd>
*       <dt><code>handler</code></dt>
*       <dd><code>function</code>|<code>function[]</code> REQUIRED.
*       This function will be called and notified whenever one of the specified events occurs.
*       The function has the following signature: <code>boolean handler(string eventName, object eventData, Xmla xmla)</code>
*       You can also pass in an array of functions if you want multiple functions to be called when the event occurs.
*       The function is called in scope of the <code>scope</code> property of the listener object.
*       If no <code>scope</code> is specified, a global function is assumed.
*       The <code>handler</code> function has the following arguments:
*           <dl>
*               <dt><code>eventName</code></dt>
*               <dd><code>string</code> The event for which notification is given.
*               This is useful to distinguish between events in case the same handler function is used for multiple events.
*               In this case, use the <code>EVENT_XXX</code> constants to check the <code>eventName</code>.</dd>
*               <dt><code>eventData</code></dt>
*               <dd><code>Object</code> An object that conveys event-specific data.</dd>
*               <dt><code>xmla</code></dt>
*               <dd><code><a href="class_Xmla">Xmla</a></code> A reference to this <code>Xmla</code> instance that is the source of the event.
*                   Listeners can obtain the response as well as the original SOAP message sent to the server through this instance.
*                   This allows one listener to be shared across multiple <code>Xmla</code> instances without managing the context manually.
*               </dd>
*           </dl>
*       For events that are <em>cancelable</em>, the handler should return a <code>boolean</code>.
*       If the handler returns <code>false</code> the respective operation will be canceled.
*       Otherwise, the operation continues (but may be canceled by another handler).
*       Currently, the following events are cancelable:
*       <code><a href="#property_EVENT_DISCOVER">EVENT_DISCOVER</a></code>,
*       <code><a href="#property_EVENT_EXECUTE">EVENT_EXECUTE</a></code>, and
*       <code><a href="#property_EVENT_REQUEST">EVENT_REQUEST</a></code>.
*       </dd>
*       <dt><code>handlers</code></dt>
*       <dd><code>function</code>|<code>function[]</code> Alias for <code>handler</code></dd>
*       <dt><code>scope</code></dt>
*       <dd><code>Object</code> OPTIONAL When specified, this object is used as the <code>this</code> object when calling the handler.
*           When not specified, the global <code>window</code> is used.
*       </dd>
*   </dl>
*   @method addListener
*   @param {Object|Array} listener An object that defines the events and the notification function to be called, or an array of such objects.
*/
    addListener: function(){
        var n = arguments.length, handler, scope;
        switch(n) {
            case 0:
                Xmla.Exception._newError(
                    "NO_EVENTS_SPECIFIED",
                    "Xmla.addListener",
                    null
                )._throw();
            case 1:
                var arg = arguments[0];
                if (_isObj(arg)) {
                    var events;
                    if (_isArr(arg)) this._addListeners(arg)
                    else
                    if (events = arg.events || arg.event) {
                        if (_isStr(events)) events = (events === "all") ? Xmla.EVENT_ALL : events.split(",");
                        if (!(_isArr(events))){
                            Xmla.Exception._newError(
                                "WRONG_EVENTS_FORMAT",
                                "Xmla.addListener",
                                arg
                            )._throw();
                        }
                        var i;
                        n = events.length;
                        for (i = 0; i < n; i++) this._addListener(events[i], arg);
                    }
                    else {
                        scope = arg.scope;
                        if (_isUnd(scope)) scope = null;
                        else delete arg.scope;
                        for (events in arg) {
                            handler = arg[events];
                            if (_isUnd(handler.scope)) handler.scope = scope;
                            this._addListener(events, handler);
                        }
                    }
                }
                else
                    Xmla.Exception._newError(
                        "WRONG_EVENTS_FORMAT",
                        "Xmla.addListener",
                        arg
                    )._throw();
                break;
            case 2:
            case 3:
                var event = arguments[0];
                scope = arguments[2];
                handler = arguments[1];
                if (_isStr(event) && (_isFun(handler)||(_isObj(handler)))) this._addListener(event, handler, scope);
                else {
                    var arr = [event, handler];
                    if (scope) arr.push(scope);
                    this.addListener(arr);
                }
                break;
            default:
                this._addListeners(arguments);
        }
    },
    _addListeners: function(listeners) {
        var i, n = listeners.length;
        for (i = 0; i < n; i++) this.addListener(listeners[i]);
    },
    _addListener: function(name, handler, scope) {
        var myListeners = this.listeners[name];
        if (!myListeners)
            Xmla.Exception._newError(
                "UNKNOWN_EVENT",
                "Xmla.addListener",
                {event: name, handler: handler, scope: scope}
            )._throw();
        if (!scope) scope = null;
        switch (typeof(handler)) {
            case "function":
                myListeners.push({handler: handler, scope: scope});
                break;
            case "object":
                var handlers = handler.handler || handler.handlers;
                if (handler.scope) scope = handler.scope;
                if (_isFun(handlers)) {
                    myListeners.push({handler: handlers, scope: scope});
                }
                else
                if (_isArr(handlers)) {
                    var i, n = handlers.length;
                    for (i = 0; i < n; i++) this._addListener(name, handlers[i], scope);
                }
                break;
        }
    },
    _fireEvent: function(eventName, eventData, cancelable){
        var listeners = this.listeners[eventName];
        if (!listeners) {
            Xmla.Exception._newError(
                "UNKNOWN_EVENT",
                "Xmla._fireEvent",
                eventName
            )._throw();
        }
        var n = listeners.length, outcome = true;
        if (n) {
            var listener, listenerResult, i;
            for (i = 0; i < n; i++){
                listener = listeners[i];
                listenerResult = listener.handler.call(
                    listener.scope,
                    eventName,
                    eventData,
                    this
                );
                if (cancelable && listenerResult===false){
                    outcome = false;
                    break;
                }
            }
        }
        else //if there is neither a listener nor an error nor a general callback  we explicitly throw the exception.
        if (eventName === Xmla.EVENT_ERROR && !_isFun(eventData.error) && !_isFun(eventData.callback)) eventData.exception._throw();
        return outcome;
    },
/**
*   Create a XML/A SOAP message that may be used as message body for a XML/A request
*   @method getXmlaSoapMessage
*   @param {object} options An object representing the message. The object can have these properties:
*   @return {string} The SOAP message.
**/
    getXmlaSoapMessage: function getXmlaSoapMessage(options){
        var method = options.method,
            msg = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
            "\n<" + _xmlnsSOAPenvelopePrefix + ":Envelope" +
            " " + _xmlnsIsSOAPenvelope +
            " " + _SOAPencodingStyle + ">" +
            "\n <" + _xmlnsSOAPenvelopePrefix + ":Body>" +
            "\n  <" + method + " " + _xmlnsIsXmla + " " + _SOAPencodingStyle + ">"
        ;
        switch(method){
            case Xmla.METHOD_DISCOVER:
                if (!options.requestType) {
                    Xmla.Exception._newError(
                        "MISSING_REQUEST_TYPE",
                        "Xmla._getXmlaSoapMessage",
                        options
                    )._throw();
                }
                msg += "\n   <" + _xmlRequestType + ">" + options.requestType + "</" + _xmlRequestType + ">" +
                    _getXmlaSoapList("Restrictions", "RestrictionList", options.restrictions, "   ") +
                    _getXmlaSoapList("Properties", "PropertyList", options.properties, "   ");
                break;
            case Xmla.METHOD_EXECUTE:
                if (!options.statement){
                    Xmla.Exception._newError(
                        "MISSING_REQUEST_TYPE",
                        "Xmla._getXmlaSoapMessage",
                        options
                    )._throw();
                }
                msg += "\n   <Command>" +
                    "\n    <Statement>" + _xmlEncode(options.statement) + "</Statement>" +
                    "\n   </Command>" +
                    _getXmlaSoapList("Properties", "PropertyList", options.properties, "   ")
                ;
                break;
            default:
                //we used to throw an exception here,
                //but this would make it impossible
                //to execute service or provider specific methods.
        }
        msg += "\n  </" + method + ">" +
            "\n </" + _xmlnsSOAPenvelopePrefix + ":Body>" +
            "\n</" + _xmlnsSOAPenvelopePrefix + ":Envelope>"
        ;
        return msg;
    },
/**
*   Sends a request to the XML/A server.
*   This method is rather low-level and allows full control over the request
*   by passing an options object. General properties of the options object are:
*   <ul>
*       <li><code>method</code> {string} REQUIRED the XML/A method to invoke. This should be one of the following constants:
*           <dl>
*               <dt><code><a href="#property_METHOD_DISCOVER">METHOD_DISCOVER</a></code></dt>
*               <dd>
*                   <p>
*                   This method is used to obtain metadata from the XML/A service or XML/A provider.
*                   Metadata is returned in a tabular format called Schema Rowsets, which are represented by an instance of the
*                   <code><a href="Xmla.Rowset.html#class_Xmla.Rowset">Xmla.Rowset</a></code> class.
*                   For these types of requests, you must pass the <code>requestType</code> option to specify which schema rowset you want to obtain.
*                   In addition, you can specify a <code>restrictions</code> object that is used as filter criteria to restrict which rows will be returned in the rowset.
*                   </p>
*                   <p>
*                   Instead of explicitly passing <code>METHOD_DISCOVER</code> as the <code>requestType</code>, you can also call the
*                   <code><a href="#method_discover">discover()</a></code> method (which requires you to explictly pass a <code>requestType</code> option).
*                   Finally, you can also call one of the <code>discoverXXX()</code> methods in order to request a particular schema rowset.
*                   </p>
*               </dd>
*               <dt><code><a href="#property_METHOD_EXECUTE">METHOD_EXECUTE</a></code></dt>
*               <dd>
*                   <p>
*                   This method is used to send an MDX quey to the XML/A provider.
*                   Query results are returned in a multidimentsional format which is represented by an instance of the
*                   <code><a href="Xmla.Dataset.html#class_Xmla.Dataset">Xmla.Dataset</a></code> class.
*                   For these types of requests, you must pass the <code>statement</code> option to specify the MDX query.
*                   </p>
*                   <p>
*                   Instead of explicitly passing <code>METHOD_EXECUTE</code> as the <code>requestType</code>, you can also call the
*                   <code><a href="#method_execute">execute()</a></code> method.
*                   </p>
*               </dd>
*           </dl>
*       </li>
*       <li><code>url</code> {string} REQUIRED the URL of XML/A service, or of a XML/A datasource.
*           Typically, you first use the URL of a XML/A service (like <code>http://your.pentaho.server:8080/pentaho/Xmla?userid=joe&amp;password=password</code>)
*           and use that to retrieve the <code>DISCOVER_DATASOURCES</code> rowset.
*           Then, you can connect to a XML/A datasource using the value returned by the <code>URL</code> column of the <code>DISCOVER_DATASOURCES</code> rowset
*           (typically, you also have to set a <code>DataSourceInfo</code> property using the value found in the <code>DataSourceInfo</code> column of the <code>DISCOVER_DATASOURCES</code> rowset).
*       </li>
*       <li>
*           <code>properties</code> {Object} XML/A properties.
*           The appropriate types and values of XML/A properties are dependent upon the specific method and requestType.
*           The XML/A standard defines a set of pre-defined properties.
*           The <code>Xmla</code> class defines a static final property for each of these (see the <code>PROP_XXX</code> constants).
*           The list of all valid properties can be obtained from the <code>DISCOVER_PROPERTIES</code> schema rowset
*           (see <code><a href="#method_discoverProperties()">discoverProperties()</a></code>).
*           Each javascript property of the <code>properties</code> object is mapped literally to a XML/A property.
*       </li>
*       <li><code>async</code> {boolean}
*           Determines how the request is performed:<ul>
*               <li><code>true</code>: The request is performed asynchronously: the call to <code>request()</code> will not block and return immediately.
*               In this case, the return value of the <code>request()</code> method is not defined,
*               and the response must be received by registering a listener.
*               (see <code><a href="#method_addListener">addListener()</a></code>).
*
*               As an alternative to using listeners, you can also pass
*               <code>success</code>, <code>error</code> and <code>callback</code> callback functions.
*               Callbacks are described in more detail below.
*               </li>
*               <li><code>false</code>: The request is performed synchronously: the call to <code>request()</code> will block until it receives a response from the XML/A server or times out.
*               In this case, the <code>request()</code> method returns
*               a <code>Rowset</code> (for <code>Discover</code> requests) or
*               a <code>Resultset</code> (for <code>Execute</code> requests).
*               If you registered any listeners (see <code><a href="#method_addListener">addListener()</a></code>),
*               then these will still be notified of any events (such as receiving the response).
*               </li>
*           </ul>
*       </li>
*       <li><code>success</code> (function)
*           A function that is to be called after the requests is executed and a successful response is receieved.
*           Any listeners appropriate for the request are called after this handler is executed.
*       </li>
*       <li><code>error</code> (function)
*           A function that is to be called after the requests is executed and an error was encountered.
*           Any listeners appropriate for the request are called after this handler is executed.
*       </li>
*       <li><code>callback</code> (function)
*           A function that is to be called after the requests is executed and the response is receieved,
*           and after calling any listeners that are appropriate for the request.
*           This function will be called both in case of success and of error.
*           If the options also contain a <code>success</code> and/or <code>error</code> handler, then
*           <code>callback</code> will be called after those more specific handlers are called.
*       </li>
*   </ul>
*   Other parts of the <code>options</code> object are method-specific.
*   <ul>
*       <li>The following options are applicable in case the <code>method</code> is <code>METHOD_DISCOVER</code>:
*           <ul>
*               <li><code>requestType</code> - {string} Applies to the Discover method and indicates the kind of schema rowset to retrieve.
*                   You can use one of the <code>DISCOVER_XXX</code>, <code>DBSCHEMA_XXX</code> or <code>MDSCHEMA_XXX</code> constants for this property.
*                   You can also dymically discover which values for <code>requestType</code> are supported by the XML/A provider using the
*                   <code>DISCOVER_SCHEMA_ROWSETS</code> rowset (see: <code><a href="method_discoverMDSchemaRowsets">discoverMDSchemaRowsets()</a></code>).
*                   See the <code><a href="#method_discover">discover()</a></code> method for more information.
*               </li>
*               <li>
*                   <code>restrictions</code> {Object} XML/A restrictions are used to filter the requested schema rowset.
*                   For more information on restrictions, see the <code><a href="#method_discover">discover()</a></code> method.
*               </li>
*           </ul>
*       </li>
*       <li>The following options are applicable in case the <code>method</code> is <code>METHOD_EXECUTE</code>:
*           <ul>
*               <li><code>statement</code> - {string} Applies to the Execute method and specifies the MDX query to send to the server.
*               </li>
*           </ul>
*       </li>
*   </ul>
*   Instead of calling this method directly, consider calling
*   <code><a href="#method_discover">discover()</a></code> (to obtain a schema rowset),
*   <code><a href="#method_execute">execute()</a></code> (to issue a MDX query),
*   or one of the specialized <code>discoverXXX()</code> methods (to obtain a particular schema rowset).
*   @method request
*   @param {Object} options An object whose properties convey the options for the request.
*   @return {Xmla.Rowset|Xmla.Dataset} The result of the invoking the XML/A method. For an asynchronous request, the return value is not defined. For synchronous requests, <code>Discover</code> requests return an instance of a <code>Xmla.Rowset</code>, and <code>Execute</code> results return an instance of a <code>Xmla.Dataset</code>.
*/
    request: function(options){
        var ex, xmla = this;

        this.response = null;
        this.responseText = null;
        this.responseXML = null;

        options = _applyProps(options, this.options, false);
        if (!options.url){
            ex = Xmla.Exception._newError(
                "MISSING_URL",
                "Xmla.request",
                options
            );
            ex._throw();
        }
        options.properties = _applyProps(options.properties, this.options.properties, false);
        options.restrictions = _applyProps(options.restrictions, this.options.restrictions, false);
        delete options.exception;

        if (
          !this._fireEvent(Xmla.EVENT_REQUEST, options, true) ||
          (options.method == Xmla.METHOD_DISCOVER && !this._fireEvent(Xmla.EVENT_DISCOVER, options)) ||
          (options.method == Xmla.METHOD_EXECUTE  && !this._fireEvent(Xmla.EVENT_EXECUTE,  options))
        ){
          return false;
        }

        var soapMessage = this.getXmlaSoapMessage(options);
        this.soapMessage = soapMessage;
        var myXhr;
        var ajaxOptions = {
            async: options.async,
            timeout: options.requestTimeout,
            data: soapMessage,
            error:      function(exception){
                            options.exception = exception;
                            xmla._requestError(options, exception);
                        },
            complete:   function(xhr){
                            options.xhr = xhr;
                            xmla._requestSuccess(options);
                        },
            url: options.url
        };
        if (options.username) {
          ajaxOptions.username = options.username;
        }
        if (options.password) {
          ajaxOptions.password = options.password;
        }
        
        var headers = {};
        if (this.options.headers) {
          headers = _applyProps(headers, this.options.headers);
        }
        if (options.headers) {
          headers = _applyProps(headers, options.headers, true);
        }
        ajaxOptions.headers = headers;

        myXhr = _ajax(ajaxOptions);
        return this.response;
    },
    _requestError: function(options, exception) {
        if (options.error) {
          options.error.call(options.scope ? options.scope : null, this, options, exception);
        }
        if (options.callback) {
          options.callback.call(options.scope ? options.scope : null, Xmla.EVENT_ERROR, this, options, exception);
        }
        this._fireEvent(Xmla.EVENT_ERROR, options);
    },
    //https://msdn.microsoft.com/en-us/library/ms187142.aspx#handling_soap_faults
    _parseSoapFault: function(soapFault){
      //Get faultactor, faultstring, faultcode and detail elements
      function _parseSoapFaultDetail(detailNode){
        var errors = [];
        var i, childNodes = detailNode.childNodes, n = childNodes.length, childNode;
        for (i = 0; i < n; i++) {
          childNode = childNodes[i];
          if (childNode.nodeType !== 1) {
            continue;
          }
          switch (childNode.nodeName){
            case "Error":
              errors.push({
                ErrorCode: _getAttribute(childNode, "ErrorCode"),
                Description: _getAttribute(childNode, "Description"),
                Source: _getAttribute(childNode, "Source"),
                HelpFile: _getAttribute(childNode, "HelpFile")
              });
              break;
            default:
          }
        }
        return errors;
      }

      var fields = {}, field, nodeName;
      var i, childNodes = soapFault.childNodes, n = childNodes.length, childNode;
      for (i = 0; i < n; i++){
        childNode = childNodes[i];
        if (childNode.nodeType !== 1) {
          continue;
        }
        nodeName = childNode.nodeName;
        switch (nodeName) {
          case "faultactor":
          case "faultstring":
          case "faultcode":
            field = _getElementText(childNode);
            break;
          case "detail":
            field = _parseSoapFaultDetail(childNode);
            break;
          default:
            field = null;
            break;
        }
        if (field) {
          fields[nodeName] = field;
        }
      }
      return fields;
    },
    _requestSuccess: function(request) {
        var xhr = request.xhr, response;
        if (request.forceResponseXMLEmulation !== true) {
          this.responseXML = xhr.responseXML;
        }
        this.responseText = xhr.responseText;

        var method = request.method;

        try {
            var responseXml = this.getResponseXML();
            if (!responseXml) {
              request.exception = new Xmla.Exception(
                  Xmla.Exception.TYPE_ERROR,
                  Xmla.Exception.ERROR_PARSING_RESPONSE_CDE, 
                  "Response is not an XML document."
              );
            }
            var soapFault = _getElementsByTagNameNS(responseXml, _xmlnsSOAPenvelope, _xmlnsSOAPenvelopePrefix, "Fault");
            if (soapFault.length) {
                //TODO: extract error info
                soapFault = soapFault[0];
                soapFault = this._parseSoapFault(soapFault);
                //type, code, message, helpfile, source, data, args, detail, actor
                request.exception = new Xmla.Exception(
                    Xmla.Exception.TYPE_ERROR,
                    soapFault.faultcode, soapFault.faultstring,
                    null, "_requestSuccess",
                    request, null,
                    soapFault.detail, soapFault.faultactor
                );
            }
            else {
                switch(method){
                    case Xmla.METHOD_DISCOVER:
                        request.rowset = response = new Xmla.Rowset(responseXml, request.requestType, this);
                        break;
                    case Xmla.METHOD_EXECUTE:
                        var resultset = null, dataset = null;
                        var format = request.properties[Xmla.PROP_FORMAT];
                        switch(format){
                            case Xmla.PROP_FORMAT_TABULAR:
                                response = resultset = new Xmla.Rowset(responseXml, null, this);
                                break;
                            case Xmla.PROP_FORMAT_MULTIDIMENSIONAL:
                                response = dataset = new Xmla.Dataset(responseXml);
                                break;
                        }
                        request.resultset = resultset;
                        request.dataset = dataset;
                        break;
                }
                this.response = response;
            }
        }
        catch (exception) {
            request.exception = exception;
        }
        if (request.exception) {
            switch(method){
                case Xmla.METHOD_DISCOVER:
                    this._fireEvent(Xmla.EVENT_DISCOVER_ERROR, request);
                    break;
                case Xmla.METHOD_EXECUTE:
                    this._fireEvent(Xmla.EVENT_EXECUTE_ERROR, request);
                    break;
            }
            if (request.error) {
              request.error.call(request.scope ? request.scope : null, this, request, request.exception);
            }
            if (request.callback) {
              request.callback.call(request.scope ? request.scope : null, Xmla.EVENT_ERROR, this, request, request.exception);
            }
            this._fireEvent(Xmla.EVENT_ERROR, request);
        }
        else {
            switch(method){
                case Xmla.METHOD_DISCOVER:
                    this._fireEvent(Xmla.EVENT_DISCOVER_SUCCESS, request);
                    break;
                case Xmla.METHOD_EXECUTE:
                    this._fireEvent(Xmla.EVENT_EXECUTE_SUCCESS, request);
                    break;
            }
            if (request.success) {
              request.success.call(
                request.scope ? request.scope : null,
                this, request, response
              );
            }
            if (request.callback) {
              request.callback.call(
                request.scope ? request.scope : null,
                Xmla.EVENT_SUCCESS, this, request, response
              );
            }
            this._fireEvent(Xmla.EVENT_SUCCESS, request);
        }
    },
/**
*   Sends an MDX query to a XML/A DataSource to invoke the XML/A <code>Execute</code> method and obtain the multi-dimensional resultset.
*   Options are passed using a generic <code>options</code> object.
*   Applicable properties of the <code>options</code> object are:
*   <ul>
*       <li><code>url</code> {string} REQUIRED the URL of a XML/A datasource.
*           This should be a value obtained from the <code>URL</code> column of the <code>DISCOVER_DATASOURCES</code> rowset
*           (see: <code><a href="method_discoverDataSources">discoverDataSources()</a></code>).
*       </li>
*       <li><code>statement</code> - {string} The MDX query to send to the server.
*       </li>
*       <li>
*           <code>properties</code> {Object} XML/A properties.
*           The list of all valid properties can be obtained from the <code>DISCOVER_PROPERTIES</code> schema rowset
*           (see <code><a href="#method_discoverProperties()">discoverProperties()</a></code>).
*           Typically, <code>execute()</code> requires these properties:<dl>
*               <dt><code>DataSourceInfo</code> property</dt>
*               <dd>Identifies a data source managed by the XML/A server.
*                   To specify this property, you can use the static final constant
*                   <code><a href="#property_PROP_DATASOURCEINFO">PROP_DATASOURCEINFO</a></code>
*                   as key in the <code>properties</code> object of the <code>options</code> object passed to the <code>execute()</code> method.
*                   Valid values for this property should be obtained from the <code>DataSourceInfo</code> column
*                   of the <code>DISCOVER_DATASOURCES</code> schema rowset (see: <code><a href="#method_discoverDataSources">discoverDataSources()</a></code>).
*                   Note that the values for the <code>DataSourceInfo</code> property and the <code>url</code> must both be taken from the same row of the <code>DISCOVER_DATASOURCES</code> schema rowset.
*               </dd>
*               <dt><code>Catalog</code> property</dt>
*               <dd>Identifies a catalog applicable for the datasource.
*                   To specify this property, you can use the static final constant
*                   <code><a href="#property_PROP_CATALOG">PROP_CATALOG</a></code>
*                   as key in the <code>properties</code> object of the <code>options</code> object passed to the <code>execute()</code> method.
*                   Valid values for this property should be obtained from the <code>CATALOG_NAME</code> column
*                   of the <code>DBSCHEMA_CATALOGS</code> schema rowset (see: <code><a href="#method_discoverDBCatalogs">discoverDBCatalogs()</a></code>).
*               </dd>
*           </dl>
*       </li>
*       <li><code>async</code> {boolean}
*           Determines how the request is performed:<ul>
*               <li><code>true</code>: The request is performed asynchronously: the call to <code>request()</code> will not block and return immediately.
*               In this case, the return value of the <code>request()</code> method is not defined,
*               and the response must be received by registering a listener
*               (see <code><a href="#method_addListener">addListener()</a></code>).
*               </li>
*               <li><code>false</code>: The request is performed synchronously: the call to <code>execute()</code> will block until it receives a response from the XML/A server or times out.
*               In this case, a <code>Resultset</code> is returned that represents the multi-dimensional data set.
*               If you registered any <code>REQUEST_XXX</code> and/or <code>EXECUTE_XXX</code> listeners (see <code><a href="#method_addListener">addListener()</a></code>),
*               then these will still be notified.
*               </li>
*           </ul>
*       </li>
*   </ul>
*   @method execute
*   @param {Object} options An object whose properties convey the options for the XML/A <code>Execute</code> request.
*   @return {Xmla.Dataset|Xmla.Rowset} The result of the invoking the XML/A <code>Execute</code> method. For an asynchronous request, the return value is not defined. For synchronous requests, an instance of a <code>Xmla.Dataset</code> that represents the multi-dimensional result set of the MDX query. If the <code>Format</code> property in the request was set to <code>Tabular</code>, then an instance of the
<code><a href="Xmla.Rowset#class_Xmla.Rowset">Rowset</a></code> class is returned to represent the <code>Resultset</code>.
*/
    execute: function(options) {
        var properties = options.properties;
        if (!properties){
            properties = {};
            options.properties = properties;
        }
        _applyProps(properties, this.options.properties, false)
        if (!properties[Xmla.PROP_CONTENT]) {
          properties[Xmla.PROP_CONTENT] = Xmla.PROP_CONTENT_SCHEMADATA;
        }
        if (!properties[Xmla.PROP_FORMAT]) {
          options.properties[Xmla.PROP_FORMAT] = Xmla.PROP_FORMAT_MULTIDIMENSIONAL;
        }
        var request = _applyProps(options, {
            method: Xmla.METHOD_EXECUTE
        }, true);
        return this.request(request);
    },
/**
*   Sends an MDX query to a XML/A DataSource to invoke the <code><a href="#method_execute">execute()</a></code> method using <code><a href="#property_PROP_FORMAT_TABULAR">PROP_FORMAT_TABULAR</a></code> as value for the <code><a href="#property_PROP_FORMAT_TABULAR">PROP_FORMAT</a></code> property. This has the effect of obtaining the multi-dimensional resultset as a <code><a href="Xmla.Rowset#class_Xmla.Rowset">Rowset</a></code>.
*   @method executeTabular
*   @param {Object} options An object whose properties convey the options for the XML/A <code>Execute</code> request.
*   @return {Xmla.Rowset} The result of the invoking the XML/A <code>Execute</code> method. For an asynchronous request, the return value is not defined. For synchronous requests, an instance of a <code>Xmla.Rowset</code> that represents the multi-dimensional result set of the MDX query.
*/
    executeTabular: function(options){
        if (!options.properties) {
          options.properties = {};
        }
        options.properties[Xmla.PROP_FORMAT] = Xmla.PROP_FORMAT_TABULAR;
        return this.execute(options);
    },
/**
*   Sends an MDX query to a XML/A DataSource to invoke the <code><a href="#method_execute</a></code> method using <code><a href="#property_PROP_FORMAT_MULTIDIMENSIONAL">PROP_FORMAT_MULTIDIMENSIONAL</a></code> as value for the <code><a href="#property_PROP_FORMAT_TABULAR">PROP_FORMAT</a></code> property. In this case, the result is available only as XML text or XML document in the <code><a href="#property_responseText">responseText</a></code>
and  <code><a href="#property_responseXML">responseXML</a></code> properties.
*   @method executeMultiDimensional
*   @param {Object} options An object whose properties convey the options for the XML/A <code>Execute</code> request.
*/
    executeMultiDimensional: function(options){
        if (!options.properties) {
          options.properties = {};
        }
        options.properties[Xmla.PROP_FORMAT] = Xmla.PROP_FORMAT_MULTIDIMENSIONAL;
        return this.execute(options);
    },
/**
*   Sends a request to invoke the XML/A <code>Discover</code> method and returns a schema rowset specified by the <code>requestType</code> option.
*   Options are passed using a generic <code>options</code> object.
*   Applicable properties of the <code>options</code> object are:
*   <ul>
*       <li><code>requestType</code> - {string} Indicates the kind of schema rowset to retrieve.
*           You can use one of the following predefined XML for Analysis Schema Rowset constants:
*           <ul>
*               <li><code><a href="#property_DISCOVER_DATASOURCES">DISCOVER_DATASOURCES</a></code></li>
*               <li><code><a href="#property_DISCOVER_ENUMERATORS">DISCOVER_ENUMERATORS</a></code></li>
*               <li><code><a href="#property_DISCOVER_KEYWORDS">DISCOVER_KEYWORDS</a></code></li>
*               <li><code><a href="#property_DISCOVER_LITERALS">DISCOVER_LITERALS</a></code></li>
*               <li><code><a href="#property_DISCOVER_PROPERTIES">DISCOVER_PROPERTIES</a></code></li>
*               <li><code><a href="#property_DISCOVER_SCHEMA_ROWSETS">DISCOVER_SCHEMA_ROWSETS</a></code></li>
*           </ul>
*           Or one of the applicable OLE DB Schema Rowset constants:
*           <ul>
*               <li><code><a href="#property_DBSCHEMA_CATALOGS">DBSCHEMA_CATALOGS</a></code></li>
*               <li><code><a href="#property_DBSCHEMA_COLUMNS">DBSCHEMA_COLUMNS</a></code></li>
*               <li><code><a href="#property_DBSCHEMA_PROVIDER_TYPES">DBSCHEMA_PROVIDER_TYPES</a></code></li>
*               <li><code><a href="#property_DBSCHEMA_SCHEMATA">DBSCHEMA_SCHEMATA</a></code></li>
*               <li><code><a href="#property_DBSCHEMA_TABLES">DBSCHEMA_TABLES</a></code></li>
*               <li><code><a href="#property_DBSCHEMA_TABLES_INFO">DBSCHEMA_TABLES_INFO</a></code></li>
*           </ul>
*           Or one of the applicable OLE DB for OLAP Schema Rowset constants:
*           <ul>
*               <li><code><a href="#property_MDSCHEMA_ACTIONS">MDSCHEMA_ACTIONS</a></code></li>
*               <li><code><a href="#property_MDSCHEMA_CUBES">MDSCHEMA_CUBES</a></code></li>
*               <li><code><a href="#property_MDSCHEMA_DIMENSIONS">MDSCHEMA_DIMENSIONS</a></code></li>
*               <li><code><a href="#property_MDSCHEMA_FUNCTIONS">MDSCHEMA_FUNCTIONS</a></code></li>
*               <li><code><a href="#property_MDSCHEMA_HIERARCHIES">MDSCHEMA_HIERARCHIES</a></code></li>
*               <li><code><a href="#property_MDSCHEMA_MEASURES">MDSCHEMA_MEASURES</a></code></li>
*               <li><code><a href="#property_MDSCHEMA_MEMBERS">MDSCHEMA_MEMBERS</a></code></li>
*               <li><code><a href="#property_MDSCHEMA_PROPERTIES">MDSCHEMA_PROPERTIES</a></code></li>
*               <li><code><a href="#property_MDSCHEMA_SETS">MDSCHEMA_SETS</a></code></li>
*           </ul>
*           You can also dymically discover which values for <code>requestType</code> are supported by the XML/A provider.
*           To do that, refer to the <code>SchemaName</code> column of the <code>DISCOVER_SCHEMA_ROWSETS</code> rowset
*           (see: <code><a href="method_discoverMDSchemaRowsets">discoverMDSchemaRowsets()</a></code>).
*       </li>
*       <li><code>url</code> {string} REQUIRED the url of the XML/A service or XML/A datasource.
*           If the value for the <code>requestType</code> option is one of the predefined XML/A <code><a href="">DISCOVER_XXX</a></code> constants,
*           then this should be the url of the XML/A service.
*       </li>
*       <li>
*           <code>properties</code> {Object} XML/A properties.
*           The appropriate types and values of XML/A properties are dependent upon the value passed as <code>requestType</code>.
*           The XML/A standard defines a set of pre-defined properties.
*           The <code>Xmla</code> class defines a static final property for each of these (see the <code>PROP_XXX</code> constants).
*           The list of all valid properties can be obtained from the <code>DISCOVER_PROPERTIES</code> schema rowset
*           (see <code><a href="#method_discoverProperties()">discoverProperties()</a></code>).
*           Each javascript property of the <code>properties</code> object is mapped literally to a XML/A property.
*       </li>
*       <li>
*           <code>restrictions</code> {Object} XML/A restrictions.
*           These are used to specify a filter that will be applied to the data in the schema rowset.
*           Each javascript property of the <code>restrictions</code> object is mapped to a column of the requested schema rowset.
*           The value for the restriction is sent with the request, and processed by the XML/A server to only return matching rows from the requested schema dataset.
*           The name, types and values of the restrictions are dependent upon which schema rowset is requested.
*           The available restrictions are specified by the <code>Restrictions</code> column of the <code>DISCOVER_SCHEMA_ROWSETS</code> schema rowset.
*           For a number of schema rowsets, the available restrictions are pre-defined.
*           These are documented together with each particular <code>discoverXXX()</code> method.
*       </li>
*       <li><code>async</code> {boolean}
*           Determines how the request is performed:<ul>
*               <li><code>true</code>: The request is performed asynchronously: the call to <code>request()</code> will not block and return immediately.
*               In this case, the return value of the <code>request()</code> method is not defined,
*               and the response must be received by registering a listener
*               (see <code><a href="#method_addListener">addListener()</a></code>).
*               </li>
*               <li><code>false</code>: The request is performed synchronously: the call to <code>execute()</code> will block until it receives a response from the XML/A server or times out.
*               In this case, a <code>Resultset</code> is returned that represents the multi-dimensional data set.
*               If you registered any <code>REQUEST_XXX</code> and/or <code>EXECUTE_XXX</code> listeners (see <code><a href="#method_addListener">addListener()</a></code>),
*               then these will still be notified.
*               </li>
*           </ul>
*       </li>
*   </ul>
*   Instead of calling this method directly, consider calling
*   or one of the specialized <code>discoverXXX()</code> methods to obtain a particular schema rowset.
*   @method discover
*   @param {Object} options An object whose properties convey the options for the XML/A <code>Discover</code> request.
*   @return {Xmla.Rowset} The result of the invoking the XML/A <code>Discover</code> method. For synchronous requests, an instance of a <code><a href="Xmla.Rowset.html#Xmla.Rowset">Xmla.Rowset</a></code> that represents the requested schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: <code><a href="#method_addListener">addListener()</a></code>) and listen for the <code>success</code> (see: <code><a href="#property_EVENT_SUCCESS">EVENT_SUCCESS</a></code>) or <code>discoversuccess</code> (see: <code><a href="#property_EVENT_DISCOVER_SUCCESS">EVENT_DISCOVER_SUCCESS</a></code>) events.
*/
    discover: function(options) {
        var request = _applyProps(options, {
            method: Xmla.METHOD_DISCOVER
        }, true);
        if (!request.requestType) {
          request.requestType = this.options.requestType;
        }
        if (!request.properties) {
          request.properties = {};
        }
        request.properties[Xmla.PROP_FORMAT] = Xmla.PROP_FORMAT_TABULAR;
        return this.request(request);
    },
/**
*   Invokes the <code><a href="#method_discover">discover()</a></code> method using <code><a href="#property_DISCOVER_DATASOURCES"></a></code> as value for the <code>requestType</code>,
*   and retrieves the <code>DISCOVER_DATASOURCES</code> schema rowset.
*   The rowset has the following columns:
*   <table border="1" class="schema-rowset">
*     <thead>
*       <tr>
*           <th>Column Name</th>
*           <th>Type</th>
*           <th>Description</th>
*           <th>Restriction</th>
*           <th>Nullable</th>
*       </tr>
*     </thead>
*     <tbody>
*       <tr>
*           <td>
*               DataSourceName
*           </td>
*           <td>
*               string
*           </td>
*           <td>
*               A name that identifies this data source.
*           </td>
*           <td>
*               Yes
*           </td>
*           <td>
*               No
*           </td>
*       </tr>
*       <tr>
*           <td>
*               DataSourceDescription
*           </td>
*           <td>
*               string
*           </td>
*           <td>
*               Human readable description of the datasource
*           </td>
*           <td>
*               No
*           </td>
*           <td>
*               Yes
*           </td>
*       </tr>
*       <tr>
*           <td>
*               URL
*           </td>
*           <td>
*               string
*           </td>
*           <td>
*               URL to use to submit requests to this provider.
*           </td>
*           <td>
*               Yes
*           </td>
*           <td>
*               Yes
*           </td>
*       </tr>
*       <tr>
*           <td>
*               DataSourceInfo
*           </td>
*           <td>
*               string
*           </td>
*           <td>
*               Connectstring
*           </td>
*           <td>
*               No
*           </td>
*           <td>
*               Yes
*           </td>
*       </tr>
*       <tr>
*           <td>
*               ProviderName
*           </td>
*           <td>
*               string
*           </td>
*           <td>
*               A name indicating the product providing the XML/A implementation
*           </td>
*           <td>
*               Yes
*           </td>
*           <td>
*               Yes
*           </td>
*       </tr>
*       <tr>
*           <td>
*               ProviderType
*           </td>
*           <td>
*               string[]
*           </td>
*           <td>
*               The kind of data sets supported by this provider.
*               The following values are defined by the XML/A specification:
*               <dl>
*                   <dt>TDP</dt><dd>tabular data provider.</dd>
*                   <dt>MDP</dt><dd>multidimensiona data provider.</dd>
*                   <dt>DMP</dt><dd>data mining provider.</dd>
*               </dl>
*               Note: multiple values are possible.
*           </td>
*           <td>
*               Yes
*           </td>
*           <td>
*               No
*           </td>
*       </tr>
*       <tr>
*           <td>
*               AuthenticationMode
*           </td>
*           <td>
*               string
*           </td>
*           <td>
*               Type of security offered by the provider
*               The following values are defined by the XML/A specification:
*               <dl>
*                   <dt>Unauthenticated</dt><dd>no user ID or password needs to be sent.</dd>
*                   <dt>Authenticated</dt><dd>User ID and password must be included in the information required for the connection.</dd>
*                   <dt>Integrated</dt><dd> the data source uses the underlying security to determine authorization</dd>
*               </dl>
*           </td>
*           <td>
*               Yes
*           </td>
*           <td>
*               No
*           </td>
*       </tr>
*     </tbody>
*   </table>
*
*   @method discoverDataSources
*   @param {Object} options An object whose properties convey the options for the XML/A a <code>DISCOVER_DATASOURCES</code> request.
*   @return {Xmla.Rowset} The result of the invoking the XML/A <code>Discover</code> method. For synchronous requests, an instance of a <code><a href="Xmla.Rowset.html#Xmla.Rowset">Xmla.Rowset</a></code> that represents the <code>DISCOVER_DATASOURCES</code> schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: <code><a href="#method_addListener">addListener()</a></code>) and listen for the <code>success</code> (see: <code><a href="#property_EVENT_SUCCESS">EVENT_SUCCESS</a></code>) or <code>discoversuccess</code> (see: <code><a href="#property_EVENT_DISCOVER_SUCCESS">EVENT_DISCOVER_SUCCESS</a></code>) events.
*/
    discoverDataSources: function(options){
        var request = _applyProps(options, {
            requestType: Xmla.DISCOVER_DATASOURCES
        }, true);
        return this.discover(request);
    },
/**
*   Invokes the <code><a href="#method_discover">discover()</a></code> method using <code><a href="#property_DISCOVER_PROPERTIES"></a></code> as value for the <code>requestType</code>,
*   and retrieves the <code>DISCOVER_PROPERTIES</code> schema rowset.
*   This rowset provides information on the properties that are supported by the XML/A provider.
*   The rowset has the following columns:
*   <table border="1" class="schema-rowset">
*     <thead>
*       <tr>
*           <th>Column Name</th>
*           <th>Type</th>
*           <th>Description</th>
*           <th>Restriction</th>
*           <th>Nullable</th>
*       </tr>
*     </thead>
*     <tbody>
*       <tr>
*           <td>
*               PropertyName
*           </td>
*           <td>
*               string
*           </td>
*           <td>
*               The name of the property
*           </td>
*           <td>
*               Yes (array)
*           </td>
*           <td>
*               No
*           </td>
*       </tr>
*       <tr>
*           <td>
*               PropertyDescription
*           </td>
*           <td>
*               string
*           </td>
*           <td>
*               Human readable description of the property
*           </td>
*           <td>
*               No
*           </td>
*           <td>
*               Yes
*           </td>
*       </tr>
*       <tr>
*           <td>
*               PropertyType
*           </td>
*           <td>
*               string
*           </td>
*           <td>
*               The property's datatype (as an XML Schema data type)
*           </td>
*           <td>
*               No
*           </td>
*           <td>
*               Yes
*           </td>
*       </tr>
*       <tr>
*           <td>
*               PropertyAccessType
*           </td>
*           <td>
*               string
*           </td>
*           <td>
*               How the property may be accessed. Values defined by the XML/A spec are:
*               <ul>
*                   <li>Read</li>
*                   <li>Write</li>
*                   <li>ReadWrite</li>
*               </ul>
*           </td>
*           <td>
*               No
*           </td>
*           <td>
*               No
*           </td>
*       </tr>
*       <tr>
*           <td>
*               IsRequired
*           </td>
*           <td>
*               boolean
*           </td>
*           <td>
*               <code>true</code> if the property is required, <code>false</code> if not.
*           </td>
*           <td>
*               No
*           </td>
*           <td>
*               Yes
*           </td>
*       </tr>
*       <tr>
*           <td>
*               Value
*           </td>
*           <td>
*               string
*           </td>
*           <td>
*               The property's current value.
*           </td>
*           <td>
*               No
*           </td>
*           <td>
*               Yes
*           </td>
*       </tr>
*     </tbody>
*   </table>
*
*   @method discoverProperties
*   @param {Object} options An object whose properties convey the options for the XML/A a <code>DISCOVER_DATASOURCES</code> request.
*   @return {Xmla.Rowset} The result of the invoking the XML/A <code>Discover</code> method. For synchronous requests, an instance of a <code><a href="Xmla.Rowset.html#Xmla.Rowset">Xmla.Rowset</a></code> that represents the <code>DISCOVER_DATASOURCES</code> schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: <code><a href="#method_addListener">addListener()</a></code>) and listen for the <code>success</code> (see: <code><a href="#property_EVENT_SUCCESS">EVENT_SUCCESS</a></code>) or <code>discoversuccess</code> (see: <code><a href="#property_EVENT_DISCOVER_SUCCESS">EVENT_DISCOVER_SUCCESS</a></code>) events.
*/
    discoverProperties: function(options){
        var request = _applyProps(options, {
            requestType: Xmla.DISCOVER_PROPERTIES
        }, true);
        return this.discover(request);
    },
/**
*   Invokes the <code><a href="#method_discover">discover()</a></code> method using <code><a href="#property_DISCOVER_SCHEMA_ROWSETS"></a></code> as value for the <code>requestType</code>,
*   and retrieves the <code>DISCOVER_SCHEMA_ROWSETS</code> schema rowset.
*   This rowset lists all possible request types supported by this provider.
*   The rowset has the following columns:
*   <table border="1" class="schema-rowset">
*     <thead>
*       <tr>
*           <th>Column Name</th>
*           <th>Type</th>
*           <th>Description</th>
*           <th>Restriction</th>
*           <th>Nullable</th>
*       </tr>
*     </thead>
*     <tbody>
*       <tr>
*           <td>SchemaName</td>
*           <td>string</td>
*           <td>The requestType. </td>
*           <td>Yes</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>Restrictions</td>
*           <td>array</td>
*           <td>A list of columns that may be used to filter the schema rowset.</td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>Description</td>
*           <td>string</td>
*           <td>A human readable description of the schema rowset that is returned when using this requestType</td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*     </tbody>
*   </table>
*
*   @method discoverSchemaRowsets
*   @param {Object} options An object whose properties convey the options for the XML/A a <code>DISCOVER_SCHEMA_ROWSETS</code> request.
*   @return {Xmla.Rowset} The result of the invoking the XML/A <code>Discover</code> method. For synchronous requests, an instance of a <code><a href="Xmla.Rowset.html#Xmla.Rowset">Xmla.Rowset</a></code> that represents the <code>DISCOVER_DATASOURCES</code> schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: <code><a href="#method_addListener">addListener()</a></code>) and listen for the <code>success</code> (see: <code><a href="#property_EVENT_SUCCESS">EVENT_SUCCESS</a></code>) or <code>discoversuccess</code> (see: <code><a href="#property_EVENT_DISCOVER_SUCCESS">EVENT_DISCOVER_SUCCESS</a></code>) events.
*/
    discoverSchemaRowsets: function(options){
        var request = _applyProps(options, {
            requestType: Xmla.DISCOVER_SCHEMA_ROWSETS
        }, true);
        return this.discover(request);
    },
/**
*   Invokes the <code><a href="#method_discover">discover()</a></code> method using <code><a href="#property_DISCOVER_ENUMERATORS"></a></code> as value for the <code>requestType</code>,
*   and retrieves the <code>DISCOVER_ENUMERATORS</code> schema rowset.
*   This rowset lists the names, data types, and enumeration values of enumerators supported by the XMLA Provider for a specific data source.
*   The rowset has the following columns:
*   <table border="1" class="schema-rowset">
*     <thead>
*       <tr>
*           <th>Column Name</th>
*           <th>Type</th>
*           <th>Description</th>
*           <th>Restriction</th>
*           <th>Nullable</th>
*       </tr>
*     </thead>
*     <tbody>
*       <tr>
*           <td>EnumName</td>
*           <td>string</td>
*           <td>Name of the enumerator. </td>
*           <td>Yes (array)</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>EnumDescription</td>
*           <td>string</td>
*           <td>A human readable description of the enumerator</td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>EnumType</td>
*           <td>string</td>
*           <td>The XML Schema data type of this enumerator</td>
*           <td>No</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>ElementName</td>
*           <td>string</td>
*           <td>The name of the enumerator entry</td>
*           <td>No</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>ElementDescription</td>
*           <td>string</td>
*           <td>A human readable description of this enumerator entry</td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>ElementValue</td>
*           <td>string</td>
*           <td>The value of this enumerator entry</td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*     </tbody>
*   </table>
*
*   @method discoverEnumerators
*   @param {Object} options An object whose properties convey the options for the XML/A a <code>DISCOVER_ENUMERATORS</code> request.
*   @return {Xmla.Rowset} The result of the invoking the XML/A <code>Discover</code> method. For synchronous requests, an instance of a <code><a href="Xmla.Rowset.html#Xmla.Rowset">Xmla.Rowset</a></code> that represents the <code>DISCOVER_ENUMERATORS</code> schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: <code><a href="#method_addListener">addListener()</a></code>) and listen for the <code>success</code> (see: <code><a href="#property_EVENT_SUCCESS">EVENT_SUCCESS</a></code>) or <code>discoversuccess</code> (see: <code><a href="#property_EVENT_DISCOVER_SUCCESS">EVENT_DISCOVER_SUCCESS</a></code>) events.
*/
    discoverEnumerators: function(options){
        var request = _applyProps(options, {
            requestType: Xmla.DISCOVER_ENUMERATORS
        }, true);
        return this.discover(request);
    },
/**
*   Invokes the <code><a href="#method_discover">discover()</a></code> method using <code><a href="#property_DISCOVER_KEYWORDS"></a></code> as value for the <code>requestType</code>,
*   and retrieves the <code>DISCOVER_KEYWORDS</code> schema rowset.
*   This rowset is a list of reserved words for this XML/A provider.
*   The rowset has the following columns:
*   <table border="1" class="schema-rowset">
*     <thead>
*       <tr>
*           <th>Column Name</th>
*           <th>Type</th>
*           <th>Description</th>
*           <th>Restriction</th>
*           <th>Nullable</th>
*       </tr>
*     </thead>
*     <tbody>
*       <tr>
*           <td>Keyword</td>
*           <td>string</td>
*           <td>Name of the enumerator. </td>
*           <td>Yes (array)</td>
*           <td>No</td>
*       </tr>
*     </tbody>
*   </table>
*
*   @method discoverKeywords
*   @param {Object} options An object whose properties convey the options for the XML/A a <code>DISCOVER_KEYWORDS</code> request.
*   @return {Xmla.Rowset} The result of the invoking the XML/A <code>Discover</code> method. For synchronous requests, an instance of a <code><a href="Xmla.Rowset.html#Xmla.Rowset">Xmla.Rowset</a></code> that represents the <code>DISCOVER_ENUMERATORS</code> schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: <code><a href="#method_addListener">addListener()</a></code>) and listen for the <code>success</code> (see: <code><a href="#property_EVENT_SUCCESS">EVENT_SUCCESS</a></code>) or <code>discoversuccess</code> (see: <code><a href="#property_EVENT_DISCOVER_SUCCESS">EVENT_DISCOVER_SUCCESS</a></code>) events.
*/
    discoverKeywords: function(options){
        var request = _applyProps(options, {
            requestType: Xmla.DISCOVER_KEYWORDS
        }, true);
        return this.discover(request);
    },
/**
*   Invokes the <code><a href="#method_discover">discover()</a></code> method using <code><a href="#property_DISCOVER_LITERALS"></a></code> as value for the <code>requestType</code>,
*   and retrieves the <code>DISCOVER_LITERALS</code> schema rowset.
*   This rowset is a list of reserved words for this XML/A provider.
*   The rowset has the following columns:
*   <table border="1" class="schema-rowset">
*     <thead>
*       <tr>
*           <th>Column Name</th>
*           <th>Type</th>
*           <th>Description</th>
*           <th>Restriction</th>
*           <th>Nullable</th>
*       </tr>
*     </thead>
*     <tbody>
*       <tr>
*           <td>LiteralName</td>
*           <td>string</td>
*           <td>Name of the literal. </td>
*           <td>Yes (array)</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>LiteralValue</td>
*           <td>string</td>
*           <td>The actual literal value. </td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>LiteralInvalidChars</td>
*           <td>string</td>
*           <td>Characters that may not appear in the literal </td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>LiteralInvalidStartingChars</td>
*           <td>string</td>
*           <td>Characters that may not appear as first character in the literal </td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>LiteralMaxLength</td>
*           <td>int</td>
*           <td>maximum number of characters for this literal, or -1 in case there is no maximum, or the maximum is unknown</td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*     </tbody>
*   </table>
*
*   @method discoverLiterals
*   @param {Object} options An object whose properties convey the options for the XML/A a <code>DISCOVER_LITERALS</code> request.
*   @return {Xmla.Rowset} The result of the invoking the XML/A <code>Discover</code> method. For synchronous requests, an instance of a <code><a href="Xmla.Rowset.html#Xmla.Rowset">Xmla.Rowset</a></code> that represents the <code>DISCOVER_LITERALS</code> schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: <code><a href="#method_addListener">addListener()</a></code>) and listen for the <code>success</code> (see: <code><a href="#property_EVENT_SUCCESS">EVENT_SUCCESS</a></code>) or <code>discoversuccess</code> (see: <code><a href="#property_EVENT_DISCOVER_SUCCESS">EVENT_DISCOVER_SUCCESS</a></code>) events.
*/
    discoverLiterals: function(options){
        var request = _applyProps(options, {
            requestType: Xmla.DISCOVER_LITERALS
        }, true);
        return this.discover(request);
    },
/**
*   Invokes the <code><a href="#method_discover">discover()</a></code> method using
*   <code><a href="#property_DBSCHEMA_CATALOGS"></a></code> as value for the <code>requestType</code>,
*   and retrieves the <code>DBSCHEMA_CATALOGS</code> schema rowset.
*   The rowset has the following columns:
*   <table border="1" class="schema-rowset">
*     <thead>
*       <tr>
*           <th>Column Name</th>
*           <th>Type</th>
*           <th>Description</th>
*           <th>Restriction</th>
*           <th>Nullable</th>
*       </tr>
*     </thead>
*     <tbody>
*       <tr>
*           <td>CATALOG_NAME</td>
*           <td>string</td>
*           <td>Name of the catalog</td>
*           <td>Yes</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>DESCRIPTION</td>
*           <td>string</td>
*           <td>Human readable description</td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>ROLES</td>
*           <td>string</td>
*           <td>A comma-separatd list of roles available to the current user.</td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>DATE_MODIFIED</td>
*           <td>Date</td>
*           <td>The date this catalog was modified</td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*     </tbody>
*   </table>
*   @method discoverDBCatalogs
*   @param {Object} options An object whose properties convey the options for the XML/A a <code>DBSCHEMA_CATALOGS</code> request.
*   @return {Xmla.Rowset} The result of the invoking the XML/A <code>Discover</code> method. For synchronous requests, an instance of a <code><a href="Xmla.Rowset.html#Xmla.Rowset">Xmla.Rowset</a></code> that represents the <code>DBSCHEMA_CATALOGS</code> schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: <code><a href="#method_addListener">addListener()</a></code>) and listen for the <code>success</code> (see: <code><a href="#property_EVENT_SUCCESS">EVENT_SUCCESS</a></code>) or <code>discoversuccess</code> (see: <code><a href="#property_EVENT_DISCOVER_SUCCESS">EVENT_DISCOVER_SUCCESS</a></code>) events.
*/
    discoverDBCatalogs: function(options){
        var request = _applyProps(options, {
            requestType: Xmla.DBSCHEMA_CATALOGS
        }, true);
        return this.discover(request);
    },
/**
*   Invokes the <code><a href="#method_discover">discover()</a></code> method using
*   <code><a href="#property_DBSCHEMA_COLUMNS"></a></code> as value for the <code>requestType</code>,
*   and retrieves the <code>DBSCHEMA_COLUMNS</code> schema rowset.
*   Provides column information for all columns meeting the provided restriction criteria.
*   The rowset has the following columns:
*   <table border="1" class="schema-rowset">
*     <thead>
*       <tr>
*           <th>Column Name</th>
*           <th>Type</th>
*           <th>Description</th>
*           <th>Restriction</th>
*           <th>Nullable</th>
*       </tr>
*     </thead>
*     <tbody>
*        <tr>
*            <td>TABLE_CATALOG</td>
*            <td>string</td>
*            <td>The name of the Database.</td>
*            <td>Yes</td>
*            <td>No</td>
*        </tr>
*        <tr>
*            <td>TABLE_SCHEMA</td>
*            <td>string</td>
*            <td>Not supported.</td>
*            <td>Yes</td>
*            <td>No</td>
*        </tr>
*        <tr>
*            <td>TABLE_NAME</td>
*            <td>string</td>
*            <td>The name of the cube.</td>
*            <td>Yes</td>
*            <td>No</td>
*        </tr>
*        <tr>
*            <td>COLUMN_NAME</td>
*            <td>string</td>
*            <td>The name of the attribute hierarchy or measure.</td>
*            <td>Yes</td>
*            <td>No</td>
*        </tr>
*        <tr>
*            <td>COLUMN_GUID</td>
*            <td>string</td>
*            <td>Not supported.</td>
*            <td>No</td>
*            <td>No</td>
*        </tr>
*        <tr>
*            <td>COLUMN_PROPID</td>
*            <td>int</td>
*            <td>Not supported.</td>
*            <td>No</td>
*            <td>No</td>
*        </tr>
*        <tr>
*            <td>ORDINAL_POSITION</td>
*            <td>int</td>
*            <td>The position of the column, beginning with 1.</td>
*            <td>No</td>
*            <td>No</td>
*        </tr>
*        <tr>
*            <td>COLUMN_HAS_DEFAULT</td>
*            <td>boolean</td>
*            <td>Not supported.</td>
*            <td>No</td>
*            <td>No</td>
*        </tr>
*        <tr>
*            <td>COLUMN_DEFAULT</td>
*            <td>string</td>
*            <td>Not supported.</td>
*            <td>No</td>
*            <td>No</td>
*        </tr>
*        <tr>
*            <td>COLUMN_FLAGS</td>
*            <td>int</td>
*            <td>A DBCOLUMNFLAGS bitmask indicating column properties. See 'DBCOLUMNFLAGS Enumerated Type' in IColumnsInfo::GetColumnInfo</td>
*            <td>No</td>
*            <td>No</td>
*        </tr>
*        <tr>
*            <td>IS_NULLABLE</td>
*            <td>boolean</td>
*            <td>Always returns false.</td>
*            <td>No</td>
*            <td>No</td>
*        </tr>
*        <tr>
*            <td>DATA_TYPE</td>
*            <td>string</td>
*            <td>The data type of the column. Returns a string for dimension columns and a variant for measures.</td>
*            <td>No</td>
*            <td>No</td>
*        </tr>
*        <tr>
*            <td>TYPE_GUID
*            <td>srring</td>
*            <td>Not supported.</td>
*            <td>No</td>
*            <td>No</td>
*        </tr>
*        <tr>
*            <td>CHARACTER_MAXIMUM_LENGTH</td>
*            <td>int</td>
*            <td>The maximum possible length of a value within the column. This is retrieved from the DataSize property in the DataItem.</td>
*            <td>No</td>
*            <td>No</td>
*        </tr>
*        <tr>
*            <td>CHARACTER_OCTET_LENGTH</td>
*            <td>int</td>
*            <td>The maximum possible length of a value within the column, in bytes, for character or binary columns. A value of zero (0) indicates the column has no maximum length. NULL will be returned for columns that do not return binary or character data types.</td>
*            <td>No</td>
*            <td>No</td>
*        </tr>
*        <tr>
*            <td>NUMERIC_PRECISION</td>
*            <td>int</td>
*            <td>The maximum precision of the column for numeric data types other than DBTYPE_VARNUMERIC.</td>
*            <td>No</td>
*            <td>No</td>
*        </tr>
*        <tr>
*            <td>NUMERIC_SCALE</td>
*            <td>int</td>
*            <td>The number of digits to the right of the decimal point for DBTYPE_DECIMAL, DBTYPE_NUMERIC, DBTYPE_VARNUMERIC. Otherwise, this is NULL.</td>
*            <td>No</td>
*            <td>No</td>
*        </tr>
*        <tr>
*            <td>DATETIME_PRECISION</td>
*            <td>int</td>
*            <td>Not supported.</td>
*            <td>No</td>
*            <td>No</td>
*        </tr>
*        <tr>
*            <td>CHARACTER_SET_CATALOG</td>
*            <td>string</td>
*            <td>Not supported.</td>
*            <td>No</td>
*            <td>No</td>
*        </tr>
*        <tr>
*            <td>CHARACTER_SET_SCHEMA</td>
*            <td>string</td>
*            <td>Not supported.</td>
*            <td>No</td>
*            <td>No</td>
*        </tr>
*        <tr>
*            <td>CHARACTER_SET_NAME</td>
*            <td>string</td>
*            <td>Not supported.</td>
*            <td>No</td>
*            <td>No</td>
*        </tr>
*        <tr>
*            <td>COLLATION_CATALOG</td>
*            <td>string</td>
*            <td>Not supported.</td>
*            <td>No</td>
*            <td>No</td>
*        </tr>
*        <tr>
*            <td>COLLATION_SCHEMA</td>
*            <td>string</td>
*            <td>Not supported.</td>
*            <td>No</td>
*            <td>No</td>
*        </tr>
*        <tr>
*            <td>COLLATION_NAME</td>
*            <td>string</td>
*            <td>Not supported.</td>
*            <td>No</td>
*            <td>No</td>
*        </tr>
*        <tr>
*            <td>DOMAIN_CATALOG</td>
*            <td>string</td>
*            <td>Not supported.</td>
*            <td>No</td>
*            <td>No</td>
*        </tr>
*        <tr>
*            <td>DOMAIN_SCHEMA</td>
*            <td>string</td>
*            <td>Not supported.</td>
*            <td>No</td>
*            <td>No</td>
*        </tr>
*        <tr>
*            <td>DOMAIN_NAME</td>
*            <td>string</td>
*            <td>Not supported.</td>
*            <td>No</td>
*            <td>No</td>
*        </tr>
*        <tr>
*            <td>DESCRIPTION</td>
*            <td>string</td>
*            <td>Not supported.</td>
*            <td>No</td>
*            <td>No</td>
*        </tr>
*        <tr>
*            <td>COLUMN_OLAP_TYPE</td>
*            <td>string</td>
*            <td>The OLAP type of the object. MEASURE indicates the object is a measure. ATTRIBUTE indicates the object is a dimension attribute.</td>
*            <td>Yes</td>
*            <td>No</td>
*        </tr>
*     </tbody>
*   </table>
*    The rowset is sorted on TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME.
*   @method discoverDBColumns
*   @param {Object} options An object whose properties convey the options for the XML/A a <code>DBSCHEMA_COLUMNS</code> request.
*   @return {Xmla.Rowset} The result of the invoking the XML/A <code>Discover</code> method. For synchronous requests, an instance of a <code><a href="Xmla.Rowset.html#Xmla.Rowset">Xmla.Rowset</a></code> that represents the <code>DBSCHEMA_COLUMNS</code> schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: <code><a href="#method_addListener">addListener()</a></code>) and listen for the <code>success</code> (see: <code><a href="#property_EVENT_SUCCESS">EVENT_SUCCESS</a></code>) or <code>discoversuccess</code> (see: <code><a href="#property_EVENT_DISCOVER_SUCCESS">EVENT_DISCOVER_SUCCESS</a></code>) events.
*/
    discoverDBColumns: function(options){
        var request = _applyProps(options, {
            requestType: Xmla.DBSCHEMA_COLUMNS
        }, true);
        return this.discover(request);
    },
/**
*   Invokes the <code><a href="#method_discover">discover()</a></code> method using
*   <code><a href="#property_DBSCHEMA_PROVIDER_TYPES"></a></code> as value for the <code>requestType</code>,
*   and retrieves the <code>DBSCHEMA_PROVIDER_TYPES</code> schema rowset.
*   ...todo...
*   The rowset has the following columns:
*   <table border="1" class="schema-rowset">
*     <thead>
*       <tr>
*           <th>Column Name</th>
*           <th>Type</th>
*           <th>Description</th>
*           <th>Restriction</th>
*           <th>Nullable</th>
*       </tr>
*     </thead>
*     <tbody>
*        <tr>
*            <td>TYPE_NAME</td>
*            <td>string</td>
*            <td>The provider-specific data type name.</td>
*            <td>false</td>
*            <td>true</td>
*        </tr>
*        <tr>
*            <td>DATA_TYPE</td>
*            <td>int</td>
*            <td>The indicator of the data type.</td>
*            <td>false</td>
*            <td>true</td>
*        </tr>
*        <tr>
*            <td>COLUMN_SIZE</td>
*            <td>int</td>
*            <td> The length of a non-numeric column or parameter that refers to either the maximum or the length defined for this type by the provider. For character data, this is the maximum or defined length in characters. For DateTime data types, this is the length of the string representation (assuming the maximum allowed precision of the fractional seconds component). If the data type is numeric, this is the upper bound on the maximum precision of the data type. </td>
*            <td>false</td>
*            <td>true</td>
*        </tr>
*        <tr>
*            <td>LITERAL_PREFIX</td>
*            <td>string</td>
*            <td>The character or characters used to prefix a literal of this type in a text command.</td>
*            <td>false</td>
*            <td>true</td>
*        </tr>
*        <tr>
*            <td>LITERAL_SUFFIX</td>
*            <td>string</td>
*            <td>The character or characters used to suffix a literal of this type in a text command.</td>
*            <td>false</td>
*            <td>true</td>
*        </tr>
*        <tr>
*            <td>CREATE_PARAMS
*            <td>string</td>
*            <td>The creation parameters specified by the consumer when creating a column of this data type. For example, the SQL data type, DECIMAL, needs a precision and a scale. In this case, the creation parameters might be the string "precision,scale". In a text command to create a DECIMAL column with a precision of 10 and a scale of 2, the value of the TYPE_NAME column might be DECIMAL() and the complete type specification would be DECIMAL(10,2). The creation parameters appear as a comma-separated list of values, in the order they are to be supplied and with no surrounding parentheses. If a creation parameter is length, maximum length, precision, scale, seed, or increment, use "length", "max length", "precision", "scale", "seed", and "increment", respectively. If the creation parameter is some other value, the provider determines what text is to be used to describe the creation parameter. If the data type requires creation parameters, "()" usually appears in the type name. This indicates the position at which to insert the creation parameters. If the type name does not include "()", the creation parameters are enclosed in parentheses and appended to the data type name. </td>
*            <td>false</td>
*            <td>true</td>
*        </tr>
*        <tr>
*            <td>IS_NULLABLE</td>
*            <td>boolean</td>
*            <td>A Boolean that indicates whether the data type is nullable. VARIANT_TRUE indicates that the data type is nullable. VARIANT_FALSE indicates that the data type is not nullable. NULL indicates that it is not known whether the data type is nullable.</td>
*            <td>false</td>
*            <td>true</td>
*        </tr>
*        <tr>
*            <td>CASE_SENSITIVE</td>
*            <td>boolean</td>
*            <td>A Boolean that indicates whether the data type is a characters type and case-sensitive. VARIANT_TRUE indicates that the data type is a character type and is case-sensitive. VARIANT_FALSE indicates that the data type is not a character type or is not case-sensitive.</td>
*            <td>false</td>
*            <td>true</td>
*        </tr>
*        <tr>
*            <td>SEARCHABLE</td>
*            <td>int</td>
*            <td>An integer indicating how the data type can be used in searches if the provider supports ICommandText; otherwise, NULL. This column can have the following values: DB_UNSEARCHABLE indicates that the data type cannot be used in a WHERE clause. DB_LIKE_ONLY indicates that the data type can be used in a WHERE clause only with the LIKE predicate.DB_ALL_EXCEPT_LIKE indicates that the data type can be used in a WHERE clause with all comparison operators except LIKE. DB_SEARCHABLE indicates that the data type can be used in a WHERE clause with any comparison operator.</td>
*            <td>false</td>
*            <td>true</td>
*        </tr>
*        <tr>
*            <td>UNSIGNED_ATTRIBUTE</td>
*            <td>boolean</td>
*            <td>A Boolean that indicates whether the data type is unsigned.   VARIANT_TRUE indicates that the data type is unsigned. VARIANT_FALSE indicates that the data type is signed.NULL indicates that this is not applicable to the data type.</td>
*            <td>false</td>
*            <td>true</td>
*        </tr>
*        <tr>
*            <td>FIXED_PREC_SCALE</td>
*            <td>boolean</td>
*            <td>A Boolean that indicates whether the data type has a fixed precision and scale.  VARIANT_TRUE indicates that the data type has a fixed precision and scale. VARIANT_FALSE indicates that the data type does not have a fixed precision and scale.</td>
*            <td>false</td>
*            <td>true</td>
*        </tr>
*        <tr>
*            <td>AUTO_UNIQUE_VALUE</td>
*            <td>boolean</td>
*            <td>A Boolean that indicates whether the data type is autoincrementing. VARIANT_TRUE indicates that values of this type can be autoincrementing. VARIANT_FALSE indicates that values of this type cannot be autoincrementing. If this value is VARIANT_TRUE, whether or not a column of this type is always autoincrementing depends on the provider's DBPROP_COL_AUTOINCREMENT column property. If the DBPROP_COL_AUTOINCREMENT property is read/write, whether or not a column of this type is autoincrementing depends on the setting of the DBPROP_COL_AUTOINCREMENT property. If DBPROP_COL_AUTOINCREMENT is a read-only property, either all or none of the columns of this type are autoincrementing. </td>
*            <td>false</td>
*            <td>true</td>
*        </tr>
*        <tr>
*            <td>LOCAL_TYPE_NAME</td>
*            <td>string</td>
*            <td>The localized version of TYPE_NAME. NULL is returned if a localized name is not supported by the data provider.</td>
*            <td>false</td>
*            <td>true</td>
*        </tr>
*        <tr>
*            <td>MINIMUM_SCALE</td>
*            <td>int</td>
*            <td>If the type indicator is DBTYPE_VARNUMERIC, DBTYPE_DECIMAL, or DBTYPE_NUMERIC, the minimum number of digits allowed to the right of the decimal point. Otherwise, NULL.</td>
*            <td>false</td>
*            <td>true</td>
*        </tr>
*        <tr>
*            <td>MAXIMUM_SCALE</td>
*            <td>int</td>
*            <td>The maximum number of digits allowed to the right of the decimal point if the type indicator is DBTYPE_VARNUMERIC, DBTYPE_DECIMAL, or DBTYPE_NUMERIC; otherwise, NULL.</td>
*            <td>false</td>
*            <td>true</td>
*        </tr>
*        <tr>
*            <td>GUID</td>
*            <td>string</td>
*            <td>(Intended for future use) The GUID of the type, if the type is described in a type library. Otherwise, NULL.</td>
*            <td>false</td>
*            <td>true</td>
*        </tr>
*        <tr>
*            <td>TYPELIB
*            <td>string</td>
*            <td>(Intended for future use) The type library containing the description of the type, if the type is described in a type library. Otherwise, NULL.</td>
*            <td>false</td>
*            <td>true</td>
*        </tr>
*        <tr>
*            <td>VERSION</td>
*            <td>string</td>
*            <td>(Intended for future use) The version of the type definition. Providers might want to version type definitions. Different providers might use different versioning schemes, such as a timestamp or number (integer or float). NULL if not supported.</td>
*            <td>false</td>
*            <td>true</td>
*        </tr>
*        <tr>
*            <td>IS_LONG</td>
*            <td>boolean</td>
*            <td>A Boolean that indicates whether the data type is a binary large object (BLOB) and has very long data. VARIANT_TRUE indicates that the data type is a BLOB that contains very long data; the definition of very long data is provider-specific. VARIANT_FALSE indicates that the data type is a BLOB that does not contain very long data or is not a BLOB. This value determines the setting of the DBCOLUMNFLAGS_ISLONG flag returned by GetColumnInfo in IColumnsInfo and GetParameterInfo in ICommandWithParameters.</td>
*            <td>false</td>
*            <td>true</td>
*        </tr>
*        <tr>
*            <td>BEST_MATCH</td>
*            <td>boolean</td>
*            <td>A Boolean that indicates whether the data type is a best match. VARIANT_TRUE indicates that the data type is the best match between all data types in the data store and the OLE DB data type indicated by the value in the DATA_TYPE column. VARIANT_FALSE indicates that the data type is not the best match. For each set of rows in which the value of the DATA_TYPE column is the same, the BEST_MATCH column is set to VARIANT_TRUE in only one row.</td>
*            <td>false</td>
*            <td>true</td>
*        </tr>
*        <tr>
*            <td>IS_FIXEDLENGTH</td>
*            <td>boolean</td>
*            <td>A Boolean that indicates whether the column is fixed in length. VARIANT_TRUE indicates that columns of this type created by the data definition language (DDL) will be of fixed length. VARIANT_FALSE indicates that columns of this type created by the DDL will be of variable length. If the field is NULL, it is not known whether the provider will map this field with a fixed-length or variable-length column.
*            <td>false</td>
*            <td>true</td>
*        </tr>
*     </tbody>
*    </table>
*   @method discoverDBProviderTypes
*   @param {Object} options An object whose properties convey the options for the XML/A a <code>DBSCHEMA_PROVIDER_TYPES</code> request.
*   @return {Xmla.Rowset} The result of the invoking the XML/A <code>Discover</code> method. For synchronous requests, an instance of a <code><a href="Xmla.Rowset.html#Xmla.Rowset">Xmla.Rowset</a></code> that represents the <code>DBSCHEMA_PROVIDER_TYPES</code> schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: <code><a href="#method_addListener">addListener()</a></code>) and listen for the <code>success</code> (see: <code><a href="#property_EVENT_SUCCESS">EVENT_SUCCESS</a></code>) or <code>discoversuccess</code> (see: <code><a href="#property_EVENT_DISCOVER_SUCCESS">EVENT_DISCOVER_SUCCESS</a></code>) events.
*/
    discoverDBProviderTypes: function(options){
        var request = _applyProps(options, {
            requestType: Xmla.DBSCHEMA_PROVIDER_TYPES
        }, true);
        return this.discover(request);
    },
/**
*   Invokes the <code><a href="#method_discover">discover()</a></code> method using
*   <code><a href="#property_DBSCHEMA_SCHEMATA"></a></code> as value for the <code>requestType</code>,
*   and retrieves the <code>DBSCHEMA_SCHEMATA</code> schema rowset.
*   ...todo...
*   The rowset has the following columns:
*   <table border="1" class="schema-rowset">
*     <thead>
*       <tr>
*           <th>Column Name</th>
*           <th>Type</th>
*           <th>Description</th>
*           <th>Restriction</th>
*           <th>Nullable</th>
*       </tr>
*     </thead>
*     <tbody>
*     </tbody>
*   </table>
*   @method discoverDBSchemata
*   @param {Object} options An object whose properties convey the options for the XML/A a <code>DBSCHEMA_SCHEMATA</code> request.
*   @return {Xmla.Rowset} The result of the invoking the XML/A <code>Discover</code> method. For synchronous requests, an instance of a <code><a href="Xmla.Rowset.html#Xmla.Rowset">Xmla.Rowset</a></code> that represents the <code>DBSCHEMA_SCHEMATA</code> schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: <code><a href="#method_addListener">addListener()</a></code>) and listen for the <code>success</code> (see: <code><a href="#property_EVENT_SUCCESS">EVENT_SUCCESS</a></code>) or <code>discoversuccess</code> (see: <code><a href="#property_EVENT_DISCOVER_SUCCESS">EVENT_DISCOVER_SUCCESS</a></code>) events.
*/
    discoverDBSchemata: function(options){
        var request = _applyProps(options, {
            requestType: Xmla.DBSCHEMA_SCHEMATA
        }, true);
        return this.discover(request);
    },
/**
*   Invokes the <code><a href="#method_discover">discover()</a></code> method using
*   <code><a href="#property_DBSCHEMA_TABLES"></a></code> as value for the <code>requestType</code>,
*   and retrieves the <code>DBSCHEMA_TABLES</code> schema rowset.
*   ...todo...
*   The rowset has the following columns:
*   <table border="1" class="schema-rowset">
*     <thead>
*       <tr>
*           <th>Column Name</th>
*           <th>Type</th>
*           <th>Description</th>
*           <th>Restriction</th>
*           <th>Nullable</th>
*       </tr>
*     </thead>
*     <tbody>
*     </tbody>
*   </table>
*   @method discoverDBTables
*   @param {Object} options An object whose properties convey the options for the XML/A a <code>DBSCHEMA_TABLES</code> request.
*   @return {Xmla.Rowset} The result of the invoking the XML/A <code>Discover</code> method. For synchronous requests, an instance of a <code><a href="Xmla.Rowset.html#Xmla.Rowset">Xmla.Rowset</a></code> that represents the <code>DBSCHEMA_TABLES</code> schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: <code><a href="#method_addListener">addListener()</a></code>) and listen for the <code>success</code> (see: <code><a href="#property_EVENT_SUCCESS">EVENT_SUCCESS</a></code>) or <code>discoversuccess</code> (see: <code><a href="#property_EVENT_DISCOVER_SUCCESS">EVENT_DISCOVER_SUCCESS</a></code>) events.
*/
    discoverDBTables: function(options){
        var request = _applyProps(options, {
            requestType: Xmla.DBSCHEMA_TABLES
        }, true);
        return this.discover(request);
    },
/**
*   Invokes the <code><a href="#method_discover">discover()</a></code> method using
*   <code><a href="#property_DBSCHEMA_TABLES_INFO"></a></code> as value for the <code>requestType</code>,
*   and retrieves the <code>DBSCHEMA_TABLES_INFO</code> schema rowset.
*   ...todo...
*   The rowset has the following columns:
*   <table border="1" class="schema-rowset">
*     <thead>
*       <tr>
*           <th>Column Name</th>
*           <th>Type</th>
*           <th>Description</th>
*           <th>Restriction</th>
*           <th>Nullable</th>
*       </tr>
*     </thead>
*     <tbody>
*     </tbody>
*   </table>
*   @method discoverDBTablesInfo
*   @param {Object} options An object whose properties convey the options for the XML/A a <code>DBSCHEMA_TABLES_INFO</code> request.
*   @return {Xmla.Rowset} The result of the invoking the XML/A <code>Discover</code> method. For synchronous requests, an instance of a <code><a href="Xmla.Rowset.html#Xmla.Rowset">Xmla.Rowset</a></code> that represents the <code>DBSCHEMA_TABLES_INFO</code> schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: <code><a href="#method_addListener">addListener()</a></code>) and listen for the <code>success</code> (see: <code><a href="#property_EVENT_SUCCESS">EVENT_SUCCESS</a></code>) or <code>discoversuccess</code> (see: <code><a href="#property_EVENT_DISCOVER_SUCCESS">EVENT_DISCOVER_SUCCESS</a></code>) events.
*/
    discoverDBTablesInfo: function(options){
        var request = _applyProps(
            options,
            {
                requestType: Xmla.DBSCHEMA_TABLES_INFO
            },
            true
        );
        return this.discover(request);
    },
/**
*   Invokes the <code><a href="#method_discover">discover()</a></code> method using
*   <code><a href="#property_MDSCHEMA_ACTIONS"></a></code> as value for the <code>requestType</code>,
*   and retrieves the <code>MDSCHEMA_ACTIONS</code> schema rowset.
*   ...todo...
*   The rowset has the following columns:
*   <table border="1" class="schema-rowset">
*     <thead>
*       <tr>
*           <th>Column Name</th>
*           <th>Type</th>
*           <th>Description</th>
*           <th>Restriction</th>
*           <th>Nullable</th>
*       </tr>
*     </thead>
*     <tbody>
*     </tbody>
*   </table>
*   @method discoverMDActions
*   @param {Object} options An object whose properties convey the options for the XML/A a <code>MDSCHEMA_ACTIONS</code> request.
*   @return {Xmla.Rowset} The result of the invoking the XML/A <code>Discover</code> method. For synchronous requests, an instance of a <code><a href="Xmla.Rowset.html#Xmla.Rowset">Xmla.Rowset</a></code> that represents the <code>MDSCHEMA_ACTIONS</code> schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: <code><a href="#method_addListener">addListener()</a></code>) and listen for the <code>success</code> (see: <code><a href="#property_EVENT_SUCCESS">EVENT_SUCCESS</a></code>) or <code>discoversuccess</code> (see: <code><a href="#property_EVENT_DISCOVER_SUCCESS">EVENT_DISCOVER_SUCCESS</a></code>) events.
*/
    discoverMDActions: function(options){
        var request = _applyProps(options, {
            requestType: Xmla.MDSCHEMA_ACTIONS
        }, true);
        return this.discover(request);
    },
/**
*   Invokes the <code><a href="#method_discover">discover()</a></code> method using
*   <code><a href="#property_MDSCHEMA_CUBES"></a></code> as value for the <code>requestType</code>,
*   and retrieves the <code>MDSCHEMA_CUBES</code> schema rowset.
*   ...todo...
*   The rowset has the following columns:
*   <table border="1" class="schema-rowset">
*     <thead>
*       <tr>
*           <th>Column Name</th>
*           <th>Type</th>
*           <th>Description</th>
*           <th>Restriction</th>
*           <th>Nullable</th>
*       </tr>
*     </thead>
*     <tbody>
*       <tr>
*           <td>CATALOG_NAME</td>
*           <td>string</td>
*           <td>Name of the catalog</td>
*           <td>Yes</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>SCHEMA_NAME</td>
*           <td>string</td>
*           <td>Not supported</td>
*           <td>Yes</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>CUBE_NAME</td>
*           <td>string</td>
*           <td>Name of the cube.</td>
*           <td>Yes</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>CUBE_TYPE</td>
*           <td>string</td>
*           <td>Type of the cube.</td>
*           <td>No</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>CUBE_GUID</td>
*           <td>string</td>
*           <td>Not supported</td>
*           <td>No</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>CREATED_ON</td>
*           <td>Date</td>
*           <td>Not supported</td>
*           <td>No</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>LAST_SCHEMA_UPDATE</td>
*           <td>Date</td>
*           <td>The time that the cube was last processed.</td>
*           <td>No</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>SCHEMA_UPDATED_BY</td>
*           <td>string</td>
*           <td></td>
*           <td>No</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>LAST_DATA_UPDATE</td>
*           <td>Date</td>
*           <td>The time that the cube was last processed.</td>
*           <td>No</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>DATA_UPDATED_BY</td>
*           <td>string</td>
*           <td></td>
*           <td>No</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>DESCRIPTION</td>
*           <td>string</td>
*           <td>A Human-readable description of the cube.</td>
*           <td>No</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>IS_DRILLTHROUGH_ENABLED</td>
*           <td>boolean</td>
*           <td></td>
*           <td>No</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>IS_LINKABLE</td>
*           <td>boolean</td>
*           <td></td>
*           <td>No</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>IS_WRITE_ENABLED</td>
*           <td>boolean</td>
*           <td></td>
*           <td>No</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>IS_SQL_ENABLED</td>
*           <td>boolean</td>
*           <td></td>
*           <td>No</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>CUBE_CAPTION</td>
*           <td>string</td>
*           <td>Caption for this cube.</td>
*           <td>No</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>BASE_CUBE_NAME</td>
*           <td>string</td>
*           <td>Name of the source cube (if this cube is a perspective cube).</td>
*           <td>Yes</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>ANNOTATIONS</td>
*           <td>string</td>
*           <td>Notes in xml format</td>
*           <td>No</td>
*           <td>No</td>
*       </tr>
*     </tbody>
*   </table>
*   @method discoverMDCubes
*   @param {Object} options An object whose properties convey the options for the XML/A a <code>MDSCHEMA_CUBES</code> request.
*   @return {Xmla.Rowset} The result of the invoking the XML/A <code>Discover</code> method. For synchronous requests, an instance of a <code><a href="Xmla.Rowset.html#Xmla.Rowset">Xmla.Rowset</a></code> that represents the <code>MDSCHEMA_CUBES</code> schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: <code><a href="#method_addListener">addListener()</a></code>) and listen for the <code>success</code> (see: <code><a href="#property_EVENT_SUCCESS">EVENT_SUCCESS</a></code>) or <code>discoversuccess</code> (see: <code><a href="#property_EVENT_DISCOVER_SUCCESS">EVENT_DISCOVER_SUCCESS</a></code>) events.
*/
    discoverMDCubes: function(options){
        var request = _applyProps(options, {
            requestType: Xmla.MDSCHEMA_CUBES
        }, true);
        return this.discover(request);
    },
/**
*   Invokes the <code><a href="#method_discover">discover()</a></code> method using
*   <code><a href="#property_MDSCHEMA_DIMENSIONS"></a></code> as value for the <code>requestType</code>,
*   and retrieves the <code>MDSCHEMA_DIMENSIONS</code> schema rowset.
*   ...todo...
*   The rowset has the following columns:
*   <table border="1" class="schema-rowset">
*     <thead>
*       <tr>
*           <th>Column Name</th>
*           <th>Type</th>
*           <th>Description</th>
*           <th>Restriction</th>
*           <th>Nullable</th>
*       </tr>
*     </thead>
*     <tbody>
*       <tr>
*           <td>CATALOG_NAME</td>
*           <td>string</td>
*           <td>Name of the catalog</td>
*           <td>Yes</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>SCHEMA_NAME</td>
*           <td>string</td>
*           <td>Not supported</td>
*           <td>Yes</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>CUBE_NAME</td>
*           <td>string</td>
*           <td>Name of the cube.</td>
*           <td>Yes</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>DIMENSION_NAME</td>
*           <td>string</td>
*           <td>Name of the dimension.</td>
*           <td>Yes</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>DIMENSION_UNIQUE_NAME</td>
*           <td>string</td>
*           <td>Unique name for this dimension.</td>
*           <td>Yes</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>DIMENSION_GUID</td>
*           <td>string</td>
*           <td></td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>DIMENSION_CAPTION</td>
*           <td>string</td>
*           <td></td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>DIMENSION_ORDINAL</td>
*           <td>int</td>
*           <td></td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>DIMENSION_TYPE</td>
*           <td>string</td>
*           <td>
*                <ul>
*                    <li>MD_DIMTYPE_UNKNOWN (0)</li>
*                    <li>MD_DIMTYPE_TIME (1)</li>
*                    <li>MD_DIMTYPE_MEASURE (2)</li>
*                    <li>MD_DIMTYPE_OTHER (3)</li>
*                    <li>MD_DIMTYPE_QUANTITATIVE (5)</li>
*                    <li>MD_DIMTYPE_ACCOUNTS (6)</li>
*                    <li>MD_DIMTYPE_CUSTOMERS (7)</li>
*                    <li>MD_DIMTYPE_PRODUCTS (8)</li>
*                    <li>MD_DIMTYPE_SCENARIO (9)</li>
*                    <li>MD_DIMTYPE_UTILIY (10)</li>
*                    <li>MD_DIMTYPE_CURRENCY (11)</li>
*                    <li>MD_DIMTYPE_RATES (12)</li>
*                    <li>MD_DIMTYPE_CHANNEL (13)</li>
*                    <li>MD_DIMTYPE_PROMOTION (14)</li>
*                    <li>MD_DIMTYPE_ORGANIZATION (15)</li>
*                    <li>MD_DIMTYPE_BILL_OF_MATERIALS (16)</li>
*                    <li>MD_DIMTYPE_GEOGRAPHY (17)</li>
*                </ul>
*            </td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>DIMENSION_CARDINALITY</td>
*           <td>int</td>
*           <td></td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>DEFAULT_HIERARCHY</td>
*           <td>string</td>
*           <td></td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>DESCRIPTION</td>
*           <td>string</td>
*           <td>A Human-readable description of the dimension.</td>
*           <td>No</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>IS_VIRTUAL</td>
*           <td>boolean</td>
*           <td></td>
*           <td>No</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>IS_READWRITE</td>
*           <td>boolean</td>
*           <td></td>
*           <td>No</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>DIMENSION_UNIQUE_SETTINGS</td>
*           <td></td>
*           <td></td>
*           <td>No</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>DIMENSION_MASTER_UNIQUE_NAME</td>
*           <td></td>
*           <td></td>
*           <td>No</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>DIMENSION_IS_VISIBLE</td>
*           <td>boolean</td>
*           <td></td>
*           <td>No</td>
*           <td>No</td>
*       </tr>
*     </tbody>
*   </table>
*   @method discoverMDDimensions
*   @param {Object} options An object whose properties convey the options for the XML/A a <code>MDSCHEMA_DIMENSIONS</code> request.
*   @return {Xmla.Rowset} The result of the invoking the XML/A <code>Discover</code> method. For synchronous requests, an instance of a <code><a href="Xmla.Rowset.html#Xmla.Rowset">Xmla.Rowset</a></code> that represents the <code>MDSCHEMA_DIMENSIONS</code> schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: <code><a href="#method_addListener">addListener()</a></code>) and listen for the <code>success</code> (see: <code><a href="#property_EVENT_SUCCESS">EVENT_SUCCESS</a></code>) or <code>discoversuccess</code> (see: <code><a href="#property_EVENT_DISCOVER_SUCCESS">EVENT_DISCOVER_SUCCESS</a></code>) events.
*/
    discoverMDDimensions: function(options){
        var request = _applyProps(options, {
            requestType: Xmla.MDSCHEMA_DIMENSIONS
        }, true);
        return this.discover(request);
    },
/**
*   Invokes the <code><a href="#method_discover">discover()</a></code> method using
*   <code><a href="#property_MDSCHEMA_FUNCTIONS"></a></code> as value for the <code>requestType</code>,
*   and retrieves the <code>MDSCHEMA_FUNCTIONS</code> schema rowset.
*   ...todo...
*   The rowset has the following columns:
*   <table border="1" class="schema-rowset">
*     <thead>
*       <tr>
*           <th>Column Name</th>
*           <th>Type</th>
*           <th>Description</th>
*           <th>Restriction</th>
*           <th>Nullable</th>
*       </tr>
*     </thead>
*     <tbody>
*       <tr>
*         <td>FUNCTION_NAME</td>
*         <td>DBTYPE_WSTR</td>
*         <td>The name of the function.</td>
*         <td>Yes</td>
*         <td>Yes</td>
*       </tr>
*       <tr>
*         <td>DESCRIPTION</td>
*         <td>DBTYPE_WSTR</td>
*         <td>A description of the function.</td>
*         <td>No</td>
*         <td>No</td>
*       </tr>
*       <tr>
*         <td>PARAMETER_LIST</td>
*         <td>DBTYPE_WSTR</td>
*         <td>A comma delimited list of parameters formatted as in Microsoft Visual Basic. For example, a parameter might be Name as String.</td>
*         <td>No</td>
*         <td>No</td>
*       </tr>
*       <tr>
*         <td>RETURN_TYPE</td>
*         <td>DBTYPE_I4</td>
*         <td>The VARTYPE of the return data type of the function.</td>
*         <td>No</td>
*         <td>No</td>
*       </tr>
*       <tr>
*         <td>ORIGIN</td>
*         <td>DBTYPE_I4</td>
*         <td>The origin of the function:
*           <ol>
*             <li>for MDX functions.</li>
*             <li>for user-defined functions.</li>
*           </ol>
*         </td>
*         <td>Yes</td>
*         <td>Yes</td>
*       </tr>
*       <tr>
*         <td>INTERFACE_NAME</td>
*         <td>DBTYPE_WSTR</td>
*         <td>The name of the interface for user-defined functions. The group name for Multidimensional Expressions (MDX) functions.</td>
*         <td>Yes</td>
*         <td>Yes</td>
*       </tr>
*       <tr>
*         <td>LIBRARY_NAME</td>
*         <td>DBTYPE_WSTR</td>
*         <td>The name of the type library for user-defined functions. NULL for MDX functions.</td>
*         <td>Yes</td>
*         <td>Yes</td>
*       </tr>
*       <tr>
*         <td>DLL_NAME</td>
*         <td>DBTYPE_WSTR</td>
*         <td>(Optional) The name of the assembly that implements the user-defined function. Returns VT_NULL for MDX functions.</td>
*         <td>No</td>
*         <td>No</td>
*       </tr>
*       <tr>
*         <td>HELP_FILE</td>
*         <td>DBTYPE_WSTR</td>
*         <td>(Optional) The name of the file that contains the help documentation for the user-defined function.</td>
*         <td>Returns VT_NULL for MDX functions.</td>
*         <td>No</td>
*         <td>No</td>
*       </tr>
*       <tr>
*         <td>HELP_CONTEXT</td>
*         <td>DBTYPE_I4</td>
*         <td>(Optional) Returns the Help context ID for this function.</td>
*         <td>No</td>
*         <td>No</td>
*       </tr>
*       <tr>
*         <td>OBJECT</td>
*         <td>DBTYPE_WSTR</td>
*         <td>
*           (Optional) The generic name of the object class to which a property applies. For example, the rowset corresponding to the <level_name>.Members function returns "Level".
*            Returns VT_NULL for user-defined functions, or non-property MDX functions.
*         </td>
*         <td>No</td>
*         <td>No</td>
*       </tr>
*       <tr>
*         <td>CAPTION</td>
*         <td>DBTYPE_WSTR</td>
*         <td>The display caption for the function.</td>
*         <td>No</td>
*         <td>No</td>
*       </tr>
*     </tbody>
*   </table>
*   @method discoverMDFunctions
*   @param {Object} options An object whose properties convey the options for the XML/A a <code>MDSCHEMA_FUNCTIONS</code> request.
*   @return {Xmla.Rowset} The result of the invoking the XML/A <code>Discover</code> method. For synchronous requests, an instance of a <code><a href="Xmla.Rowset.html#Xmla.Rowset">Xmla.Rowset</a></code> that represents the <code>MDSCHEMA_FUNCTIONS</code> schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: <code><a href="#method_addListener">addListener()</a></code>) and listen for the <code>success</code> (see: <code><a href="#property_EVENT_SUCCESS">EVENT_SUCCESS</a></code>) or <code>discoversuccess</code> (see: <code><a href="#property_EVENT_DISCOVER_SUCCESS">EVENT_DISCOVER_SUCCESS</a></code>) events.
*/
    discoverMDFunctions: function(options){
        var request = _applyProps(options, {
            requestType: Xmla.MDSCHEMA_FUNCTIONS
        }, true);
        return this.discover(request);
    },
/**
*   Invokes the <code><a href="#method_discover">discover()</a></code> method using
*   <code><a href="#property_MDSCHEMA_HIERARCHIES"></a></code> as value for the <code>requestType</code>,
*   and retrieves the <code>MDSCHEMA_HIERARCHIES</code> schema rowset.
*   ...todo...
*   The rowset has the following columns:
*   <table border="1" class="schema-rowset">
*     <thead>
*       <tr>
*           <th>Column Name</th>
*           <th>Type</th>
*           <th>Description</th>
*           <th>Restriction</th>
*           <th>Nullable</th>
*       </tr>
*     </thead>
*     <tbody>
*       <tr>
*           <td>CATALOG_NAME</td>
*           <td>string</td>
*           <td>Name of the catalog</td>
*           <td>Yes</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>SCHEMA_NAME</td>
*           <td>string</td>
*           <td>Not supported</td>
*           <td>Yes</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>CUBE_NAME</td>
*           <td>string</td>
*           <td>Name of the cube.</td>
*           <td>Yes</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>DIMENSION_UNIQUE_NAME</td>
*           <td>string</td>
*           <td>Unique name for this dimension.</td>
*           <td>Yes</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>HIERARCHY_NAME</td>
*           <td>string</td>
*           <td>Name of the hierarchy.</td>
*           <td>Yes</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>HIERARCHY_UNIQUE_NAME</td>
*           <td>string</td>
*           <td>Unique name for this hierarchy.</td>
*           <td>Yes</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>HIERARCHY_GUID</td>
*           <td>string</td>
*           <td></td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>HIERARCHY_CAPTION</td>
*           <td>string</td>
*           <td></td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>DIMENSION_TYPE</td>
*           <td>string</td>
*           <td></td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>HIERARCHY_CARDINALITY</td>
*           <td>int</td>
*           <td></td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>DEFAULT_MEMBER</td>
*           <td>string</td>
*           <td></td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>ALL_MEMBER</td>
*           <td>string</td>
*           <td></td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>DESCRIPTION</td>
*           <td>string</td>
*           <td>A Human-readable description of the dimension.</td>
*           <td>No</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>STRUCTURE</td>
*           <td>string</td>
*           <td></td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>IS_VIRTUAL</td>
*           <td>boolean</td>
*           <td></td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>IS_READWRITE</td>
*           <td>boolean</td>
*           <td></td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>DIMENSION_UNIQUE_SETTINGS</td>
*           <td>string</td>
*           <td></td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>DIMENSION_MASTER_UNIQUE_NAME</td>
*           <td>string</td>
*           <td></td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>DIMENSION_IS_VISIBLE</td>
*           <td>boolean</td>
*           <td></td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>HIERARCHY_ORDINAL</td>
*           <td>int</td>
*           <td></td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>DIMENSION_IS_SHARED</td>
*           <td>boolean</td>
*           <td></td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>HIERARCHY_IS_VISIBLE</td>
*           <td>boolean</td>
*           <td></td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>HIERARCHY_ORIGIN</td>
*           <td></td>
*           <td></td>
*           <td>Yes</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>HIERARCHY_DISPLAY_FOLDER</td>
*           <td>string</td>
*           <td></td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>INSTANCE_SELECTION</td>
*           <td>string</td>
*           <td></td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*     </tbody>
*   </table>
*   @method discoverMDHierarchies
*   @param {Object} options An object whose properties convey the options for the XML/A a <code>MDSCHEMA_HIERARCHIES</code> request.
*   @return {Xmla.Rowset} The result of the invoking the XML/A <code>Discover</code> method. For synchronous requests, an instance of a <code><a href="Xmla.Rowset.html#Xmla.Rowset">Xmla.Rowset</a></code> that represents the <code>MDSCHEMA_HIERARCHIES</code> schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: <code><a href="#method_addListener">addListener()</a></code>) and listen for the <code>success</code> (see: <code><a href="#property_EVENT_SUCCESS">EVENT_SUCCESS</a></code>) or <code>discoversuccess</code> (see: <code><a href="#property_EVENT_DISCOVER_SUCCESS">EVENT_DISCOVER_SUCCESS</a></code>) events.
*/
    discoverMDHierarchies: function(options){
        var request = _applyProps(options, {
            requestType: Xmla.MDSCHEMA_HIERARCHIES
        }, true);
        return this.discover(request);
    },
/**
*   Invokes the <code><a href="#method_discover">discover()</a></code> method using
*   <code><a href="#property_MDSCHEMA_LEVELS"></a></code> as value for the <code>requestType</code>,
*   and retrieves the <code>MDSCHEMA_LEVELS</code> schema rowset.
*   The rowset has the following columns:
*   <table border="1" class="schema-rowset">
*     <thead>
*       <tr>
*           <th>Column Name</th>
*           <th>Type</th>
*           <th>Description</th>
*           <th>Restriction</th>
*           <th>Nullable</th>
*       </tr>
*     </thead>
*     <tbody>
*       <tr>
*           <td>CATALOG_NAME</td>
*           <td>string</td>
*           <td>The name of the catalog to which this level belongs. NULL if the provider does not support catalogs.</td>
*           <td>Yes</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>SCHEMA_NAME</td>
*           <td>string</td>
*           <td>The name of the schema to which this level belongs. NULL if the provider does not support schemas.</td>
*           <td>Yes</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>CUBE_NAME</td>
*           <td>string</td>
*           <td>The name of the cube to which this level belongs.</td>
*           <td>Yes</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>DIMENSION_UNIQUE_NAME</td>
*           <td>string</td>
*           <td>The unique name of the dimension to which this level belongs. For providers that generate unique names by qualification, each component of this name is delimited.</td>
*           <td>Yes</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>HIERARCHY_UNIQUE_NAME</td>
*           <td>string</td>
*           <td>The unique name of the hierarchy. If the level belongs to more than one hierarchy, there is one row for each hierarchy to which it belongs. For providers that generate unique names by qualification, each component of this name is delimited.</td>
*           <td>Yes</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>LEVEL_NAME</td>
*           <td>string</td>
*           <td>The name of the level.</td>
*           <td>Yes</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>LEVEL_UNIQUE_NAME</td>
*           <td>string</td>
*           <td>The properly escaped unique name of the level.</td>
*           <td>Yes</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>LEVEL_GUID</td>
*           <td>string</td>
*           <td>Not supported.</td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>LEVEL_CAPTION</td>
*           <td>string</td>
*           <td>A label or caption associated with the hierarchy. Used primarily for display purposes. If a caption does not exist, LEVEL_NAME is returned.</td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>LEVEL_NUMBER</td>
*           <td>int</td>
*           <td>The distance of the level from the root of the hierarchy. Root level is zero (0).</td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>LEVEL_CARDINALITY</td>
*           <td>int</td>
*           <td>The number of members in the level.</td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>LEVEL_TYPE</td>
*           <td>int</td>
*           <td>Type of the level:
*                <ul>
*                   <li>MDLEVEL_TYPE_REGULAR (0x0000)</li>
*                   <li>MDLEVEL_TYPE_ALL (0x0001)</li>
*                   <li>MDLEVEL_TYPE_TIME_YEARS (0x0014)</li>
*                   <li>MDLEVEL_TYPE_TIME_HALF_YEAR (0x0024)</li>
*                   <li>MDLEVEL_TYPE_TIME_QUARTERS (0x0044)</li>
*                   <li>MDLEVEL_TYPE_TIME_MONTHS (0x0084)</li>
*                   <li>MDLEVEL_TYPE_TIME_WEEKS (0x0104)</li>
*                   <li>MDLEVEL_TYPE_TIME_DAYS (0x0204)</li>
*                   <li>MDLEVEL_TYPE_TIME_HOURS (0x0304)</li>
*                   <li>MDLEVEL_TYPE_TIME_MINUTES (0x0404)</li>
*                   <li>MDLEVEL_TYPE_TIME_SECONDS (0x0804)</li>
*                   <li>MDLEVEL_TYPE_TIME_UNDEFINED (0x1004)</li>
*                   <li>MDLEVEL_TYPE_GEO_CONTINENT (0x2001)</li>
*                   <li>MDLEVEL_TYPE_GEO_REGION (0x2002)</li>
*                   <li>MDLEVEL_TYPE_GEO_COUNTRY (0x2003)</li>
*                   <li>MDLEVEL_TYPE_GEO_STATE_OR_PROVINCE (0x2004)</li>
*                   <li>MDLEVEL_TYPE_GEO_COUNTY (0x2005)</li>
*                   <li>MDLEVEL_TYPE_GEO_CITY (0x2006)</li>
*                   <li>MDLEVEL_TYPE_GEO_POSTALCODE (0x2007)</li>
*                   <li>MDLEVEL_TYPE_GEO_POINT (0x2008)</li>
*                   <li>MDLEVEL_TYPE_ORG_UNIT (0x1011)</li>
*                   <li>MDLEVEL_TYPE_BOM_RESOURCE (0x1012)</li>
*                   <li>MDLEVEL_TYPE_QUANTITATIVE (0x1013)</li>
*                   <li>MDLEVEL_TYPE_ACCOUNT (0x1014)</li>
*                   <li>MDLEVEL_TYPE_CUSTOMER (0x1021)</li>
*                   <li>MDLEVEL_TYPE_CUSTOMER_GROUP (0x1022)</li>
*                   <li>MDLEVEL_TYPE_CUSTOMER_HOUSEHOLD (0x1023)</li>
*                   <li>MDLEVEL_TYPE_PRODUCT (0x1031)</li>
*                   <li>MDLEVEL_TYPE_PRODUCT_GROUP (0x1032)</li>
*                   <li>MDLEVEL_TYPE_SCENARIO (0x1015)</li>
*                   <li>MDLEVEL_TYPE_UTILITY (0x1016)</li>
*                   <li>MDLEVEL_TYPE_PERSON (0x1041)</li>
*                   <li>MDLEVEL_TYPE_COMPANY (0x1042)</li>
*                   <li>MDLEVEL_TYPE_CURRENCY_SOURCE (0x1051)</li>
*                   <li>MDLEVEL_TYPE_CURRENCY_DESTINATION (0x1052)</li>
*                   <li>MDLEVEL_TYPE_CHANNEL (0x1061)</li>
*                   <li>MDLEVEL_TYPE_REPRESENTATIVE (0x1062)</li>
*                   <li>MDLEVEL_TYPE_PROMOTION (0x1071)</li>
*                </ul>
*               Some of the OLE DB for OLAP values are as flags, and do not become values of the enumeration:
*               <ul>
*                   <li>MDLEVEL_TYPE_UNKNOWN (0x0000) signals that no other flags are set.</li>
*                   <li>MDLEVEL_TYPE_CALCULATED (0x0002) indicates that the level is calculated.</li>
*                   <li>MDLEVEL_TYPE_TIME (0x0004) indicates that the level is time-related.</li>
*                   <li>MDLEVEL_TYPE_RESERVED1 (0x0008) is reserved for future use.</li>
*               </ul>
*           <td>No</td>
*           <td>Yes</td>
*       <tr>
*           <td>DESCRIPTION</td>
*           <td>string</td>
*           <td>A human-readable description of the level. NULL if no description exists.</td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>CUSTOM_ROLLUP_SETTINGS</td>
*           <td>int</td>
*           <td>A bitmap that specifies the custom rollup options:
*             <ul>
*               <li>MDLEVELS_CUSTOM_ROLLUP_EXPRESSION (0x01) indicates an expression exists for this level. (Deprecated)</li>
*               <li>MDLEVELS_CUSTOM_ROLLUP_COLUMN (0x02) indicates that there is a custom rollup column for this level.</li>
*               <li>MDLEVELS_SKIPPED_LEVELS (0x04) indicates that there is a skipped level associated with members of this level.</li>
*               <li>MDLEVELS_CUSTOM_MEMBER_PROPERTIES (0x08) indicates that members of the level have custom member properties.</li>
*               <li>MDLEVELS_UNARY_OPERATOR (0x10) indicates that members on the level have unary operators.</li>
*             </ul>
*           </td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>LEVEL_UNIQUE_SETTINGS</td>
*           <td>int</td>
*           <td>A bitmap that specifies which columns contain unique values, if the level only has members with unique names or keys.
*               The Msmd.h file defines the following bit value constants for this bitmap:
*             <ul>
*               <li>MDDIMENSIONS_MEMBER_KEY_UNIQUE (1)</li>
*               <li>MDDIMENSIONS_MEMBER_NAME_UNIQUE (2)</li>
*             </ul>
*               The key is always unique in Microsoft SQL Server 2005 Analysis Services (SSAS).
*               The name will be unique if the setting on the attribute is UniqueInDimension or UniqueInAttribute
*           </td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>LEVEL_IS_VISIBLE</td>
*           <td>bool</td>
*           <td>A Boolean that indicates whether the level is visible. Always returns True. If the level is not visible, it will not be included in the schema rowset.</td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>LEVEL_ORDERING_PROPERTY</td>
*           <td>string</td>
*           <td>The ID of the attribute that the level is sorted on.</td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>LEVEL_DBTYPE</td>
*           <td>int</td>
*           <td>The DBTYPE enumeration of the member key column that is used for the level attribute. Null if concatenated keys are used as the member key column.</td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>LEVEL_MASTER_UNIQUE_NAME</td>
*           <td>string</td>
*           <td>Always returns NULL.</td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>LEVEL_NAME_SQL_COLUMN_NAME</td>
*           <td>string</td>
*           <td>The SQL representation of the level member names.</td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>LEVEL_KEY_SQL_COLUMN_NAME</td>
*           <td>string</td>
*           <td>The SQL representation of the level member key values.</td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>LEVEL_UNIQUE_NAME_SQL_COLUMN_NAME</td>
*           <td>string</td>
*           <td>The SQL representation of the member unique names.</td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>LEVEL_ATTRIBUTE_HIERARCHY_NAME</td>
*           <td>string</td>
*            <td>The name of the attribute hierarchy providing the source of the level.</td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>LEVEL_KEY_CARDINALITY</td>
*           <td>int</td>
*            <td>The number of columns in the level key.</td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>LEVEL_ORIGIN</td>
*           <td>int</td>
*            <td>A bit map that defines how the level was sourced:MD_ORIGIN_USER_DEFINED identifies levels in a user defined hierarchy.MD_ORIGIN_ATTRIBUTE identifies levels in an attribute hierarchy.MD_ORIGIN_KEY_ATTRIBUTE identifies levels in a key attribute hierarchy.MD_ORIGIN_INTERNAL identifies levels in attribute hierarchies that are not enabled.</td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*     </tbody>
*   </table>
*   @method discoverMDLevels
*   @param {Object} options An object whose properties convey the options for the XML/A a <code>MDSCHEMA_LEVELS</code> request.
*   @return {Xmla.Rowset} The result of the invoking the XML/A <code>Discover</code> method. For synchronous requests, an instance of a <code><a href="Xmla.Rowset.html#Xmla.Rowset">Xmla.Rowset</a></code> that represents the <code>MDSCHEMA_LEVELS</code> schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: <code><a href="#method_addListener">addListener()</a></code>) and listen for the <code>success</code> (see: <code><a href="#property_EVENT_SUCCESS">EVENT_SUCCESS</a></code>) or <code>discoversuccess</code> (see: <code><a href="#property_EVENT_DISCOVER_SUCCESS">EVENT_DISCOVER_SUCCESS</a></code>) events.
*/
    discoverMDLevels: function(options){
        var request = _applyProps(options, {
            requestType: Xmla.MDSCHEMA_LEVELS
        }, true);
        return this.discover(request);
    },
/**
*   Invokes the <code><a href="#method_discover">discover()</a></code> method using
*   <code><a href="#property_MDSCHEMA_MEASURES"></a></code> as value for the <code>requestType</code>,
*   and retrieves the <code>MDSCHEMA_MEASURES</code> schema rowset.
*   ...todo...
*   The rowset has the following columns:
*   <table border="1" class="schema-rowset">
*     <thead>
*       <tr>
*           <th>Column Name</th>
*           <th>Type</th>
*           <th>Description</th>
*           <th>Restriction</th>
*           <th>Nullable</th>
*       </tr>
*     </thead>
*     <tbody>
*       <tr>
*           <td>CATALOG_NAME</td>
*           <td>string</td>
*           <td>Name of the catalog</td>
*           <td>Yes</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>SCHEMA_NAME</td>
*           <td>string</td>
*           <td>Not supported</td>
*           <td>Yes</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>CUBE_NAME</td>
*           <td>string</td>
*           <td>Name of the cube.</td>
*           <td>Yes</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>MEASURE_NAME</td>
*           <td>string</td>
*           <td>The name of the measure.</td>
*           <td>Yes</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>MEASURE_UNIQUE_NAME</td>
*           <td>string</td>
*           <td>The Unique name of the measure. For providers that generate unique names by qualification, each component of this name is delimited.</td>
*           <td>Yes</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>MEASURE_CAPTION</td>
*           <td>string</td>
*           <td>A label or caption associated with the measure. Used primarily for display purposes. If a caption does not exist, MEASURE_NAME is returned.</td>
*           <td>No</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>MEASURE_GUID</td>
*           <td>string</td>
*           <td>Not supported.</td>
*           <td>No</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>MEASURE_AGGREGATOR</td>
*           <td>int</td>
*           <td>An enumeration that indicates how the measure was derived. See <a href="http://msdn.microsoft.com/en-us/library/ms126250.aspx" target="msdn">http://msdn.microsoft.com/en-us/library/ms126250.aspx</a></td>
*           <td>No</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>DATA_TYPE</td>
*           <td>int</td>
*           <td>The data type of the measure. Valid values are:
*             <dl>
*               <dt>DBTYPE_EMPTY</dt><dd>0</dd>
*               <dt>DBTYPE_NULL</dt><dd>1</dd>
*               <dt>DBTYPE_I2</dt><dd>2</dd>
*               <dt>DBTYPE_I4</dt><dd>3</dd>
*               <dt>DBTYPE_R4</dt><dd>4</dd>
*               <dt>DBTYPE_R8</dt><dd>5</dd>
*               <dt>DBTYPE_CY</dt><dd>6</dd>
*               <dt>DBTYPE_DATE</dt><dd>7</dd>
*               <dt>DBTYPE_BSTR</dt><dd>8</dd>
*               <dt>DBTYPE_IDISPATCH</dt><dd>9</dd>
*               <dt>DBTYPE_ERROR</dt><dd>10</dd>
*               <dt>DBTYPE_BOOL</dt><dd>11</dd>
*               <dt>DBTYPE_VARIANT</dt><dd>12</dd>
*               <dt>DBTYPE_IUNKNOWN</dt><dd>13</dd>
*               <dt>DBTYPE_DECIMAL</dt><dd>14</dd>
*               <dt>DBTYPE_UI1</dt><dd>17</dd>
*               <dt>DBTYPE_ARRAY</dt><dd>0x2000</dd>
*               <dt>DBTYPE_BYREF</dt><dd>0x4000</dd>
*               <dt>DBTYPE_I1</dt><dd>16</dd>
*               <dt>DBTYPE_UI2</dt><dd>18</dd>
*               <dt>DBTYPE_UI4</dt><dd>19</dd>
*               <dt>DBTYPE_I8</dt><dd>20</dd>
*               <dt>DBTYPE_UI8</dt><dd>21</dd>
*               <dt>DBTYPE_GUID</dt><dd>72</dd>
*               <dt>DBTYPE_VECTOR</dt><dd>0x1000</dd>
*               <dt>DBTYPE_FILETIME</dt><dd>64</dd>
*               <dt>DBTYPE_RESERVED</dt><dd>0x8000</dd>
*               <dt>DBTYPE_BYTES</dt><dd>128</dd>
*               <dt>DBTYPE_STR</dt><dd>129</dd>
*               <dt>DBTYPE_WSTR</dt><dd>130</dd>
*               <dt>DBTYPE_NUMERIC</dt><dd>131</dd>
*               <dt>DBTYPE_UDT</dt><dd>132</dd>
*               <dt>DBTYPE_DBDATE</dt><dd>133</dd>
*               <dt>DBTYPE_DBTIME</dt><dd>134</dd>
*               <dt>DBTYPE_DBTIMESTAMP</dt><dd>135</dd>
*               <dt>DBTYPE_HCHAPTER</dt><dd>136</dd>
*               <dt>DBTYPE_PROPVARIANT</dt><dd>138</dd>
*               <dt>DBTYPE_VARNUMERIC</dt><dd>139</dd>
*             </dl>
*            See: <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms711251(v=vs.85).aspx" target="msdn">http://msdn.microsoft.com/en-us/library/windows/desktop/ms711251(v=vs.85).aspx</a></td>
*           <td>No</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>NUMERIC_PRECISION</td>
*           <td>int</td>
*           <td>The maximum precision of the property if the measure object's data type is exact numeric. NULL for all other property types.</td>
*           <td>No</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>NUMERIC_SCALE</td>
*           <td>int</td>
*           <td>The number of digits to the right of the decimal point if the measure object's type indicator is DBTYPE_NUMERIC or DBTYPE_DECIMAL. Otherwise, this value is NULL.</td>
*           <td>No</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>MEASURE_UNITS</td>
*           <td>int</td>
*           <td>Not supported.</td>
*           <td>No</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>DESCRIPTION</td>
*           <td>string</td>
*           <td>A human-readable description of the measure. NULL if no description exists.</td>
*           <td>No</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>EXPRESSION</td>
*           <td>string</td>
*           <td>An expression for the member.</td>
*           <td>No</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>MEASURE_IS_VISIBLE</td>
*           <td>boolean</td>
*           <td>A Boolean that always returns True. If the measure is not visible, it will not be included in the schema rowset.</td>
*           <td>No</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>LEVELS_LIST</td>
*           <td>string</td>
*           <td>A string that always returns NULL.</td>
*           <td>No</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>MEASURE_NAME_SQL_COLUMN_NAME</td>
*           <td>string</td>
*           <td>The name of the column in the SQL query that corresponds to the measure's name.</td>
*           <td>No</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>MEASURE_UNQUALIFIED_CAPTION</td>
*           <td>string</td>
*           <td>The name of the measure, not qualified with the measure group name.</td>
*           <td>No</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>MEASUREGROUP_NAME</td>
*           <td>string</td>
*           <td>The name of the measure group to which the measure belongs.</td>
*           <td>Yes</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>MEASURE_DISPLAY_FOLDER</td>
*           <td>string</td>
*           <td>The path to be used when displaying the measure in the user interface. Folder names will be separated by a semicolon. Nested folders are indicated by a backslash (\).</td>
*           <td>No</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>DEFAULT_FORMAT_STRING</td>
*           <td>string</td>
*           <td>The default format string for the measure.</td>
*           <td>No</td>
*           <td>No</td>
*       </tr>
*     </tbody>
*   </table>
*   @method discoverMDMeasures
*   @param {Object} options An object whose properties convey the options for the XML/A a <code>MDSCHEMA_MEASURES</code> request.
*   @return {Xmla.Rowset} The result of the invoking the XML/A <code>Discover</code> method. For synchronous requests, an instance of a <code><a href="Xmla.Rowset.html#Xmla.Rowset">Xmla.Rowset</a></code> that represents the <code>MDSCHEMA_MEASURES</code> schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: <code><a href="#method_addListener">addListener()</a></code>) and listen for the <code>success</code> (see: <code><a href="#property_EVENT_SUCCESS">EVENT_SUCCESS</a></code>) or <code>discoversuccess</code> (see: <code><a href="#property_EVENT_DISCOVER_SUCCESS">EVENT_DISCOVER_SUCCESS</a></code>) events.
*/
    discoverMDMeasures: function(options){
        var request = _applyProps(options, {
            requestType: Xmla.MDSCHEMA_MEASURES
        }, true);
        return this.discover(request);
    },
/**
*   Invokes the <code><a href="#method_discover">discover()</a></code> method using
*   <code><a href="#property_MDSCHEMA_MEMBERS"></a></code> as value for the <code>requestType</code>,
*   and retrieves the <code>MDSCHEMA_MEMBERS</code> schema rowset.
*   The rowset has the following columns:
*   <table border="1" class="schema-rowset">
*     <thead>
*       <tr>
*           <th>Column Name</th>
*           <th>Type</th>
*           <th>Description</th>
*           <th>Restriction</th>
*           <th>Nullable</th>
*       </tr>
*     </thead>
*     <tbody>
*       <tr>
*           <td>CATALOG_NAME</td>
*           <td>string</td>
*           <td>The name of the catalog</td>
*           <td>Yes</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>SCHEMA_NAME</td>
*           <td>string</td>
*           <td>The name of the schema</td>
*           <td>Yes</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>CUBE_NAME</td>
*           <td>string</td>
*           <td>The name of the cube</td>
*           <td>Yes</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>DIMENSION_UNIQUE_NAME</td>
*           <td>string</td>
*           <td>The unique name of the dimension</td>
*           <td>Yes</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>HIERARCHY_UNIQUE_NAME</td>
*           <td>string</td>
*           <td>The unique name of the hierarchy</td>
*           <td>Yes</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>LEVEL_UNIQUE_NAME</td>
*           <td>string</td>
*           <td>The unique name of the level</td>
*           <td>Yes</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>LEVEL_NUMBERr</td>
*           <td>int</td>
*           <td>Distance of this level to the root</td>
*           <td>Yes</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>MEMBER_ORDINAL</td>
*           <td>int</td>
*           <td>Deprecated: always 0</td>
*           <td>No</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>MEMBER_NAME</td>
*           <td>string</td>
*           <td>The name of this member</td>
*           <td>Yes</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>MEMBER_UNIQUE_NAME</td>
*           <td>string</td>
*           <td>The unique name of this member</td>
*           <td>Yes</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>MEMBER_TYPE</td>
*           <td>int</td>
*           <td>An integer constant indicating the type of this member. Can take on one of the following values:
*               <ul>
*                   <li><a href="Xmla.Rowset.html#property_MDMEMBER_TYPE_REGULAR">MDMEMBER_TYPE_REGULAR</a></li>
*                   <li><a href="Xmla.Rowset.html#property_MDMEMBER_TYPE_ALL">MDMEMBER_TYPE_ALL</a></li>
*                   <li><a href="Xmla.Rowset.html#property_MDMEMBER_TYPE_MEASURE">MDMEMBER_TYPE_MEASURE</a></li>
*                   <li><a href="Xmla.Rowset.html#property_MDMEMBER_TYPE_FORMULA">MDMEMBER_TYPE_FORMULA</a></li>
*                   <li><a href="Xmla.Rowset.html#property_MDMEMBER_TYPE_UNKNOWN">MDMEMBER_TYPE_UNKNOWN</a></li>
*                   <li><a href="Xmla.Rowset.html#property_MDMEMBER_TYPE_FORMULA">MDMEMBER_TYPE_FORMULA</a></li>
*               </ul>
*           </td>
*           <td>Yes</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>MEMBER_GUID</td>
*           <td>string</td>
*           <td>The guid of this member</td>
*           <td>No</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>MEMBER_CAPTION</td>
*           <td>string</td>
*           <td>A label or caption associated with the member. Used primarily for display purposes. If a caption does not exist, MEMBER_NAME is returned.</td>
*           <td>No</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>CHILDREN_CARDINALITY</td>
*           <td>int</td>
*           <td>The number of childrend for this member</td>
*           <td>No</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>PARENT_LEVEL</td>
*           <td>int</td>
*           <td>The distance of the member's parent from the root level of the hierarchy. The root level is zero (0).</td>
*           <td>No</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>DESCRIPTION</td>
*           <td>string</td>
*           <td>This column always returns a NULL value. This column exists for backwards compatibility</td>
*           <td>No</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>EXPRESSION</td>
*           <td>string</td>
*           <td>The expression for calculations, if the member is of type MDMEMBER_TYPE_FORMULA.</td>
*           <td>No</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>MEMBER_KEY</td>
*           <td>string</td>
*           <td>The value of the member's key column. Returns NULL if the member has a composite key.</td>
*           <td>No</td>
*           <td>No</td>
*       </tr>
*     </tbody>
*   </table>
*   @method discoverMDMembers
*   @param {Object} options An object whose properties convey the options for the XML/A a <code>MDSCHEMA_MEMBERS</code> request.
*   @return {Xmla.Rowset} The result of the invoking the XML/A <code>Discover</code> method. For synchronous requests, an instance of a <code><a href="Xmla.Rowset.html#Xmla.Rowset">Xmla.Rowset</a></code> that represents the <code>MDSCHEMA_MEMBERS</code> schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: <code><a href="#method_addListener">addListener()</a></code>) and listen for the <code>success</code> (see: <code><a href="#property_EVENT_SUCCESS">EVENT_SUCCESS</a></code>) or <code>discoversuccess</code> (see: <code><a href="#property_EVENT_DISCOVER_SUCCESS">EVENT_DISCOVER_SUCCESS</a></code>) events.
*/
    discoverMDMembers: function(options){
        var request = _applyProps(options, {
            requestType: Xmla.MDSCHEMA_MEMBERS
        }, true);
        return this.discover(request);
    },
/**
*   Invokes the <code><a href="#method_discover">discover()</a></code> method using
*   <code><a href="#property_MDSCHEMA_PROPERTIES"></a></code> as value for the <code>requestType</code>,
*   and retrieves the <code>MDSCHEMA_PROPERTIES</code> schema rowset.
*   The rowset has the following columns:
*   <table border="1" class="schema-rowset">
*     <thead>
*       <tr>
*           <th>Column Name</th>
*           <th>Type</th>
*           <th>Description</th>
*           <th>Restriction</th>
*           <th>Nullable</th>
*       </tr>
*     </thead>
*     <tbody>
*       <tr>
*           <td>CATALOG_NAME</td>
*           <td>string</td>
*           <td>The name of the database.</td>
*           <td>Yes</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>SCHEMA_NAME</td>
*           <td>string</td>
*           <td>The name of the schema to which this property belongs. NULL if the provider does not support schemas.</td>
*           <td>Yes</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>CUBE_NAME</td>
*           <td>string</td>
*           <td>The name of the cube.</td>
*           <td>Yes</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>DIMENSION_UNIQUE_NAME</td>
*           <td>string</td>
*           <td>The unique name of the dimension. For providers that generate unique names by qualification, each component of this name is delimited.</td>
*           <td>Yes</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>HIERARCHY_UNIQUE_NAME</td>
*           <td>string</td>
*           <td>The unique name of the hierarchy. For providers that generate unique names by qualification, each component of this name is delimited.</td>
*           <td>Yes</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>LEVEL_UNIQUE_NAME</td>
*           <td>string</td>
*           <td>The unique name of the level to which this property belongs. If the provider does not support named levels, it should return the DIMENSION_UNIQUE_NAME value for this field. For providers that generate unique names by qualification, each component of this name is delimited.</td>
*           <td>Yes</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>MEMBER_UNIQUE_NAME</td>
*           <td>string</td>
*           <td>The unique name of the member to which the property belongs. Used for data stores that do not support named levels or have properties on a member-by-member basis. If the property applies to all members in a level, this column is NULL. For providers that generate unique names by qualification, each component of this name is delimited.</td>
*           <td>Yes</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>PROPERTY_TYPE</td>
*           <td>int</td>
*           <td>A bitmap that specifies the type of the property:
*             <dl>
*               <dt>MDPROP_MEMBER (1)</dt><dd>identifies a property of a member. This property can be used in the DIMENSION PROPERTIES clause of the SELECT statement.</dd>
*               <dt>MDPROP_CELL (2)</dt><dd>identifies a property of a cell. This property can be used in the CELL PROPERTIES clause that occurs at the end of the SELECT statement.</dd>
*               <dt>MDPROP_SYSTEM (4)</dt><dd>identifies an internal property.</dd>
*               <dt>MDPROP_BLOB (8)</dt><dd>identifies a property which contains a binary large object (blob).</dd>
*             </dl>
*           </td>
*           <td>Yes</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>PROPERTY_NAME</td>
*           <td>string</td>
*           <td>The name of the property. If the key for the property is the same as the name for the property, PROPERTY_NAME will be blank.</td>
*           <td>Yes</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>PROPERTY_CAPTION</td>
*           <td>string</td>
*           <td>A label or caption associated with the property, used primarily for display purposes. Returns PROPERTY_NAME if a caption does not exist.</td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>DATA_TYPE</td>
*           <td>int</td>
*           <td>The data type of the property.</td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>CHARACTER_MAXIMUM_LENGTH</td>
*           <td>int</td>
*           <td>The maximum possible length of the property, if it is a character, binary, or bit type. Zero indicates there is no defined maximum length. Returns NULL for all other data types.</td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>CHARACTER_OCTET_LENGTH</td>
*           <td>int</td>
*           <td>The maximum possible length (in bytes) of the property, if it is a character or binary type. Zero indicates there is no defined maximum length. Returns NULL for all other data types.</td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>NUMERIC_PRECISION</td>
*           <td>int</td>
*           <td>The maximum precision of the property, if it is a numeric data type. Returns NULL for all other data types.</td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>NUMERIC_SCALE</td>
*           <td>int</td>
*           <td>The number of digits to the right of the decimal point, if it is a DBTYPE_NUMERIC or DBTYPE_DECIMAL type. Returns NULL for all other data types.</td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>DESCRIPTION</td>
*           <td>string</td>
*           <td>A human readable description of the property. NULL if no description exists.</td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>PROPERTY_CONTENT_TYPE</td>
*           <td>int</td>
*           <td>The type of the property. Can be one of the following enumerations:
*           </td>
*           <td>Yes</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>SQL_COLUMN_NAME</td>
*           <td>string</td>
*           <td>The name of the property used in SQL queries from the cube dimension or database dDimension.</td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>LANGUAGE</td>
*           <td>int</td>
*           <td>The translation expressed as an LCID. Only valid for property translations.</td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>PROPERTY_ORIGIN</td>
*           <td>int</td>
*           <td>Identifies the type of hierarchy that the property applies to:</td>
*           <td>Yes</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>PROPERTY_ATTRIBUTE_HIERARCHY_NAME</td>
*           <td>string</td>
*           <td>The name of the attribute hierarchy sourcing this property.</td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>PROPERTY_CARDINALITY</td>
*           <td>string</td>
*           <td>The cardinality of the property. Possible values include the following strings: ONE or MANY</td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>MIME_TYPE</td>
*           <td>string</td>
*           <td>The mime type for binary large objects (BLOBs).</td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>PROPERTY_IS_VISIBLE</td>
*           <td>boolean</td>
*           <td>A Boolean that indicates whether the property is visible. TRUE if the property is visible; otherwise, FALSE.</td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*     </tbody>
*   </table>
*   @method discoverMDProperties
*   @param {Object} options An object whose properties convey the options for the XML/A a <code>MDSCHEMA_PROPERTIES</code> request.
*   @return {Xmla.Rowset} The result of the invoking the XML/A <code>Discover</code> method. For synchronous requests, an instance of a <code><a href="Xmla.Rowset.html#Xmla.Rowset">Xmla.Rowset</a></code> that represents the <code>MDSCHEMA_PROPERTIES</code> schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: <code><a href="#method_addListener">addListener()</a></code>) and listen for the <code>success</code> (see: <code><a href="#property_EVENT_SUCCESS">EVENT_SUCCESS</a></code>) or <code>discoversuccess</code> (see: <code><a href="#property_EVENT_DISCOVER_SUCCESS">EVENT_DISCOVER_SUCCESS</a></code>) events.
*/
    discoverMDProperties: function(options){
        var request = _applyProps(options, {
            requestType: Xmla.MDSCHEMA_PROPERTIES
        }, true);
        return this.discover(request);
    },
/**
*   Invokes the <code><a href="#method_discover">discover()</a></code> method using
*   <code><a href="#property_MDSCHEMA_SETS"></a></code> as value for the <code>requestType</code>,
*   and retrieves the <code>MDSCHEMA_SETS</code> schema rowset.
*   ...todo...
*   The rowset has the following columns:
*   <table border="1" class="schema-rowset">
*     <thead>
*       <tr>
*           <th>Column Name</th>
*           <th>Type</th>
*           <th>Description</th>
*           <th>Restriction</th>
*           <th>Nullable</th>
*       </tr>
*     </thead>
*     <tbody>
*       <tr>
*           <td>CATALOG_NAME</td>
*           <td>string</td>
*           <td>The name of the catalog to which this set belongs.</td>
*           <td>Yes</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>SCHEMA_NAME</td>
*           <td>string</td>
*           <td>The name of the schema to which this property belongs. NULL if the provider does not support schemas.</td>
*           <td>Yes</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>CUBE_NAME</td>
*           <td>string</td>
*           <td>The name of the cube to which the set belongs. This column always contains a value and can never be null.</td>
*           <td>Yes</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>SET_NAME</td>
*           <td>string</td>
*           <td>The name of the set.</td>
*           <td>Yes</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>SCOPE</td>
*           <td>string</td>
*           <td>The scope of the set.</td>
*           <td>Yes</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>DESCRIPTION</td>
*           <td>string</td>
*           <td></td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*       <tr>
*           <td>EXPRESSION</td>
*           <td>string</td>
*           <td>The expression for this set.</td>
*           <td>No</td>
*           <td>No</td>
*       </tr>
*       <tr>
*           <td>DIMENSIONS</td>
*           <td>string</td>
*           <td>A comma separated list of dimensions used by this set.</td>
*           <td>No</td>
*           <td>Yes</td>
*       </tr>
*     </tbody>
*   </table>
*   @method discoverMDSets
*   @param {Object} options An object whose properties convey the options for the XML/A a <code>MDSCHEMA_SETS</code> request.
*   @return {Xmla.Rowset} The result of the invoking the XML/A <code>Discover</code> method. For synchronous requests, an instance of a <code><a href="Xmla.Rowset.html#Xmla.Rowset">Xmla.Rowset</a></code> that represents the <code>MDSCHEMA_SETS</code> schema rowset. For an asynchronous request, the return value is not defined: you should add a listener (see: <code><a href="#method_addListener">addListener()</a></code>) and listen for the <code>success</code> (see: <code><a href="#property_EVENT_SUCCESS">EVENT_SUCCESS</a></code>) or <code>discoversuccess</code> (see: <code><a href="#property_EVENT_DISCOVER_SUCCESS">EVENT_DISCOVER_SUCCESS</a></code>) events.
*/
    discoverMDSets: function(options){
        var request = _applyProps(options, {
            requestType: Xmla.MDSCHEMA_SETS
        }, true);
        return this.discover(request);
    }
};

function _getComplexType(node, name){
    var types = _getElementsByTagNameNS(node, _xmlnsSchema, _xmlnsSchemaPrefix, "complexType"),
        numTypes = types.length,
        type, i
    ;
    for (i = 0; i < numTypes; i++){
        type = types[i];
        if (_getAttribute(type, "name")===name) return type;
    }
    return null;
}

/**
*   <p>
*   This class implements an XML/A Rowset object.
*   </p>
*   <p>
*   You do not need to instantiate objects of this class yourself.
*   Rather, the <code><a href="Xmla.html#class_Xmla">Xmla</a></code> class will instantiate this class to convey the result of any of the various <code>discoverXXX()</code> methods
*   (see <code><a href="Xmla.html#method_discover">discover()</a></code>).
*   In addition, this class is also used to instantiate a Resultset for the
*   <code><a name="Xmla.html#method_execute">execute()</code> method in case the
*   <code>Format</code> property is set to <code>Tabular</code>
*   (see <code><a name="Xmla.html#property_OPTION_FORMAT">OPTION_FORMAT</a></code> and <code><a name="Xmla.html#property_OPTION_FORMAT_TABULAR">OPTION_FORMAT_TABULAR</a></code>).
*   The <code><a href="Xmla.html#method_request">request()</a></code> method itself will also return an instance of this class in case the <code>method</code> is used to do a
*   <code>Discover</code> request, or in case it is used to do a <code>Execute</code> request and the <code>Format</code> property is set to <code>Tabular</code>.
*   </p>
*   <p>
*   An instance of the <code>Xmla.Rowset</code> class is returned immediately as return value from the <code>disoverXXX()</code> or <code>execute()</code> method when doing a synchronous request.
*   In addition, the rowset is available in the eventdata passed to any registered listeners
*   (see <code><a href="Xmla.html#method_addListener">addListener()</a></code>).
*   Note that for asynchronous requests, the only way to obtain the returned <code>Rowset</code> instance is through the listeners.
*   </p>
*
*   @class Xmla.Rowset
*   @constructor
*   @param {DOMDocument} node The responseXML result returned by server in response to a <code>Discover</code> request.
*   @param {string} requestTtype The requestType identifying the particular schema rowset to construct. This facilitates implementing field getters for a few complex types.
*   @param {Xmla} xmla The Xmla instance that created this Rowset. This is mainly used to allow the Rowset to access the options passed to the Xmla constructor.
*/
Xmla.Rowset = function (node, requestType, xmla){
    if (typeof(node) === "string"){
      node = _xjs(node);
    }
    this._node = node;
    this._type = requestType;
    this._xmla = xmla;
    this._initData();
    return this;
};

/**
*   A possible value for the <code>DIMENSION_TYPE</code> column that appears in the
*   <code>MDSCHEMA_DIMENSIONS</code> (See: <code><a href="Xmla.html#method_discoverMDDimensions">discoverMDDimensions()</a></code>) and
*   <code>MDSCHEMA_HIERARCHIES</code> (See: <code><a href="Xmla.html#method_discoverMDHierarchies">discoverMDHierarchies()</a></code>)rowsets.
*
*   @property MD_DIMTYPE_UNKNOWN
*   @static
*   @final
*   @type int
*   @default 0
*/
Xmla.Rowset.MD_DIMTYPE_UNKNOWN = 0;
/**
*   A possible value for the <code>DIMENSION_TYPE</code> column that appears in the
*   <code>MDSCHEMA_DIMENSIONS</code> (See: <code><a href="Xmla.html#method_discoverMDDimensions">discoverMDDimensions()</a></code>) and
*   <code>MDSCHEMA_HIERARCHIES</code> (See: <code><a href="Xmla.html#method_discoverMDHierarchies">discoverMDHierarchies()</a></code>)rowsets.
*
*   @property MD_DIMTYPE_TIME
*   @static
*   @final
*   @type int
*   @default 1
*/
Xmla.Rowset.MD_DIMTYPE_TIME = 1;
/**
*   A possible value for the <code>DIMENSION_TYPE</code> column that appears in the
*   <code>MDSCHEMA_DIMENSIONS</code> (See: <code><a href="Xmla.html#method_discoverMDDimensions">discoverMDDimensions()</a></code>) and
*   <code>MDSCHEMA_HIERARCHIES</code> (See: <code><a href="Xmla.html#method_discoverMDHierarchies">discoverMDHierarchies()</a></code>)rowsets.
*
*   @property MD_DIMTYPE_MEASURE
*   @static
*   @final
*   @type int
*   @default 2
*/
Xmla.Rowset.MD_DIMTYPE_MEASURE = 2;
/**
*   A possible value for the <code>DIMENSION_TYPE</code> column that appears in the
*   <code>MDSCHEMA_DIMENSIONS</code> (See: <code><a href="Xmla.html#method_discoverMDDimensions">discoverMDDimensions()</a></code>) and
*   <code>MDSCHEMA_HIERARCHIES</code> (See: <code><a href="Xmla.html#method_discoverMDHierarchies">discoverMDHierarchies()</a></code>)rowsets.
*
*   @property MD_DIMTYPE_OTHER
*   @static
*   @final
*   @type int
*   @default 3
*/
Xmla.Rowset.MD_DIMTYPE_OTHER = 3;
/**
*   A possible value for the <code>DIMENSION_TYPE</code> column that appears in the
*   <code>MDSCHEMA_DIMENSIONS</code> (See: <code><a href="Xmla.html#method_discoverMDDimensions">discoverMDDimensions()</a></code>) and
*   <code>MDSCHEMA_HIERARCHIES</code> (See: <code><a href="Xmla.html#method_discoverMDHierarchies">discoverMDHierarchies()</a></code>)rowsets.
*
*   @property MD_DIMTYPE_QUANTITATIVE
*   @static
*   @final
*   @type int
*   @default 5
*/
Xmla.Rowset.MD_DIMTYPE_QUANTITATIVE = 5;
/**
*   A possible value for the <code>DIMENSION_TYPE</code> column that appears in the
*   <code>MDSCHEMA_DIMENSIONS</code> (See: <code><a href="Xmla.html#method_discoverMDDimensions">discoverMDDimensions()</a></code>) and
*   <code>MDSCHEMA_HIERARCHIES</code> (See: <code><a href="Xmla.html#method_discoverMDHierarchies">discoverMDHierarchies()</a></code>)rowsets.
*
*   @property MD_DIMTYPE_ACCOUNTS
*   @static
*   @final
*   @type int
*   @default 6
*/
Xmla.Rowset.MD_DIMTYPE_ACCOUNTS = 6;
/**
*   A possible value for the <code>DIMENSION_TYPE</code> column that appears in the
*   <code>MDSCHEMA_DIMENSIONS</code> (See: <code><a href="Xmla.html#method_discoverMDDimensions">discoverMDDimensions()</a></code>) and
*   <code>MDSCHEMA_HIERARCHIES</code> (See: <code><a href="Xmla.html#method_discoverMDHierarchies">discoverMDHierarchies()</a></code>)rowsets.
*
*   @property MD_DIMTYPE_CUSTOMERS
*   @static
*   @final
*   @type int
*   @default 7
*/
Xmla.Rowset.MD_DIMTYPE_CUSTOMERS = 7;
/**
*   A possible value for the <code>DIMENSION_TYPE</code> column that appears in the
*   <code>MDSCHEMA_DIMENSIONS</code> (See: <code><a href="Xmla.html#method_discoverMDDimensions">discoverMDDimensions()</a></code>) and
*   <code>MDSCHEMA_HIERARCHIES</code> (See: <code><a href="Xmla.html#method_discoverMDHierarchies">discoverMDHierarchies()</a></code>)rowsets.
*
*   @property MD_DIMTYPE_PRODUCTS
*   @static
*   @final
*   @type int
*   @default 8
*/
Xmla.Rowset.MD_DIMTYPE_PRODUCTS = 8;
/**
*   A possible value for the <code>DIMENSION_TYPE</code> column that appears in the
*   <code>MDSCHEMA_DIMENSIONS</code> (See: <code><a href="Xmla.html#method_discoverMDDimensions">discoverMDDimensions()</a></code>) and
*   <code>MDSCHEMA_HIERARCHIES</code> (See: <code><a href="Xmla.html#method_discoverMDHierarchies">discoverMDHierarchies()</a></code>)rowsets.
*
*   @property MD_DIMTYPE_SCENARIO
*   @static
*   @final
*   @type int
*   @default 9
*/
Xmla.Rowset.MD_DIMTYPE_SCENARIO = 9;
/**
*   A possible value for the <code>DIMENSION_TYPE</code> column that appears in the
*   <code>MDSCHEMA_DIMENSIONS</code> (See: <code><a href="Xmla.html#method_discoverMDDimensions">discoverMDDimensions()</a></code>) and
*   <code>MDSCHEMA_HIERARCHIES</code> (See: <code><a href="Xmla.html#method_discoverMDHierarchies">discoverMDHierarchies()</a></code>)rowsets.
*
*   @property MD_DIMTYPE_UTILIY
*   @static
*   @final
*   @type int
*   @default 10
*/
Xmla.Rowset.MD_DIMTYPE_UTILIY = 10;
/**
*   A possible value for the <code>DIMENSION_TYPE</code> column that appears in the
*   <code>MDSCHEMA_DIMENSIONS</code> (See: <code><a href="Xmla.html#method_discoverMDDimensions">discoverMDDimensions()</a></code>) and
*   <code>MDSCHEMA_HIERARCHIES</code> (See: <code><a href="Xmla.html#method_discoverMDHierarchies">discoverMDHierarchies()</a></code>)rowsets.
*
*   @property MD_DIMTYPE_CURRENCY
*   @static
*   @final
*   @type int
*   @default 11
*/
Xmla.Rowset.MD_DIMTYPE_CURRENCY = 11;
/**
*   A possible value for the <code>DIMENSION_TYPE</code> column that appears in the
*   <code>MDSCHEMA_DIMENSIONS</code> (See: <code><a href="Xmla.html#method_discoverMDDimensions">discoverMDDimensions()</a></code>) and
*   <code>MDSCHEMA_HIERARCHIES</code> (See: <code><a href="Xmla.html#method_discoverMDHierarchies">discoverMDHierarchies()</a></code>)rowsets.
*
*   @property MD_DIMTYPE_RATES
*   @static
*   @final
*   @type int
*   @default 12
*/
Xmla.Rowset.MD_DIMTYPE_RATES = 12;
/**
*   A possible value for the <code>DIMENSION_TYPE</code> column that appears in the
*   <code>MDSCHEMA_DIMENSIONS</code> (See: <code><a href="Xmla.html#method_discoverMDDimensions">discoverMDDimensions()</a></code>) and
*   <code>MDSCHEMA_HIERARCHIES</code> (See: <code><a href="Xmla.html#method_discoverMDHierarchies">discoverMDHierarchies()</a></code>)rowsets.
*
*   @property MD_DIMTYPE_CHANNEL
*   @static
*   @final
*   @type int
*   @default 13
*/
Xmla.Rowset.MD_DIMTYPE_CHANNEL = 13;
/**
*   A possible value for the <code>DIMENSION_TYPE</code> column that appears in the
*   <code>MDSCHEMA_DIMENSIONS</code> (See: <code><a href="Xmla.html#method_discoverMDDimensions">discoverMDDimensions()</a></code>) and
*   <code>MDSCHEMA_HIERARCHIES</code> (See: <code><a href="Xmla.html#method_discoverMDHierarchies">discoverMDHierarchies()</a></code>)rowsets.
*
*   @property MD_DIMTYPE_PROMOTION
*   @static
*   @final
*   @type int
*   @default 14
*/
Xmla.Rowset.MD_DIMTYPE_PROMOTION = 14;
/**
*   A possible value for the <code>DIMENSION_TYPE</code> column that appears in the
*   <code>MDSCHEMA_DIMENSIONS</code> (See: <code><a href="Xmla.html#method_discoverMDDimensions">discoverMDDimensions()</a></code>) and
*   <code>MDSCHEMA_HIERARCHIES</code> (See: <code><a href="Xmla.html#method_discoverMDHierarchies">discoverMDHierarchies()</a></code>)rowsets.
*
*   @property MD_DIMTYPE_ORGANIZATION
*   @static
*   @final
*   @type int
*   @default 15
*/
Xmla.Rowset.MD_DIMTYPE_ORGANIZATION = 15;
/**
*   A possible value for the <code>DIMENSION_TYPE</code> column that appears in the
*   <code>MDSCHEMA_DIMENSIONS</code> (See: <code><a href="Xmla.html#method_discoverMDDimensions">discoverMDDimensions()</a></code>) and
*   <code>MDSCHEMA_HIERARCHIES</code> (See: <code><a href="Xmla.html#method_discoverMDHierarchies">discoverMDHierarchies()</a></code>)rowsets.
*
*   @property MD_DIMTYPE_BILL_OF_MATERIALS
*   @static
*   @final
*   @type int
*   @default 16
*/
Xmla.Rowset.MD_DIMTYPE_BILL_OF_MATERIALS = 16;
/**
*   A possible value for the <code>DIMENSION_TYPE</code> column that appears in the
*   <code>MDSCHEMA_DIMENSIONS</code> (See: <code><a href="Xmla.html#method_discoverMDDimensions">discoverMDDimensions()</a></code>) and
*   <code>MDSCHEMA_HIERARCHIES</code> (See: <code><a href="Xmla.html#method_discoverMDHierarchies">discoverMDHierarchies()</a></code>)rowsets.
*
*   @property MD_DIMTYPE_GEOGRAPHY
*   @static
*   @final
*   @type int
*   @default 17
*/
Xmla.Rowset.MD_DIMTYPE_GEOGRAPHY = 17;

/**
*    A possible value for the <code>STRUCTURE</code> column of the
*   <code>MDSCHEMA_HIERARCHIES</code> (See: <code><a href="Xmla.html#method_discoverMDHierarchies">discoverMDHierarchies()</a></code>)rowset.
*    @property MD_STRUCTURE_FULLYBALANCED
*   @static
*   @final
*   @type int
*   @default 0
*/
Xmla.Rowset.MD_STRUCTURE_FULLYBALANCED = 0;
/**
*    A possible value for the <code>STRUCTURE</code> column of the
*   <code>MDSCHEMA_HIERARCHIES</code> (See: <code><a href="Xmla.html#method_discoverMDHierarchies">discoverMDHierarchies()</a></code>)rowset.
*    @property MD_STRUCTURE_RAGGEDBALANCED
*   @static
*   @final
*   @type int
*   @default 1
*/
Xmla.Rowset.MD_STRUCTURE_RAGGEDBALANCED = 1;
/**
*    A possible value for the <code>STRUCTURE</code> column of the
*   <code>MDSCHEMA_HIERARCHIES</code> (See: <code><a href="Xmla.html#method_discoverMDHierarchies">discoverMDHierarchies()</a></code>)rowset.
*    @property MD_STRUCTURE_UNBALANCED
*   @static
*   @final
*   @type int
*   @default 2
*/
Xmla.Rowset.MD_STRUCTURE_UNBALANCED = 2;
/**
*    A possible value for the <code>STRUCTURE</code> column of the
*   <code>MDSCHEMA_HIERARCHIES</code> (See: <code><a href="Xmla.html#method_discoverMDHierarchies">discoverMDHierarchies()</a></code>)rowset.
*    @property MD_STRUCTURE_NETWORK
*   @static
*   @final
*   @type int
*   @default 3
*/
Xmla.Rowset.MD_STRUCTURE_NETWORK = 3;

/**
*    A  bitmap value for the <code>HIERARCHY_ORIGIN</code> column of the
*   <code>MDSCHEMA_HIERARCHIES</code> (See: <code><a href="Xmla.html#method_discoverMDHierarchies">discoverMDHierarchies()</a></code>)rowset.
*    Identifies user defined hierarchies.
*    @property MD_USER_DEFINED
*   @static
*   @final
*   @type int
*   @default 1
*/
Xmla.Rowset.MD_USER_DEFINED = 1
/**
*    A  bitmap value for the <code>HIERARCHY_ORIGIN</code> column of the
*   <code>MDSCHEMA_HIERARCHIES</code> (See: <code><a href="Xmla.html#method_discoverMDHierarchies">discoverMDHierarchies()</a></code>)rowset.
*    identifies attribute hierarchies.
*    @property MD_SYSTEM_ENABLED
*   @static
*   @final
*   @type int
*   @default 2
*/
Xmla.Rowset.MD_SYSTEM_ENABLED = 2
/**
*    A  bitmap value for the <code>HIERARCHY_ORIGIN</code> column of the
*   <code>MDSCHEMA_HIERARCHIES</code> (See: <code><a href="Xmla.html#method_discoverMDHierarchies">discoverMDHierarchies()</a></code>)rowset.
*    identifies attributes with no attribute hierarchies.
*    @property MD_SYSTEM_INTERNAL
*   @static
*   @final
*   @type int
*   @default 4
*/
Xmla.Rowset.MD_SYSTEM_INTERNAL = 4

/**
*   A possible value for the <code>MEMBER_TYPE</code> column of the
*   <code>MDSCHEMA_MEMBERS</code> rowset (see: <code><a href="Xmla.html#method_discoverMDMembers">discoverMDMembers()</a></code>),
*   indicating a regular member.
*    @property MDMEMBER_TYPE_REGULAR
*   @static
*   @final
*   @type int
*   @default 1
*/
Xmla.Rowset.MDMEMBER_TYPE_REGULAR = 1;
/**
*   A possible value for the <code>MEMBER_TYPE</code> column of the
*   <code>MDSCHEMA_MEMBERS</code> rowset (see: <code><a href="Xmla.html#method_discoverMDMembers">discoverMDMembers()</a></code>),
*   indicating an all member.
*    @property MDMEMBER_TYPE_ALL
*   @static
*   @final
*   @type int
*   @default 2
*/
Xmla.Rowset.MDMEMBER_TYPE_ALL = 2;
/**
*   A possible value for the <code>MEMBER_TYPE</code> column of the
*   <code>MDSCHEMA_MEMBERS</code> rowset (see: <code><a href="Xmla.html#method_discoverMDMembers">discoverMDMembers()</a></code>),
*   indicating a formula member.
*    @property MDMEMBER_TYPE_FORMULA
*   @static
*   @final
*   @type int
*   @default 3
*/
Xmla.Rowset.MDMEMBER_TYPE_FORMULA = 3;
/**
*   A possible value for the <code>MEMBER_TYPE</code> column of the
*   <code>MDSCHEMA_MEMBERS</code> rowset (see: <code><a href="Xmla.html#method_discoverMDMembers">discoverMDMembers()</a></code>),
*   indicating a measure member.
*    @property MDMEMBER_TYPE_MEASURE
*   @static
*   @final
*   @type int
*   @default 4
*/
Xmla.Rowset.MDMEMBER_TYPE_MEASURE = 4;
/**
*   A possible value for the <code>MEMBER_TYPE</code> column of the
*   <code>MDSCHEMA_MEMBERS</code> rowset (see: <code><a href="Xmla.html#method_discoverMDMembers">discoverMDMembers()</a></code>),
*   indicating a member of unknown type
*    @property MDMEMBER_TYPE_UNKNOWN
*   @static
*   @final
*   @type int
*   @default 0
*/
Xmla.Rowset.MDMEMBER_TYPE_UNKNOWN = 0;

/**
*   A possible value for the <code>MEASURE_AGGREGATOR</code> column of the
*   <code>MDSCHEMA_MEASURES</code> rowset (see: <code><a href="Xmla.html#method_discoverMDMeasures">discoverMDMeasures()</a></code>),
*   identifies that the measure aggregates from SUM.
*   @property MDMEASURE_AGGR_SUM
*   @static
*   @final
*   @type int
*   @default 1
*/
Xmla.Rowset.MDMEASURE_AGGR_SUM = 1;
/**
*   A possible value for the <code>MEASURE_AGGREGATOR</code> column of the
*   <code>MDSCHEMA_MEASURES</code> rowset (see: <code><a href="Xmla.html#method_discoverMDMeasures">discoverMDMeasures()</a></code>),
*   identifies that the measure aggregates from COUNT.
*   @property MDMEASURE_AGGR_COUNT
*   @static
*   @final
*   @type int
*   @default 2
*/
Xmla.Rowset.MDMEASURE_AGGR_COUNT = 2;
/**
*   A possible value for the <code>MEASURE_AGGREGATOR</code> column of the
*   <code>MDSCHEMA_MEASURES</code> rowset (see: <code><a href="Xmla.html#method_discoverMDMeasures">discoverMDMeasures()</a></code>),
*   identifies that the measure aggregates from MIN.
*   @property MDMEASURE_AGGR_MIN
*   @static
*   @final
*   @type int
*   @default 3
*/
Xmla.Rowset.MDMEASURE_AGGR_MIN = 3;
/**
*   A possible value for the <code>MEASURE_AGGREGATOR</code> column of the
*   <code>MDSCHEMA_MEASURES</code> rowset (see: <code><a href="Xmla.html#method_discoverMDMeasures">discoverMDMeasures()</a></code>),
*   identifies that the measure aggregates from MAX.
*   @property MDMEASURE_AGGR_MAX
*   @static
*   @final
*   @type int
*   @default 4
*/
Xmla.Rowset.MDMEASURE_AGGR_MAX = 4;
/**
*   A possible value for the <code>MEASURE_AGGREGATOR</code> column of the
*   <code>MDSCHEMA_MEASURES</code> rowset (see: <code><a href="Xmla.html#method_discoverMDMeasures">discoverMDMeasures()</a></code>),
*   identifies that the measure aggregates from AVG.
*   @property MDMEASURE_AGGR_AVG
*   @static
*   @final
*   @type int
*   @default 5
*/
Xmla.Rowset.MDMEASURE_AGGR_AVG = 5;
/**
*   A possible value for the <code>MEASURE_AGGREGATOR</code> column of the
*   <code>MDSCHEMA_MEASURES</code> rowset (see: <code><a href="Xmla.html#method_discoverMDMeasures">discoverMDMeasures()</a></code>),
*   identifies that the measure aggregates from VAR.
*   @property MDMEASURE_AGGR_VAR
*   @static
*   @final
*   @type int
*   @default 6
*/
Xmla.Rowset.MDMEASURE_AGGR_VAR = 6;
/**
*   A possible value for the <code>MEASURE_AGGREGATOR</code> column of the
*   <code>MDSCHEMA_MEASURES</code> rowset (see: <code><a href="Xmla.html#method_discoverMDMeasures">discoverMDMeasures()</a></code>),
*   identifies that the measure aggregates from STDEV.
*   @property MDMEASURE_AGGR_STD
*   @static
*   @final
*   @type int
*   @default 7
*/
Xmla.Rowset.MDMEASURE_AGGR_STD = 7;
/**
*   A possible value for the <code>MEASURE_AGGREGATOR</code> column of the
*   <code>MDSCHEMA_MEASURES</code> rowset (see: <code><a href="Xmla.html#method_discoverMDMeasures">discoverMDMeasures()</a></code>),
*   identifies that the measure aggregates from DISTINCT COUNT.
*   @property MDMEASURE_AGGR_DST
*   @static
*   @final
*   @type int
*   @default 8
*/
Xmla.Rowset.MDMEASURE_AGGR_DST = 8;
/**
*   A possible value for the <code>MEASURE_AGGREGATOR</code> column of the
*   <code>MDSCHEMA_MEASURES</code> rowset (see: <code><a href="Xmla.html#method_discoverMDMeasures">discoverMDMeasures()</a></code>),
*   identifies that the measure aggregates from NONE.
*   @property MDMEASURE_AGGR_NONE
*   @static
*   @final
*   @type int
*   @default 9
*/
Xmla.Rowset.MDMEASURE_AGGR_NONE = 9;
/**
*   A possible value for the <code>MEASURE_AGGREGATOR</code> column of the
*   <code>MDSCHEMA_MEASURES</code> rowset (see: <code><a href="Xmla.html#method_discoverMDMeasures">discoverMDMeasures()</a></code>),
*   identifies that the measure aggregates from AVERAGEOFCHILDREN.
*   @property MDMEASURE_AGGR_AVGCHILDREN
*   @static
*   @final
*   @type int
*   @default 10
*/
Xmla.Rowset.MDMEASURE_AGGR_AVGCHILDREN = 10;
/**
*   A possible value for the <code>MEASURE_AGGREGATOR</code> column of the
*   <code>MDSCHEMA_MEASURES</code> rowset (see: <code><a href="Xmla.html#method_discoverMDMeasures">discoverMDMeasures()</a></code>),
*   identifies that the measure aggregates from FIRSTCHILD.
*   @property MDMEASURE_AGGR_FIRSTCHILD
*   @static
*   @final
*   @type int
*   @default 11
*/
Xmla.Rowset.MDMEASURE_AGGR_FIRSTCHILD = 11;
/**
*   A possible value for the <code>MEASURE_AGGREGATOR</code> column of the
*   <code>MDSCHEMA_MEASURES</code> rowset (see: <code><a href="Xmla.html#method_discoverMDMeasures">discoverMDMeasures()</a></code>),
*   identifies that the measure aggregates from LASTCHILD.
*   @property MDMEASURE_AGGR_LASTCHILD
*   @static
*   @final
*   @type int
*   @default 12
*/
Xmla.Rowset.MDMEASURE_AGGR_LASTCHILD = 12;
/**
*   A possible value for the <code>MEASURE_AGGREGATOR</code> column of the
*   <code>MDSCHEMA_MEASURES</code> rowset (see: <code><a href="Xmla.html#method_discoverMDMeasures">discoverMDMeasures()</a></code>),
*   identifies that the measure aggregates from FIRSTNONEMPTY.
*   @property MDMEASURE_AGGR_FIRSTNONEMPTY
*   @static
*   @final
*   @type int
*   @default 13
*/
Xmla.Rowset.MDMEASURE_AGGR_FIRSTNONEMPTY = 13;
/**
*   A possible value for the <code>MEASURE_AGGREGATOR</code> column of the
*   <code>MDSCHEMA_MEASURES</code> rowset (see: <code><a href="Xmla.html#method_discoverMDMeasures">discoverMDMeasures()</a></code>),
*   identifies that the measure aggregates from LASTNONEMPTY.
*   @property MDMEASURE_AGGR_LASTNONEMPTY
*   @static
*   @final
*   @type int
*   @default 14
*/
Xmla.Rowset.MDMEASURE_AGGR_LASTNONEMPTY = 14;
/**
*   A possible value for the <code>MEASURE_AGGREGATOR</code> column of the
*   <code>MDSCHEMA_MEASURES</code> rowset (see: <code><a href="Xmla.html#method_discoverMDMeasures">discoverMDMeasures()</a></code>),
*   identifies that the measure aggregates from BYACCOUNT.
*   @property MDMEASURE_AGGR_BYACCOUNT
*   @static
*   @final
*   @type int
*   @default 15
*/
Xmla.Rowset.MDMEASURE_AGGR_BYACCOUNT = 15;
/**
*   A possible value for the <code>MEASURE_AGGREGATOR</code> column of the
*   <code>MDSCHEMA_MEASURES</code> rowset (see: <code><a href="Xmla.html#method_discoverMDMeasures">discoverMDMeasures()</a></code>),
*    identifies that the measure was derived from a formula that was not any single function above.
*   @property MDMEASURE_AGGR_CALCULATED
*   @static
*   @final
*   @type int
*   @default 127
*/
Xmla.Rowset.MDMEASURE_AGGR_CALCULATED = 127;
/**
*   A possible value for the <code>MEASURE_AGGREGATOR</code> column of the
*   <code>MDSCHEMA_MEASURES</code> rowset (see: <code><a href="Xmla.html#method_discoverMDMeasures">discoverMDMeasures()</a></code>),
*    identifies that the measure was derived from an unknown aggregation function or formula.
*   @property MDMEASURE_AGGR_UNKNOWN
*   @static
*   @final
*   @type int
*   @default 0
*/
Xmla.Rowset.MDMEASURE_AGGR_UNKNOWN = 0;

/**
*   Field in the bitmap value of <code>PROPERTY_TYPE</code> column of the <code>MDSCHEMA_PROPERTIES</code> rowset.
*   see: https://msdn.microsoft.com/en-us/library/ms126309.aspx
*   Identifies a property of a member.
*   If set it means this property can be used in the DIMENSION PROPERTIES clause of the SELECT statement.
*   @property MDPROP_MEMBER
*   @static
*   @final
*   @type int
*   @default 1
*/
Xmla.Rowset.MDPROP_MEMBER = 1;
/**
*   Field in the bitmap value of <code>PROPERTY_TYPE</code> column of the <code>MDSCHEMA_PROPERTIES</code> rowset.
*   see: https://msdn.microsoft.com/en-us/library/ms126309.aspx
*   Identifies a property of a cell.
*   If set, it means this property can be used in the CELL PROPERTIES clause that occurs at the end of the SELECT statement.
*   @property MDPROP_CELL
*   @static
*   @final
*   @type int
*   @default 2
*/
Xmla.Rowset.MDPROP_CELL = 2;
/**
*   Field in the bitmap value of <code>PROPERTY_TYPE</code> column of the <code>MDSCHEMA_PROPERTIES</code> rowset.
*   see: https://msdn.microsoft.com/en-us/library/ms126309.aspx
*   Identifies an internal property.
*   @property MDPROP_SYSTEM
*   @static
*   @final
*   @type int
*   @default 4
*/
Xmla.Rowset.MDPROP_SYSTEM = 4;
/**
*   Field in the bitmap value of <code>PROPERTY_TYPE</code> column of the <code>MDSCHEMA_PROPERTIES</code> rowset.
*   see: https://msdn.microsoft.com/en-us/library/ms126309.aspx
*   Identifies an internal property.
*   @property MDPROP_BLOB
*   @static
*   @final
*   @type int
*   @default 8
*/
Xmla.Rowset.MDPROP_BLOB = 8;

Xmla.Rowset.KEYS = {};
Xmla.Rowset.KEYS[Xmla.DBSCHEMA_CATALOGS] = ["CATALOG_NAME"];
Xmla.Rowset.KEYS[Xmla.DBSCHEMA_COLUMNS] = ["TABLE_CATALOG", "TABLE_SCHEMA", "TABLE_NAME", "COLUMN_NAME"];
Xmla.Rowset.KEYS[Xmla.DBSCHEMA_PROVIDER_TYPES] = ["TYPE_NAME"];
Xmla.Rowset.KEYS[Xmla.DBSCHEMA_SCHEMATA] = ["CATALOG_NAME", "SCHEMA_NAME"];
Xmla.Rowset.KEYS[Xmla.DBSCHEMA_TABLES] = ["TABLE_CATALOG", "TABLE_SCHEMA", "TABLE_NAME"];
Xmla.Rowset.KEYS[Xmla.DBSCHEMA_TABLES_INFO] = ["TABLE_CATALOG", "TABLE_SCHEMA", "TABLE_NAME"];
Xmla.Rowset.KEYS[Xmla.DISCOVER_DATASOURCES] = ["DataSourceName"];
Xmla.Rowset.KEYS[Xmla.DISCOVER_ENUMERATORS] = ["EnumName", "ElementName"];
Xmla.Rowset.KEYS[Xmla.DISCOVER_KEYWORDS] = ["Keyword"];
Xmla.Rowset.KEYS[Xmla.DISCOVER_LITERALS] = ["LiteralName"];
Xmla.Rowset.KEYS[Xmla.DISCOVER_PROPERTIES] = ["PropertyName"];
Xmla.Rowset.KEYS[Xmla.DISCOVER_SCHEMA_ROWSETS] = ["SchemaName"];
Xmla.Rowset.KEYS[Xmla.MDSCHEMA_ACTIONS] = ["CATALOG_NAME", "SCHEMA_NAME", "CUBE_NAME", "ACTION_NAME"];
Xmla.Rowset.KEYS[Xmla.MDSCHEMA_CUBES] = ["CATALOG_NAME", "SCHEMA_NAME", "CUBE_NAME"];
Xmla.Rowset.KEYS[Xmla.MDSCHEMA_DIMENSIONS] = ["CATALOG_NAME", "SCHEMA_NAME", "CUBE_NAME", "DIMENSION_UNIQUE_NAME"];
Xmla.Rowset.KEYS[Xmla.MDSCHEMA_FUNCTIONS] = ["FUNCTION_NAME", "PARAMETER_LIST"];
Xmla.Rowset.KEYS[Xmla.MDSCHEMA_HIERARCHIES] = ["CATALOG_NAME", "SCHEMA_NAME", "CUBE_NAME", "DIMENSION_UNIQUE_NAME", "HIERARCHY_UNIQUE_NAME"];
Xmla.Rowset.KEYS[Xmla.MDSCHEMA_LEVELS] = ["CATALOG_NAME", "SCHEMA_NAME", "CUBE_NAME", "DIMENSION_UNIQUE_NAME", "HIERARCHY_UNIQUE_NAME", "LEVEL_UNIQUE_NAME"];
Xmla.Rowset.KEYS[Xmla.MDSCHEMA_MEASURES] = ["CATALOG_NAME", "SCHEMA_NAME", "CUBE_NAME", "MEASURE_NAME"];
Xmla.Rowset.KEYS[Xmla.MDSCHEMA_MEMBERS] = ["CATALOG_NAME", "SCHEMA_NAME", "CUBE_NAME", "DIMENSION_UNIQUE_NAME", "HIERARCHY_UNIQUE_NAME", "LEVEL_UNIQUE_NAME", "MEMBER_UNIQUE_NAME"];
Xmla.Rowset.KEYS[Xmla.MDSCHEMA_PROPERTIES] = ["CATALOG_NAME", "SCHEMA_NAME", "CUBE_NAME", "DIMENSION_UNIQUE_NAME", "HIERARCHY_UNIQUE_NAME", "LEVEL_UNIQUE_NAME", "MEMBER_UNIQUE_NAME", "PROPERTY_NAME"];
Xmla.Rowset.KEYS[Xmla.MDSCHEMA_SETS] = ["CATALOG_NAME", "SCHEMA_NAME", "CUBE_NAME", "SET_NAME"];


function _boolConverter(val){
    return val==="true"?true:false;
}
_boolConverter.jsType = "boolean";

function _intConverter(val){
    return parseInt(val, 10);
}
_intConverter.jsType = "number";

function _floatConverter(val){
    return parseFloat(val, 10);
}
_floatConverter.jsType = "number";

function _textConverter (val){
    return val;
}
_textConverter.jsType = "string";

function _dateTimeConverter (val){
    return Date.parse(val);
}
_dateTimeConverter.jsType = "object";

function _restrictionsConverter(val){
    return val;
}
_restrictionsConverter.jsType = "object";

function _arrayConverter(nodes, valueConverter){
    var arr = [],
        n = nodes.length,
        i, node
    ;
    for (i = 0; i < n; i++){
        node = nodes[i];
        arr.push(valueConverter(_getElementText(node)));
    }
    return arr;
}
_arrayConverter.jsType = "object";

var _typeConverterMap = {
    "xsd:boolean": _boolConverter,
    "xsd:decimal": _floatConverter,
    "xsd:double": _floatConverter,
    "xsd:float": _floatConverter,
    "xsd:int": _intConverter,
    "xsd:integer": _intConverter,
    "xsd:nonPositiveInteger": _intConverter,
    "xsd:negativeInteger": _intConverter,
    "xsd:nonNegativeInteger": _intConverter,
    "xsd:positiveInteger": _intConverter,
    "xsd:short": _intConverter,
    "xsd:byte": _intConverter,
    "xsd:long": _intConverter,
    "xsd:unsignedLong": _intConverter,
    "xsd:unsignedInt": _intConverter,
    "xsd:unsignedShort": _intConverter,
    "xsd:unsignedByte": _intConverter,
    "xsd:string": _textConverter,
    "xsd:dateTime": _dateTimeConverter,
    "Restrictions": _restrictionsConverter
}

function _getValueConverter(type){
    var func;
    return (func = _typeConverterMap[type]) ? func : _textConverter;
}

function _getElementValue(el) {
    var txt = _getElementText(el),
        type = _getAttributeNS(el, _xmlnsSchemaInstance, _xmlnsSchemaInstancePrefix, "type"),
        converter
        ;
    if (type){
        converter = _typeConverterMap[type];
        if (converter){
            return converter(txt);
        }
    }
    return txt;
}

function _getterNameForColumnName(columnName){
    //sample: _getterNameForColumnName("DBLITERAL_CATALOG_NAME") returns "getDbLiteralCatalogName"
    return "get" +
           (/^[A-Z]+[a-z]+[A-Za-z]*$/g.test(columnName) ? columnName :
                columnName.charAt(0).toUpperCase() +
                columnName.substr(1).toLowerCase().replace(
                    /_[a-z]/g,
                    function(a){
                        return a.charAt(1).toUpperCase();
                    }
                )
           );
}

Xmla.Rowset.prototype = {
    _node:  null,
    _type: null,
    _row: null,
    _rows: null,
    numRows: null,
    fieldOrder: null,
    fields: null,
    _fieldCount: null,
    _initData: function(){
        this._rows = _getElementsByTagNameNS(this._node, _xmlnsRowset, null, "row");
        this.numRows = this._rows? this._rows.length : 0;
        this.reset();
        this.fieldOrder = [];
        this.fields = {};
        this._fieldCount = 0;
        var rowSchema = _getComplexType(this._node, "row");
        if (rowSchema){
            var seq = _getElementsByTagNameNS(rowSchema, _xmlnsSchema, _xmlnsSchemaPrefix, "sequence")[0],
                seqChildren = seq.childNodes, numChildren = seqChildren ? seqChildren.length : 0, seqChild,
                fieldLabel, fieldName, minOccurs, maxOccurs, type, valueConverter, getter,
                addFieldGetters = this._xmla.options.addFieldGetters, i, val;
            for (i = 0; i < numChildren; i++){
                seqChild = seqChildren[i];
                if (seqChild.nodeType !== 1) continue;
                fieldLabel = _getAttributeNS(seqChild, _xmlnsSQL, _xmlnsSQLPrefix, "field");
                fieldName = _getAttribute(seqChild, "name");
                type = _getAttribute(seqChild, "type");   //get the type from the xsd
                if (type===null && this._row) {           //bummer, not defined there try to get it from xsi:type in the row
                    val = _getElementsByTagName(this._row, fieldName);
                    if (val.length){
                        type = _getAttributeNS(
                            val[0],
                            _xmlnsSchemaInstance,
                            _xmlnsSchemaInstancePrefix,
                            "type"
                        );
                    }
                }
                if (!type &&
                    this._type==Xmla.DISCOVER_SCHEMA_ROWSETS &&
                    fieldName==="Restrictions"
                ) type = "Restrictions";
                minOccurs = _getAttribute(seqChild, "minOccurs");
                if (minOccurs) {
                  minOccurs = parseInt(minOccurs, 10);
                }
                else {
                  minOccurs = 1;
                }
                maxOccurs = _getAttribute(seqChild, "maxOccurs");
                if (maxOccurs) {
                    if (maxOccurs === "unbounded") {
                      maxOccurs = Infinity;
                    }
                    else {
                      minOccurs=parseInt(maxOccurs,10);
                    }
                }
                else {
                  maxOccurs = 1;
                }
                valueConverter = _getValueConverter(type);
                getter = this._createFieldGetter(fieldName, valueConverter, minOccurs, maxOccurs);
                if (addFieldGetters) {
                  this[_getterNameForColumnName(fieldName)] = getter;
                }
                this.fields[fieldLabel] = {
                    name: fieldName,
                    label: fieldLabel,
                    index: this._fieldCount++,
                    type: type,
                    jsType: valueConverter.jsType,
                    minOccurs: minOccurs,
                    maxOccurs: maxOccurs,
                    getter: getter
                };
                this.fieldOrder.push(fieldLabel);
            }
        }
        else {
            Xmla.Exception._newError(
                "ERROR_PARSING_RESPONSE",
                "Xmla.Rowset",
                this._node
            )._throw();
        }
    },
    _createFieldGetter: function(fieldName, valueConverter, minOccurs, maxOccurs){
        var getter;
        if (maxOccurs===1) {
            if(minOccurs===1)
                getter = function(){
                    var els = _getElementsByTagNameNS (this._row, _xmlnsRowset, null, fieldName);
                    if (els.length) {
                      return valueConverter(_getElementText(els[0]));
                    }
                    else {
                      //SAP doesn't know how to send XML that is valid according to their XML Schema
                      if (!_isUnd(console.error)) {
                        console.error("Field \"" + fieldName + "\" is supposed to be present in the rowset but isn't. Are you running on SAP / HANA?");
                      }
                      return null;
                    }
                };
            else
            if (minOccurs === 0)
                getter = function(){
                    var els = _getElementsByTagNameNS (this._row, _xmlnsRowset, null, fieldName);
                    if (els.length) {
                        return valueConverter(_getElementText(els[0]));
                    }
                    else {
                        return null;
                    }
                };
        }
        else
        if(minOccurs === 1)
            getter = function(){
                var els = _getElementsByTagNameNS (this._row, _xmlnsRowset, null, fieldName);
                return _arrayConverter(els, valueConverter);
            };
        else
        if (minOccurs === 0)
            getter = function(){
                var els = _getElementsByTagNameNS (this._row, _xmlnsRowset, null, fieldName);
                if (els.length) {
                    return _arrayConverter(els, valueConverter);
                }
                else {
                    return null;
                }
            };
        return getter;
    },
/**
*   Indicates the type of rowset. In most cases, this will be identical to the <code>requestType</code> value that was used in the
*   <code>Discover</code> request
*
*   @method getType
*   @return <code>int</code> One of the <code>DISCOVER_XXX</code>, <code>DBSCHEMA_XXX</code> or <code>MDSCHEMA_XXX</code> constants
*/
    getType: function(){
        return this._type;
    },
/**
*   Retrieve an array of <code>fieldDef</code> objects that describes the fields of the rows in this rowset.
*   The position of the <code>fieldDef</code> objects in the array corresponds to the column order of the rowset.
*   For a description of the <code>fieldDef</code> object, see the
*   <code><a href="#method_fieldDef">fieldDef()</a></code> method.
*
*   @method getFields
*   @return {[fieldDef]} An (ordered) array of field definition objects.
*/
    getFields: function(){
        var f = [],
            i, n = this._fieldCount,
            fieldOrder = this.fieldOrder
        ;
        for (i = 0; i < n; i++) f[i] = this.fieldDef(fieldOrder[i]);
        return f;
    },
/**
*   Retrieve an array of field names.
*   The position of the names in the array corresponds to the column order of the rowset.
*
*   @method getFieldNames
*   @return {[string]} An (ordered) array of field names.
*/
    getFieldNames: function(){
        var fieldNames = [], i, n = this._fieldCount;
        for (i = 0; i < n; i++) fieldNames[i] = this.fieldOrder[i];
        return fieldNames;
    },
/**
*   Indicates wheter the rowset can still be traversed.
*   You can use this method together with the
*   <code><a href="#method_nextRow">nextRow()</a></code> method
*   to drive a <code>while</code> loop to traverse all rows in the rowset, like so:
    <pre>
&nbsp;while(rowset.hasMoreRows()){
&nbsp;    ...process row...
&nbsp;    rowsete.nextRow();
&nbsp;}
    </pre>
*   @method hasMoreRows
*   @return {bool} true in case there are more rows to traverse. false if all rows have been traversed.
*/
    hasMoreRows: function(){
        return this.numRows > this.rowIndex;
    },
/**
*   Moves the internal row index to the next row.
*   You can use this method together with the
*   <code><a href="#method_next">hasMoreRows()</a></code> method
*   to drive a <code>while</code> loop to traverse all rows in the rowset.
*
*   @method nextRow
*/
    nextRow: function(){
        this.rowIndex++;
        this._row = this._rows[this.rowIndex];
        return this.rowIndex;
    },
/**
*   This method is deprecated and may be removed in the future.
*   Use <code><a href="#method_nextRow">nextRow()</a></code> instead.
*   @method next
*/
    next: function(){
        return this.nextRow();
    },
/**
*   <p>Walks through all rows, and calls the callback function for each row.</p>
*
*   <p>The callback function gets passed an object that represents the row.
*   The keys of the row object are the column names, and the values are the respective column values.</p>
*   <p>The scope for calling the callback can be passed  as the second argument to this method.
*   If the scope is not defined (or if it is <code>null</code>), the Rowset's <code>this</code> pointer is used instead.</p>
*   <p>You can pass additional data to the callback by passing in a third argument. This is then passed as is as second argument to the callback.</p>
*
*   <p>The <code>eachRow</code> method will iterate untill the callback returns <code>false</code>, or until all rows have been traversed.
*   If the callback returns <code>false</code>, iteration is aborted and <code>eachRow</code> as a whole returns <code>false</code> too.
*   If iteration is not aborted, then eachRow returns <code>true</code>.</p>
*
*   @method eachRow
*   @param {function()} callback Function to be called for each row.
*   @param {Object} scope Optional. Scope in which the callback is called. Defaults to this, that is, the Rowset.
*   @param {Object} args Optional. Object that is passed as extra argument to the callback.
*   @return {bool} true if all rows were itereated. If the callback returns false, iteration stops and false is returned.
*/
    eachRow: function(rowCallback, scope, args){
        if (_isUnd(scope)) scope = this;
        var mArgs = [null];
        if (!_isUnd(args)) {
            if (!_isArr(args)) args = [args];
            mArgs = mArgs.concat(args);
        }
        while (this.hasMoreRows()){
            mArgs[0] = this.readAsObject();
            if (rowCallback.apply(scope, mArgs)===false) return false;
            this.nextRow();
        }
        return true;
    },
/**
*   Gets the value of the internal row index.
*   Note that no check is performed to ensure this points to a valid row:
*   you should call this function only when it is safe to do so.
*   This can be determined by calling <code><a href="method_hasMoreRows">hasMoreRows()</a></code>.
*
*   @method curr
*   @return int
*/
    currRow: function(){
        return this.rowIndex;
    },
/**
*   Returns the number of rows in the set.
*
*   @method rowCount
*   @return int
*/
    rowCount: function(){
        return this.numRows;
    },
/**
*   Resets the internal row pointer so the resultset can be traversed again.
*
*   @method reset
*/
    reset: function(){
        this.rowIndex = 0;
        this._row = (this.hasMoreRows()) ? this._rows[this.rowIndex] : null;
    },
/**
*   Retrieves a <code>fieldDef</code> object by name.
*   A fieldDef describes a field (column). It has the following properties:
*   <dl>
*       <dt>label</dt><dd>string. This is the human readable name for this field. You should use this name for display purposes and for building restrictions. This is also the name used for matching againstt the <code>name</code> argument passed to the <code>fieldDef()</code> method.</dd>
*       <dt>name</dt><dd>string. This is the (possibly escaped) name of the field as it appears in the XML document</dd>
*       <dt>index</dt><dd>int. The ordinal position of this field. Fields are numbered starting from 0.</dd>
*       <dt>type</dt><dd>string. The name of the XML data type for the values that appear in this column</dd>
*       <dt>minOccurs</dt><dd>string. The minimal number of occurrences of a value. "0" means the field is optional.</dd>
*       <dt>maxOccurs</dt><dd>string. If this is parseable as an integer, that integer specifies the number of times a value can appear in this column. "unbounded" means there is no declared limit.</dd>
*       <dt>getter</dt><dd>function. This function is used to extract a value from the XML document for this field.</dd>
*   </dl>
*   @method fieldDef
*   @param {string} name The name of the field to retrieve.
*   @return {fieldDef} The <code>fieldDef</code> object that matches the argument.
*/
    fieldDef: function(name){
        var field = this.fields[name];
        if (!field)
            Xmla.Exception._newError(
                "INVALID_FIELD",
                "Xmla.Rowset.fieldDef",
                name
            )._throw();
        return field;
    },
/**
*   Retrieves the index of a field by name.
*   Field indexes start at 0.
*   @method fieldIndex
*   @param {string} name The name of the field for which you want to retrieve the index.
*   @return {int} The ordinal position (starting at 0) of the field that matches the argument.
*/
    fieldIndex: function(name){
        return this.fieldDef(name).index;
    },
/**
*   Retrieves the name of a field by field Index.
*   Field indexes start at 0.
*   @method fieldName
*   @param {string} name The name of the field for which you want to retrieve the index.
*   @return {int} The ordinal position (starting at 0) of the field that matches the argument.
*/
    fieldName: function(index){
        var fieldName = this.fieldOrder[index];
        if (!fieldName)
            Xmla.Exception._newError(
                "INVALID_FIELD",
                "Xmla.Rowset.fieldDef",
                index
            )._throw();
        return fieldName;
    },
/**
*   Retrieves a value from the current row for the field having the name specified by the argument.
*   @method fieldVal
*   @param {string | int} name The name or the index of the field for which you want to retrieve the value.
*   @return {array|boolean|float|int|string} From the current row, the value of the field that matches the argument.
*/
    fieldVal: function(name){
        if (_isNum(name)) name = this.fieldName(name);
        return this.fieldDef(name).getter.call(this);
    },
/**
*   Returns the number of fields in this rowset.
*   @method fieldCount
*   @return {int} The number of fields in this rowset.
*/
    fieldCount: function(){
        return this._fieldCount;
    },
/**
*   Releases references to the DomDocument passed to the Rowset constructor.
*   This should facilitate automatic garbage collection by the browser.
*   @method close
*/
    close: function(){
        this._node = null;
        this._row = null;
        this._rows = null;
    },
/**
*   Reads the current row and returns the result as a new array.
*   This method does not advance the internal row pointer, and does not check if there is a valid row.
*   This method exists mainly as a convience in case you want to use a custom way to extract data from the resultset using the
*   <code><a href="#method_fetchCustom">fetchCustom()</a></code> method.
*   If you just want to obtain the results as arrays, see
*   <code><a href="#method_fetchAsArray">fetchAsArray()</a></code>
*   and
*   <code><a href="#method_fetchAllAsArray">fetchAllAsArray()</a></code>.
*   @method readAsArray
*   @return {array}
*/
    readAsArray: function(array){
        var fields = this.fields, fieldName, fieldDef;
        if (!array) array = [];
        for (fieldName in fields){
            if (fields.hasOwnProperty(fieldName)){
                fieldDef = fields[fieldName];
                array[fieldDef.index] = fieldDef.getter.call(this);
            }
        }
        return array;
    },
/**
*   Fetch all values from all fields from the current row, and return it in an array.
*   The position of the values in the array corresponds to the column order of the rowset.
*   The internal row pointer is also increased so the next call will read the next row.
*   The method returns false when there are no more rows to traverse.
*   You can use this method to drive a loop to travere all rows in the Rowset:
<pre>
while (rowArray = rowset.fetchAsArray()){
&nbsp;   ...process array...
}
</pre>
*   @method fetchAsArray
*   @return {array}
*/
    fetchAsArray: function(array){
        if (this.hasMoreRows()) {
            array = this.readAsArray(array);
            this.nextRow();
        }
        else array = false;
        return array;
    },
/**
*   Reads the current row and returns the result as a new object.
*   This method does not advance the internal row pointer, and does not check if there is a valid row.
*   This method exists mainly as a convience in case you want to use a custom way to extract data from the resultset using the
*   <code><a href="#method_fetchCustom">fetchCustom()</a></code> method.
*   If you just want to obtain the results as objects, see
*   <code><a href="#method_fetchAsObject">fetchAsObject()</a></code>
*   and
*   <code><a href="#method_fetchAllAsObject">fetchAllAsObject()</a></code>.
*   @method readAsObject
*   @return {object}
*/
    readAsObject: function(object){
        var fields = this.fields, fieldName, fieldDef;
        if (!object) object = {};
        for (fieldName in fields) {
            if (fields.hasOwnProperty(fieldName)) {
                fieldDef = fields[fieldName];
                object[fieldName] = fieldDef.getter.call(this);
            }
        }
        return object;
    },
/**
*   Fetch all values from all fields from the current row, and return it in an Object literal.
*   The property names of the returned object correspond to the fieldName (actually the fieldLabel), and the field value is assigned to its respective property.
*   The internal row pointer is also increased so the next call will read the next row.
*   The method returns false when there are no more rows to traverse.
*   You can use this method to drive a loop to travere all rows in the Rowset:
<pre>
while (rowObject = rowset.fetchAsObject()){
&nbsp;   ...process object...
}
</pre>
*   @method fetchAsObject
*   @return {Object|boolean}
*/
    fetchAsObject: function(object){
        if (this.hasMoreRows()){
            object = this.readAsObject(object);
            this.nextRow();
        }
        else object = false;
        return object;
    },
/**
*   Fetch the values using a custom callback function.
*   If there are rows to fetch, the custom function is called in scope of the rowset, so you can use <code>this</code> inside the custom function to refer to the rowset object.
*   Then, the internal row pointer is increased so the next call will read the next row.
*   The method returns whatever object or value is returned by the custom function, or false when there are no more rows to traverse.
*
*   @method fetchCustom
*   @param func {function} a custom function to extract and return the data from the current row of the xml result.
*   @param args {object} an object that will be passed to the function. Useful to hold any data required in addition to the rowset itself (which can be referred to as this inside the function).
*   @return {mixed|boolean}
*/
    fetchCustom: function(func, args){
        var object;
        if (this.hasMoreRows()){
            object = func.call(this, args);
            this.nextRow();
        }
        else object = false;
        return object;
    },
/**
*   Fetch all values from all fields from all rows, and return it as an array of arrays.
*   See <code><a href="#method_fetchAsArray">fetchAsArray()</a></code>.
*   @method fetchAllAsArray
*   @param rows {array[]} OPTIONAL. An array to append the rows to. If not specified, a new array is created
*   @return {array}
*/
    fetchAllAsArray: function(rows){
        var row;
        if (!rows) rows = [];
        while((row = this.fetchAsArray())) rows.push(row);
        return rows;
    },
/**
*   Fetch all values from all fields from all rows, and return it as an array of objects.
*   See <code><a href="#method_fetchAsObject">fetchAsObject()</a></code>.
*   @method fetchAllAsObject
*   @param rows {array[]} OPTIONAL. An array to append the rows to. If not specified, a new array is created
*   @return {array}
*/
    fetchAllAsObject: function(rows){
        var row;
        if (!rows) rows = [];
        while((row = this.fetchAsObject())) rows.push(row);
        return rows;
    },
/**
*   Fetch all rows using a custom function, and return the return values as an array.
*   See <code><a href="#method_fetchCustom">fetchCustom()</a></code>.
*   @method fetchAllCustom
*   @param rows {array[]} OPTIONAL. An array to append the rows to. If not specified, a new array is created
*   @param func {function} a callback function to extract the fields.
*   @param args {object} an object to pass data to the callback.
*   @return {array}
*/
    fetchAllCustom: function(rows, func, args){
        var row;
        if (!rows) rows = [];
        while((row = this.fetchCustom(func, args))) rows.push(row);
        return rows;
    },
/**
*   Fetch all row as an object, store it in nested objects according to values in the column identified by the key argument.
*   This method should typically not be called directly, rather it is a helper method for <code><a href="#method_mapAllAsObject">mapAllAsObject()</a></code>.
*
*   @method mapAsObject
*   @param map
*   @param key
*   @param row
*   @return {object} a tree using column values as branch names, and storing a row or an array of rows at the leaves.
*/
    mapAsObject: function(map, key, row){
        var k, v, p, i, len = key.length, last = len - 1, m = map;
        for (i = 0; i < len; i++){
            k = key[i]; //get the keypart
            v = row[k]; //get the value for the key part
            p = m[v];   //get the property from the map for this keypart.
            if (p) {
                if (i === last) {   //last, we need to store the row now.
                    if (_isArr(p)) p.push(row); //already entries here, append
                    else m[v] = [p, row]; //single row store here. since we need multiple rows, add an array
                }
                else m = p;
            }
            else                        //property didnt exist for this key yet.
            if (i === last) m[v] = row; //last keypart: store the row here
            else m = m[v] = {};         //more keyparts to go: add a new map for this keypart
        }
    },
/**
*   Fetch all rows as an object, store them as proprties in an object (which acts as map).
*   @method mapAllAsObject
*   @param key {string|array} OPTIONAL. A column name or an array of column names that will be used to generate property names for the map. If not specified, the default key is used. If there is no default key, all column names will be used.
*   @param map {object} OPTIONAL. The object that is used as map. Rows are added as properties to this map. If not specified, a new object is created
*   @return {object}
*/
    mapAllAsObject: function(key, map){
        if (!map) map = {};
        if (!key) key = this.getKey();
        var row;
        while (row = this.fetchAsObject()) this.mapAsObject(map, key, row);
        return map;
    },

/*
*   Find a key for the resultset type.
*/
    getKey: function(){
        return (this._type) ? Xmla.Rowset.KEYS[this._type] : this.getFieldNames();
    }
};

/**
*   <p>
*   This class implements an XML/A multidimensional Dataset object.
*   </p>
*   <p>
*   You do not need to instantiate objects of this class yourself.
*   Rather, the <code><a href="Xmla.html#class_Xmla">Xmla</a></code> class will instantiate this class
*   to convey the result of the <code>executeMultiDimensional</code> method
*   (see <code><a href="Xmla.html#method_executeMultiDimensional">executeMultiDimensional()</a></code>),
*   and possibly the <code>execute</code> method.
*   (Note that the <code><a name="Xmla.html#method_execute">execute()</code> instantiates either the
*   <code><a href="Xmla.html#class_Xmla.Rowset">Xmla.Rowset</a></code> or the <code><a href="Xmla.html#class_Xmla.Rowset">Xmla.Dataset</a></code> class
*   depending on the value of the <code>Format</code> property in the options passed to the <code><a href="Xmla.html#method_execute">execute()</a></code> method.)
*   </p>
*   <p>
*   An instance of the <code>Xmla.Dataset</code> class may be returned immediately as return value from these methods when doing a synchronous request.
*   In addition, the <code>Xmla.Dataset</code> object is available in the eventdata passed to any registered listeners
*   (see <code><a href="Xmla.html#method_addListener">addListener()</a></code>).
*   </p>
*
*   @class Xmla.Dataset
*   @constructor
*   @param {DOMDocument} doc The responseXML result returned by server in response to a <code>Execute</code> request.
*/
Xmla.Dataset = function(doc){
    if (typeof(doc) === "string") {
      doc = _xjs(doc);
    }
    this._initDataset(doc);
    return this;
}

/**
*   Can be used as argument for <code><a href="#method_getAxis">getAxis()</a></code> to get the first axis (the column axis).
*   Alternatively you can simply call <code><a href="#method_getColumnAxis">getColumnAxis()</a></code>
*   @property AXIS_COLUMNS
*   @static
*   @final
*   @type int
*   @default <code>0</code>
*/
Xmla.Dataset.AXIS_COLUMNS = 0;
/**
*   Can be used as argument for <code><a href="#method_getAxis">getAxis()</a></code> to get the second axis (the row axis).
*   Alternatively you can simply call <code><a href="#method_getRowAxis">getRowAxis()</a></code>
*   @property AXIS_ROWS
*   @static
*   @final
*   @type int
*   @default <code>1</code>
*/
Xmla.Dataset.AXIS_ROWS = 1;
/**
*   Can be used as argument for <code><a href="#method_getAxis">getAxis()</a></code> to get the third axis (the page axis).
*   Alternatively you can simply call <code><a href="#method_getPageAxis">getPageAxis()</a></code>
*   @property AXIS_PAGES
*   @static
*   @final
*   @type int
*   @default <code>2</code>
*/
Xmla.Dataset.AXIS_PAGES = 2;
/**
*   Can be used as argument for <code><a href="#method_getAxis">getAxis()</a></code> to get the fourth axis (the section axis).
*   Alternatively you can simply call <code><a href="#method_getSectionAxis">getSectionAxis()</a></code>
*   @property AXIS_SECTIONS
*   @static
*   @final
*   @type int
*   @default <code>3</code>
*/
Xmla.Dataset.AXIS_SECTIONS = 3;
/**
*   Can be used as argument for <code><a href="#method_getAxis">getAxis()</a></code> to get the fifth axis (the chapters axis).
*   Alternatively you can simply call <code><a href="#method_getChapterAxis">getChapterAxis()</a></code>
*   @property AXIS_CHAPTERS
*   @static
*   @final
*   @type int
*   @default <code>4</code>
*/
Xmla.Dataset.AXIS_CHAPTERS = 4;
/**
*   Can be used as argument for <code><a href="#method_getAxis">getAxis()</a></code> to get the slicer axis
*   (the axis that appears in the <code>WHERE</code> clause of an MDX-<code>SELECT</code> statement).
*   Alternatively you can simply call <code><a href="#method_getSlicerAxis">getSlicerAxis()</a></code>
*   @property AXIS_SLICER
*   @static
*   @final
*   @type string
*   @default <code>SlicerAxis</code>
*/
Xmla.Dataset.AXIS_SLICER = "SlicerAxis";

Xmla.Dataset.prototype = {
    _root:  null,
    _axes: null,
    _axesOrder: null,
    _numAxes: null,
    _slicer: null,
    _cellset:null,
    _initDataset: function(doc){
        this._initRoot(doc);
        this.cubeName = _getElementText(
            _getElementsByTagNameNS(
                this._root, _xmlnsDataset, "", "CubeName"
            )[0]
        );
        this._initAxes();
        this._initCells();
/*
        var a, i, j, func, funcBody = "", mul;
        func = "var ordinal = 0, a;" +
            "\nif (arguments.length !== " + this._numAxes + ") new Xmla.Exception._newError(\"ERROR_ILLEGAL_ARGUMENT\", \"cellOrdinalForTupleIndexes\", this)._throw();"
        for (a = 0, i = this._numAxes-1; i >= 0; i--, a++) {
            func += "\nif (typeof(a = arguments[" + a + "])!==\"number\") new Xmla.Exception._newError(\"ERROR_ILLEGAL_ARGUMENT\", \"cellOrdinalForTupleIndexes\", this)._throw();";
            mul = 1;
            for (j = i-1; j >= 0; j--) mul *= this._axesOrder[j].tupleCount();
            func += "\nordinal += a ";
            if (i) func += "* " + mul + ";";
        }
        func += funcBody + "\nreturn ordinal;"
        this._cellset.cellOrdinalForTupleIndexes = this.cellOrdinalForTupleIndexes = new Function(func);
*/
     },
    _initRoot: function(doc){
        var root = _getElementsByTagNameNS(doc, _xmlnsDataset, "", "root");
        if (root.length) this._root = root[0];
        else
            Xmla.Exception._newError(
                "ERROR_PARSING_RESPONSE",
                "Xmla.Dataset._initData",
                doc
            )._throw();
    },
    _initAxes: function(){
        var i, axis, axisNode, axisName, axisNodes, numAxisNodes, tmpAxes = {};

        this._axes = {};
        this._axesOrder = [];

        //collect the axisInfo nodes
        axisNodes = _getElementsByTagNameNS(this._root, _xmlnsDataset, "", "AxisInfo");
        numAxisNodes = axisNodes.length;
        for (i = 0; i < numAxisNodes; i++) {
            axisNode = axisNodes[i];
            axisName = _getAttribute(axisNode, "name");
            tmpAxes[axisName] = axisNode;
        }
        //collect the axis nodes
        axisNodes = _getElementsByTagNameNS(this._root, _xmlnsDataset, "", "Axis");
        numAxisNodes = axisNodes.length;
        for (i = 0; i < numAxisNodes; i++){
            axisNode = axisNodes[i];
            axisName = _getAttribute(axisNode, "name");
            axis = new Xmla.Dataset.Axis(this, tmpAxes[axisName], axisNode, axisName, i);
            if (axisName === Xmla.Dataset.AXIS_SLICER) this._slicer = axis;
            else {
                this._axes[axisName] = axis;
                this._axesOrder.push(axis);
            }
        }
        this._numAxes = this._axesOrder.length;
    },
    _initCells: function(){
        this._cellset = new Xmla.Dataset.Cellset(this);
    },
/**
*   Get the number of proper axes in this Dataset. This is the number of axes that appears in the <code>SELECT</code> list, and excludes the slicer axis.
*   @method axisCount
*   @return {int}
*/
    axisCount: function(){
        return this._numAxes;
    },
    _getAxis: function(nameOrIndex) {
        var name, axis;
        switch (typeof(nameOrIndex)) {
            case "number":
                axis = this._axesOrder[nameOrIndex];
                break;
            case "string":
                axis = (name === Xmla.Dataset.AXIS_SLICER) ? this._slicer : this._axes[name];
                break;
        }
        return axis;
    },
/**
*   Get the axis specified by the argument index or name.
*   If the axis does not exist, an <code>INVALID_AXIS</code> exception is thrown.
*   To prevent an exception from being thrown, you should call the <code><a href="#method_hasAxis">hasAxis()</a></code> method to determine if the axis exists.
*   Alternatively, you can call <code><a href="#method_axisCount">axisCount()</a></code>, and use an integer argument between zero (inclusive) and axis count (exclusive).
*   @method getAxis
*   @param nameOrIndex {string | int} For int arguments, a value of 0 up to the number of axes. You can also use one of the <code>AXIS_xxx</code> constants. For string arguments, this method will match the name of the axis as it is returned in the XML/A response. These names are of the form <code>AxisN</code> where N is an ordinal that identifies the axis.
*   @return {Xmla.Dataset.Axis} The <code><a href="Xmla.Dataset.Axis.html#class_Axis">Xmla.Dataset.Axis</a></code> object that corresponds to the argument.
*/
    getAxis: function(nameOrIndex){
        if (nameOrIndex === Xmla.Dataset.AXIS_SLICER) return this._slicer;
        var axis = this._getAxis(nameOrIndex);
        if (!axis)
            Xmla.Exception._newError(
                "INVALID_AXIS",
                "Xmla.Dataset.getAxis",
                nameOrIndex
            )._throw();
        return axis;
    },
/**
*   Determine if the axis specified by the argument exists.
*   @method hasAxis
*   @param nameOrIndex {string | int} For int arguments, a value of 0 up to the number of axes. You can also use one of the <code>AXIS_xxx</code> constants. For string arguments, this method will match the name of the axis as it is returned in the XML/A response. These names are of the form <code>AxisN</code> where N is an ordinal that identifies the axis.
*   @return {boolean} <code>true</code> if the specified axis exists, <code>false</code> if it doesn't exist.
*/
    hasAxis: function(nameOrIndex) {
        var axis = this._getAxis(nameOrIndex);
        return !_isUnd(axis);
    },
/**
*   Get the Column axis. This is the first axis, and has ordinal 0. If the column axis doesn't exist, an <code>INVALID_AXIS</code> exception is thrown.
*   To prevent an exception from being thrown, you should call the <code><a href="#method_hasColumnAxis">hasColumnAxis()</a></code> method to determine if the axis exists.
*   @method getColumnAxis
*   @return {Xmla.Dataset.Axis} The column <code><a href="Xmla.Dataset.Axis.html#class_Axis">Xmla.Dataset.Axis</a></code> object.
*/
    getColumnAxis: function(){
        return this.getAxis(Xmla.Dataset.AXIS_COLUMNS);
    },
/**
*   Determine if the column axis exists.
*   @method hasColumnAxis
*   @return {boolean} <code>true</code> if the column axis exists, <code>false</code> if it doesn't exist.
*/
    hasColumnAxis: function(){
        return this.hasAxis(Xmla.Dataset.AXIS_COLUMNS);
    },
/**
*   Get the Row axis. This is the second axis, and has ordinal 1. If the row axis doesn't exist, an <code>INVALID_AXIS</code> exception is thrown.
*   To prevent an exception from being thrown, you should call the <code><a href="#method_hasRowAxis">hasRowAxis()</a></code> method to determine if the axis exists.
*   @method getRowAxis
*   @return {Xmla.Dataset.Axis} The row <code><a href="Xmla.Dataset.Axis.html#class_Axis">Xmla.Dataset.Axis</a></code> object.
*/
    getRowAxis: function(){
        return this.getAxis(Xmla.Dataset.AXIS_ROWS);
    },
/**
*   Determine if the row axis exists.
*   @method hasRowAxis
*   @return {boolean} <code>true</code> if the row axis exists, <code>false</code> if it doesn't exist.
*/
    hasRowAxis: function(){
        return this.hasAxis(Xmla.Dataset.AXIS_ROWS);
    },
/**
*   Get the Page axis. This is the third axis, and has ordinal 2. If the page axis doesn't exist, an <code>INVALID_AXIS</code> exception is thrown.
*   To prevent an exception from being thrown, you should call the <code><a href="#method_hasPageAxis">hasPageAxis()</a></code> method to determine if the axis exists.
*   @method getPageAxis
*   @return {Xmla.Dataset.Axis} The page <code><a href="Xmla.Dataset.Axis.html#class_Axis">Xmla.Dataset.Axis</a></code> object.
*/
    getPageAxis: function(){
        return this.getAxis(Xmla.Dataset.AXIS_PAGES);
    },
/**
*   Determine if the page axis exists.
*   @method hasPageAxis
*   @return {boolean} <code>true</code> if the page axis exists, <code>false</code> if it doesn't exist.
*/
    hasPageAxis: function(){
        return this.hasAxis(Xmla.Dataset.AXIS_PAGES);
    },
/**
*   Get the Chapter axis. This is the fourth axis, and has ordinal 3. If the chapter axis doesn't exist, an <code>INVALID_AXIS</code> exception is thrown.
*   To prevent an exception from being thrown, you should call the <code><a href="#method_hasChapterAxis">hasChapterAxis()</a></code> method to determine if the axis exists.
*   @method getChapterAxis
*   @return {Xmla.Dataset.Axis} The chapter <code><a href="Xmla.Dataset.Axis.html#class_Axis">Xmla.Dataset.Axis</a></code> object.
*/
    getChapterAxis: function(){
        return this.getAxis(Xmla.Dataset.AXIS_CHAPTERS);
    },
/**
*   Determine if the chapter axis exists.
*   @method hasChapterAxis
*   @return {boolean} <code>true</code> if the chapter axis exists, <code>false</code> if it doesn't exist.
*/
    hasChapterAxis: function(){
        return this.hasAxis(Xmla.Dataset.AXIS_CHAPTERS);
    },
/**
*   Get the Section axis. This is the fifth axis, and has ordinal 4. If the section axis doesn't exist, an <code>INVALID_AXIS</code> exception is thrown.
*   To prevent an exception from being thrown, you should call the <code><a href="#method_hasPageAxis">hasSectionAxis()</a></code> method to determine if the axis exists.
*   @method getSectionAxis
*   @return {Xmla.Dataset.Axis} The section <code><a href="Xmla.Dataset.Axis.html#class_Axis">Xmla.Dataset.Axis</a></code> object.
*/
    getSectionAxis: function(){
        return this.getAxis(Xmla.Dataset.AXIS_SECTIONS);
    },
/**
*   Determine if the section axis exists.
*   @method hasSectionAxis
*   @return {boolean} <code>true</code> if the section axis exists, <code>false</code> if it doesn't exist.
*/
    hasSectionAxis: function(){
        return this.hasAxis(Xmla.Dataset.AXIS_SECTIONS);
    },
/**
*   Get the Slicer axis. This is the axis that appears in the <code>WHERE</code> clause of the MDX statement.
*   @method getSlicerAxis
*   @return {Xmla.Dataset.Axis} The slicer <code><a href="Xmla.Dataset.Axis.html#class_Axis">Xmla.Dataset.Axis</a></code> object.
*/
    getSlicerAxis: function(){
        return this._slicer;
    },
/**
*   Determine if the slicer axis exists.
*   @method hasSlicerAxis
*   @return {boolean} <code>true</code> if the slicer axis exists, <code>false</code> if it doesn't exist.
*/
    hasSlicerAxis: function(){
        return this._slicer !== null;
    },
/**
*   Get the Cellset object.
*   @method getCellset
*   @return {Xmla.Dataset.Cellset} The <code><a href="Xmla.Dataset.Cellset.html#class_Cellset">Xmla.Dataset.Cellset</a></code> object.
*/
    getCellset: function(){
        return this._cellset;
    },
/**
*   <p>Calculate the cellset ordinal for the argument tuple indexes.</p>
*   <p>This method accepts a variable number of tuple indexes. One integer argument must be passed for each proper axis (excluding the slicer axis).
*   Each integer arguments represent the index of a tuple on the respective axis.</p>
*   <p>The arguments must be specified by descending axis order. So if the data set has two axes (a row and a column axis),
*   this method expects the tuple index of a tuple on the row axis first, and after that, the tuple index on the column axis.</p>
*   <p>The method returns an integer that represents the ordinal of the cell identified by the tuples specified by the tuple index arguments.
*   One could use this ordinal as argument to the <code><a href="Xmla.Dataset.Cellset.html#method_getByOrdinal">getByOrdinal()</a></code> method of this Dataset's <code><a href="Xmla.Dataset.Cellset.html#class_Cellset">Cellset</a></code>.</p>
*   <p>Instead of calling this method and passing the result into the Cellsets <code><a href="Xmla.Dataset.Cellset.html#method_getByOrdinal">getByOrdinal()</a></code> method,
*   you can call the <code><a href="Xmla.Dataset.Cellset.html#method_getByTupleIndexes">getByTupleIndexes()</a></code> method  of this Dataset's <code><a href="Xmla.Dataset.Cellset.html#class_Cellset">Cellset</a></code>.</p>
*   @method cellOrdinalForTupleIndexes
*   @param {int} A variable number of integer tuple indexes. Tuple indexes should be passed in descending order of axes.
*   @return {int} The ordinal number that identifies the cell from this Dataset's <code><a href="Xmla.Dataset.Cellset.html#class_Cellset">Xmla.Dataset.Cellset</a></code> that belongs to the tuples identified by the arguments.
*/
    cellOrdinalForTupleIndexes: function() {
      var numAxes = this._numAxes, axesOrder = this._axesOrder, i, ordinal = 0, a, arg, j, tupleCount;
      //for each axis, in descending order
      for (a = 0, i = numAxes - 1; i >= 0; i--, a++) {
        arg = arguments[a];
        tupleCount = 1;
        //for all preceding axes, in descending order
        for (j = i-1; j >= 0; j--) {
          tupleCount *= axesOrder[j].tupleCount();
        }
        ordinal += arg * tupleCount;
      }
      return ordinal;
    },
/**
 * Gets all of the XML data into one JS object. The object consists of the following members:
 * <ul>
 *  <li><code>axes</code>: An array of objects that represent the query axes (but not the slicer axis).
 *  Each axis has a <code>positions</code> member which is an array of tuples, and a <code>hierarchies</code> member, which is an array of hierarchies.</li>
 *  <li><code>slicerAxis</code>: An object that represents the slicer axis, or null if there is no slicer axis.</li>
 *  <li><code>cells</code>: An array of cell objects, representing the cellset.</li>
 * </ul>
 * @method fetchAsObject
 * @return {Object}
 */
    fetchAsObject: function() {
      var getHierarchyArray = function(axis){
        var h = axis.getHierarchies();
        var hierarchies = [];
        var i, n = axis.numHierarchies;
        for (i = 0; i < n; i++) {
          hierarchies.push(axis.hierarchy(i));
        }
        return hierarchies;
      }
      var axes = [], axis, filterAxis,
          cellset = [], cells = [], cell,
          i, n, tuples=1, idx=0;

      //loop through all non slicer axes
      for (i = 0, n = this.axisCount(); i < n; i++){
          axis = this.getAxis(i);
          tuples = tuples * axis.tupleCount();
          axes.push({
              positions: axis.fetchAllAsObject(),
              hierarchies: getHierarchyArray(axis)
          });
      }

        //get Slicer information
      if (this.hasSlicerAxis) {
        axis = this.getSlicerAxis();
        filterAxis =  {
          positions: axis.fetchAllAsObject(),
          hierarchies:  getHierarchyArray(axis)
        }
      } else {
        filterAxis =  {
          positions: {},
          hierarchies: []
        }
      }

      //get Cellset data
      cellset = this.getCellset();
      for (i = 0, n = tuples; i < n; i++){
          cell = cellset.readCell();
          if (idx === cell.ordinal) {
            cells.push(cell);
            if (cellset.nextCell() === -1) {
              break;
            }
          } else {
            //console.debug('skipping: '+idx+':'+cell.ordinal);
            cells.push({Value:null, FmtValue:null, FormatString: null, ordinal:idx });
          }
          idx++;
      }
      //do not close, it might be used later.....
      cellset.reset();

      return {
        cubeName: this.cubeName,
        axes: axes,
        filterAxis: filterAxis,
        cells: cells
      };
    },
/**
*   Reset this object so it can be used again.
*   @method reset
*   @return void
*/
    reset: function(){
      if (this._cellset) this._cellset.reset();
      if (this._axes) {
        var i, n, axis;
        for (i = 0, n = this.axisCount(); i < n; i++){
            this.getAxis(i).reset();
        }
      }
    },
/**
*   Cleanup this Dataset object.
*   @method close
*   @return void
*/
    close: function(){
        if (this._slicer) {
          this._slicer.close();
        }
        var i, n = this._numAxes;
        for (i = 0; i < n; i++) {
          this.getAxis(i).close();
        }
        this._cellset.close();
        this._cellset = null;
        this._root = null;
        this._axes = null;
        this._axesOrder = null;
        this._numAxes = null;
        this._slicer = null;
    }
};

/**
*   <p>
*   This class implements an Axis object.
*   </p>
*   <p>
*   You do not need to instantiate objects of this class yourself.
*   Rather, the <code><a href="Xmla.Dataset.html#class_Xmla.Dataset">Xmla.Dataset</a></code> class creates instances of this class to represent the axes of an MDX query.
*   (see <code><a href="Xmla.Dataset.html#method_getAxis">getAxis()</a></code>.)
*
*   @class Xmla.Dataset.Axis
*   @constructor
*/
Xmla.Dataset.Axis = function(_dataset, _axisInfoNode, _axisNode, name, id){
    this._dataset = _dataset;
    this._initAxis(_axisInfoNode, _axisNode);
    this.name = name;
    this.id = id;
    return this;
}

/**
*   The name of the standard member property that contains the unique name for this member.
*   See <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms725398%28v=vs.85%29.aspx">Ole DB standard</a> for more information.
*   @property MEMBER_UNIQUE_NAME
*   @static
*   @final
*   @type string
*   @default Uname
*/
Xmla.Dataset.Axis.MEMBER_UNIQUE_NAME = "UName";
/**
*   The name of the standard member property that contains the caption for this member.
*   See <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms725398%28v=vs.85%29.aspx">Ole DB standard</a> for more information.
*   @property MEMBER_CAPTION
*   @static
*   @final
*   @type string
*   @default Caption
*/
Xmla.Dataset.Axis.MEMBER_CAPTION = "Caption";
/**
*   The name of the standard member property that contains the name of the level for this member.
*   See <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms725398%28v=vs.85%29.aspx">Ole DB standard</a> for more information.
*   @property MEMBER_LEVEL_NAME
*   @static
*   @final
*   @type string
*   @default LName
*/
Xmla.Dataset.Axis.MEMBER_LEVEL_NAME = "LName";
/**
*   The name of the standard member property that contains the number of the level for this member.
*   See <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms725398%28v=vs.85%29.aspx">Ole DB standard</a> for more information.
*   @property MEMBER_LEVEL_NUMBER
*   @static
*   @final
*   @type string
*   @default LNum
*/
Xmla.Dataset.Axis.MEMBER_LEVEL_NUMBER = "LNum";
/**
*   The name of the member property that contains displayinfo for this member.
*   See <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms725398%28v=vs.85%29.aspx">Ole DB standard</a> for more information.
*   @property MEMBER_DISPLAY_INFO
*   @static
*   @final
*   @type string
*   @default LNum
*/
Xmla.Dataset.Axis.MEMBER_DISPLAY_INFO = "DisplayInfo";
/**
*   The default mem ber properties for members
*   See <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms725398%28v=vs.85%29.aspx">Ole DB standard</a> for more information.
*   @property DefaultMemberProperties
*   @static
*   @final
*   @type array
*/
Xmla.Dataset.Axis.DefaultMemberProperties = [
  Xmla.Dataset.Axis.MEMBER_UNIQUE_NAME,
  Xmla.Dataset.Axis.MEMBER_CAPTION,
  Xmla.Dataset.Axis.MEMBER_LEVEL_NAME,
  Xmla.Dataset.Axis.MEMBER_LEVEL_NUMBER,
  Xmla.Dataset.Axis.MEMBER_DISPLAY_INFO
];

/**
*   A constant that can be used as a bitmask for a member's <code>DisplayInfo</code> property.
*   Bitwise AND-ing this mask to the member's <code>DisplayInfo</code> property returns an estimate of the number of children of this member.
*   @property MDDISPINFO_CHILDREN_CARDINALITY
*   @static
*   @final
*   @type int
*   @default 65535
*/
Xmla.Dataset.Axis.MDDISPINFO_CHILDREN_CARDINALITY = 65535;
/**
*   A constant that can be used as a bitmask for a member's <code>DisplayInfo</code> property.
*   If this bit is set, it means the member is drilled down.
*   This is the case whenever at least one child of this member appears on the axis immediately following this member.
*   @property MDDISPINFO_DRILLED_DOWN
*   @static
*   @final
*   @type int
*   @default <code>65536</code>
*/
Xmla.Dataset.Axis.MDDISPINFO_DRILLED_DOWN = 65536;
/**
*   A constant that can be used as a bitmask for a member's <code>DisplayInfo</code> property.
*   If this bit is set, it means this member has the same parent as the member immediately preceding this member.
*   @property MDDISPINFO_SAME_PARENT_AS_PREV
*   @static
*   @final
*   @type int
*   @default <code>131072</code>
*/
Xmla.Dataset.Axis.MDDISPINFO_SAME_PARENT_AS_PREV = 131072;

Xmla.Dataset.Axis.prototype = {
/**
*   The 0-based id of the axis.
*   @property id
*   @type int
*/
    id: -1,
/**
*   The name of the axis.
*   @property name
*   @type string
*/
    name: null,
    _dataset: null,
    _tuples: null,
    _members: null,
    _memberProperties: null,
    numTuples: null,
    numHierarchies: null,
    _tupleIndex: null,
    _hierarchyIndex: null,
    _hierarchyOrder: null,
    _hierarchyDefs: null,
    _hierarchyIndexes: null,
    _initHierarchies: function(_axisInfoNode){
        var hierarchyInfoNodes = _getElementsByTagNameNS(
                _axisInfoNode,
                _xmlnsDataset,
                "",
                "HierarchyInfo"
            ),
            numHierarchies = hierarchyInfoNodes.length,
            i, j, hierarchyInfoNode, hierarchyName,
            hierarchyDef, properties, numPropertyNodes, propertyNodes, propertyNode,
            nodeName, type, memberProperty, memberProperties = this._memberProperties,
            converter
        ;
        this._hierarchyDefs = {};
        this._hierarchyOrder = [];
        this._hierarchyIndexes = {};
        this.numHierarchies = numHierarchies;
        var propertyTagName, propertyName;
        for (i = 0; i < numHierarchies; i++){
            hierarchyInfoNode = hierarchyInfoNodes[i];
            hierarchyName = _getAttribute(hierarchyInfoNode, "name");
            this._hierarchyOrder[i] = hierarchyName;
            this._hierarchyIndexes[hierarchyName] = i;
            hierarchyDef = {
                index: i,
                name: hierarchyName,
                properties: properties = {}
            };
            propertyNodes = _getElementsByTagNameNS(hierarchyInfoNode, _xmlnsDataset, "", "*");
            numPropertyNodes = propertyNodes.length;
            for (j = 0; j < numPropertyNodes; j++) {
                propertyNode = propertyNodes[j];
                nodeName = propertyNode.nodeName;
                //note: MSAS doesn't seem to include a type for custom properties
                type = _getAttribute(propertyNode, "type");
                if (!type) {
                  memberProperty = memberProperties[nodeName];
                  if (memberProperty) {
                    type = memberProperty.type;
                  }
                  else {
                    switch (nodeName) {
                      case Xmla.Dataset.Axis.MEMBER_LEVEL_NUMBER:
                      case Xmla.Dataset.Axis.MEMBER_DISPLAY_INFO:
                        type = "xsd:int";
                    }
                  }
                }
                converter = _typeConverterMap[type];
                if (!converter){
                  converter = _textConverter;
                }
                propertyTagName = _decodeXmlaTagName(nodeName);
                switch (propertyTagName) {
                  case Xmla.Dataset.Axis.MEMBER_UNIQUE_NAME:
                  case Xmla.Dataset.Axis.MEMBER_CAPTION:
                  case Xmla.Dataset.Axis.MEMBER_LEVEL_NAME:
                  case Xmla.Dataset.Axis.MEMBER_LEVEL_NUMBER:
                  case Xmla.Dataset.Axis.MEMBER_DISPLAY_INFO:
                    //map default properties with their tagName (Standard) 
                    propertyName = propertyTagName;
                    break;
                  default:
                    //map non-default properties by unqualified property name.
                    propertyName = _getAttribute(propertyNode, "name");
                    if (propertyName) {
                      propertyName = propertyName.split(".");
                      propertyName = propertyName[propertyName.length - 1];
                      if (propertyName.charAt(0) === "[" && propertyName.charAt(propertyName.length -1) === "]") {
                        propertyName = propertyName.substr(1, propertyName.length - 2);
                      }
                    }
                }
                properties[nodeName] = {
                    converter: converter,
                    name: propertyTagName,
                    propertyName: propertyName
                };
            }
            this._hierarchyDefs[hierarchyName] = hierarchyDef;
        }
    },
    _initMembers: function(){
        var root = this._dataset._root,
            memberSchema, memberSchemaElements, numMemberSchemaElements, memberSchemaElement,
            type, name, i, memberProperties = this._memberProperties = {}
        ;
        memberSchema = _getComplexType(root, "MemberType");
        if (!memberSchema)
            Xmla.Exception._newError(
                "ERROR_PARSING_RESPONSE",
                "Xmla.DataSet.Axis",
                root
            )._throw();
        memberSchema = _getElementsByTagNameNS(memberSchema, _xmlnsSchema, _xmlnsSchemaPrefix, "sequence");
        if (!memberSchema.length) {
          //Jedox does not specify content of members.
          if (!_isUnd(console.error)) {
            console.error("MemberType in schema does not define any child elements. Are you running on Jedox/Palo?");
          }
          return;
        }
        memberSchema = memberSchema[0];
        memberSchemaElements = _getElementsByTagNameNS(memberSchema, _xmlnsSchema, _xmlnsSchemaPrefix, "element");
        numMemberSchemaElements = memberSchemaElements.length;
        for (i = 0; i < numMemberSchemaElements; i++) {
            memberSchemaElement = memberSchemaElements[i];
            type = _getAttribute(memberSchemaElement, "type");
            name = _getAttribute(memberSchemaElement, "name");
            memberProperties[name] = {
                type: type,
                converter: _typeConverterMap[type],
                name: _decodeXmlaTagName(name)
            };
        }
    },
    _initAxis: function(_axisInfoNode, _axisNode){
        this.name = _getAttribute(_axisNode, "name");
        this._initMembers();
        this._initHierarchies(_axisInfoNode);
        this._tuples = _getElementsByTagNameNS(_axisNode, _xmlnsDataset, "", "Tuple");
        this.numTuples = this._tuples.length;
        this.reset();
    },
    close: function(){
        this.numTuples = -1;
        this._tuples = null;
        this._hierarchyDefs = null;
        this._hierarchyOrder = null;
        this._hierarchyIndexes = null;
        this._members = null;
    },
    _getMembers: function(){
        if (!this.hasMoreTuples()) {
          return null;
        }
        return _getElementsByTagNameNS(
            this._tuples[this._tupleIndex],
            _xmlnsDataset, "", "Member"
        );
    },
/**
*   Resets this axis object.
*   This resets internal counters for iterating through the hierarchies and tuples of this Axis object.
*   When using hierarchy and tuple iterators to traverse the entire axis, you typically won't need to call this method yourself.
*   @method reset
*/
    reset: function(){
        this._hierarchyIndex = 0;
        this._tupleIndex = 0;
        this._members = this._getMembers();
    },
/**
*   Checks if there are more hierarchies to iterate through.
*   You can use this method along with the <code><a href="#method_nextHierarchy">nextHierarchy()</a></code> method to drive a loop
*   to iterate through the hierarchies contained in this axis object.
*   @method hasMoreHierarchies
*   @return {boolean} Returns <code>true</code> if there are more hierarchies to vist, <code>false</code> if all hierarchies are traversed.
*/
    hasMoreHierarchies: function(){
        return this.numHierarchies > this._hierarchyIndex;
    },
/**
*   Moves the internal hierarchy pointer forward.
*   You can use this method along with the <code><a href="#method_hasMoreHierarchies">hasMoreHierarchies()</a></code> method to drive a loop
*   to iterate through the hierarchies contained in this axis object.
*   @method nextHierarchy
*   @return {int} Returns the index of current hierarchy.
*/
    nextHierarchy: function(){
        return this._hierarchyIndex++;
    },
/**
*   <p>Calls a callback function for each hierarchy in this Axis object.</p>
*   <p>The callback function is passed an object that represents the current hierarchy. This object has the following structure:</p><ul>
*     <li><code>index</code> <code>int</code> The ordinal identifying this hierarchy</li>
*     <li><code>name</code> <code>string</code> The name of this hierarchy</li>
*   </ul>
*   <p>The callback may return <code>false</code> to abort iteration. If the callback does not return <code>false</code>, iteration will resume until all hierarchies are traversed.</p>
*   @param {function()} callback A function that will be called for each hierarchy. The hierarchy is passed as an object as the first argument to the callback. For the structure of the hierarchy object, see <a href="#method_hierarchy">hierarchy()</a>.
*   @param {object} scope The object that will be used as scope when executing the callback function. If this is undefined or <code>null</code>, the Axis' <code>this</code> pointer will be used.
*   @param {object} args Additional data to be passed to the callback function..
*   @method eachHierarchy
*   @return {boolean} Returns <code>true</code> if all hierarchies were visited and the callback did not return <code>false</code>. Returns <code>false</code> if the callback returned <code>false</code> and further iteration was aborted.
*/
    eachHierarchy: function(callback, scope, args){
        var mArgs = [null];
        if (!scope) scope = this;
        if (args) {
            if (!_isArr(args)) args = [args];
            mArgs = mArgs.concat(args);
        }
        while (this.hasMoreHierarchies()){
            mArgs[0] = this._hierarchyDefs[this._hierarchyOrder[this._hierarchyIndex]];
            if (callback.apply(scope, mArgs)===false) return false;
            this.nextHierarchy();
        }
        this._hierarchyIndex = 0;
        return true;
    },
/**
*   Checks if there are more tuples to iterate through.
*   You can use this method along with the <code><a href="#method_nextTuple">nextTuple()</a></code> method to drive a loop
*   to iterate through the tuples contained in this axis object.
*   @method hasMoreTuples
*   @return {boolean} Returns <code>true</code> if there are more tuples to vist, <code>false</code> if all tuples are traversed.
*/
    hasMoreTuples: function(){
        return this.numTuples > this._tupleIndex;
    },
/**
*   Moves the internal tuple pointer forward.
*   You can use this method along with the <code><a href="#method_nextTuple">nextTuple()</a></code> method to drive a loop
*   to iterate through the tuples contained in this axis object.
*   @method nextTuple
*   @return {int} Returns the index of current tuple.
*/
    nextTuple: function(){
        this._tupleIndex++;
        this._members = this._getMembers();
        return this._tupleIndex;
    },
/**
*   Gets the number of tuples in this axis object.
*   @method tupleCount
*   @return {int} Returns the number of tuples in this Axis object.
*/
    tupleCount: function(){
        return this.numTuples;
    },
/**
*   Returns the current value of the tuple pointer.
*   @method tupleIndex
*   @return {int} Returns the current value of the tuple pointer.
*/
    tupleIndex: function() {
        return this._tupleIndex;
    },
/**
*   Get the current tuple as an object. The tuple object has the following structure: <ul>
*       <li><code>index</code> <code>int</code>: the ordinal of this tuple within its axis</li>
*       <li><code>hierarchies</code> <code>object</code>: A map of members using hierarchy names as keys, and member objects as values</li>
*       <li><code>members</code> <code>array</code>: An array of members in order of hierarchy order.</li>
*   </ul>
*   @method getTuple
*   @return {object} An object representing the current tuple..
*/
    getTuple: function() {
        var i, n = this.numHierarchies,
            hierarchies = {}, member, members = [],
            tuple = {
                index: this._tupleIndex,
                hierarchies: hierarchies,
                members: members
            }
        ;
        for (i=0; i < n; i++) {
          member = this._member(i);
          hierarchies[this._hierarchyOrder[i]] = member;
          members.push(member);
        }
        return tuple;
    },
/**
*   <p>Calls a callback function for each tuple in this Axis object.</p>
*   <p>The callback function is passed an object that represents the current tuple. (see <code><a href="#method_getTuple">getTuple()</a></code> for a description of the tuple format.)</p>
*   <p>The callback may return <code>false</code> to abort iteration. If the callback does not return <code>false</code>, iteration will resume until all tuples are traversed.</p>
*   @param {function()} callback A function that will be called for each tuple. The tuple is passed as an object as the first argument to the callback.
*   @param {object} scope The object that will be used as scope when executing the callback function. If this is undefined or <code>null</code>, the Axis' <code>this</code> pointer will be used.
*   @param {object} args Additional data to be passed as the second argument to the callback function.
*   @method eachTuple
*   @return {boolean} Returns <code>true</code> if all tuples were visited and the callback did not return <code>false</code>. Returns <code>false</code> if the callback returned <code>false</code> and further iteration was aborted.
*/
    eachTuple: function(callback, scope, args){
        var mArgs = [null];
        if (!scope) {
          scope = this;
        }
        if (args) {
            if (_isArr(args)) {
              mArgs.concat(args)
            }
            else {
              mArgs.push(args);
            }
        }
        while (this.hasMoreTuples()){
            mArgs[0] = this.getTuple();
            if (callback.apply(scope, mArgs) === false) {
              return false;
            }
            this.nextTuple();
        }
        this._tupleIndex = 0;
        this._members = this._getMembers();
        return true;
    },
/**
 *  Returns the hierarchies of this Axis object.
*   @method getHierarchies
*   @return {array} An array of hierarchies contained in this Axis.
 **/
    getHierarchies: function(){
        return this._hierarchyDefs;
    },
/**
 *  Returns the names of the hierarchies of this Axis object.
*   @method getHierarchyNames
*   @return {array} An array of names of the hierarchies contained in this Axis.
 **/
    getHierarchyNames: function(){
        var hierarchyNames = [], i, n = this.numHierarchies;
        for (i = 0; i < n; i++) hierarchyNames[i] = this._hierarchyOrder[i];
        return hierarchyNames;
    },
/**
*   Gets the number of hierarchies in this axis object.
*   @method hierarchyCount
*   @return {int} Returns the number of hierarchies in this Axis object.
*/
    hierarchyCount: function(){
        return this.numHierarchies;
    },
/**
*   Gets the index of the hierarchy identified by the specified name, or the index of the current hierarchy (in case the name argument is omitted).
*   @method hierarchyIndex
*   @param hierarchyName {string} The name of the hierarchy for which the index is to be retrieved. When omitted, the index of the current hierarchy is returned.
*   @return {int} The index of the hierarchy specified by the name passed as argument, or the index of the current hierarchy if the name argument is omitted.
*/
    hierarchyIndex: function(hierarchyName){
        if (_isUnd(hierarchyName)) return this._hierarchyIndex;
        var index = this._hierarchyIndexes[hierarchyName];
        if (_isUnd(index))
            Xmla.Exception._newError(
                "INVALID_HIERARCHY",
                "Xmla.Dataset.Axis.hierarchyDef",
                hierarchyName
            )._throw();
        return index;
    },
/**
*   Gets the name of the hierarchy identified by the specified index, or the name of the current hierarchy (in case the index argument is omitted).
*   @method hierarchyName
*   @param hierarchyIndex {int} The ordinal of the hierarchy for which the name is to be retrieved. When omitted, the name of the current hierarchy is returned.
*   @return {string} The name of the hierarchy specified by the argument index, or the name of the current hierarchy if the index argument is omitted.
*/
    hierarchyName: function(index){
        if (_isUnd(index)) index = this._hierarchyIndex;
        if (index !== parseInt(index, 10) ||
            index >= this.numHierarchies
        )
            Xmla.Exception._newError(
                "INVALID_HIERARCHY",
                "Xmla.Dataset.Axis.hierarchyDef",
                index
            )._throw();
        return this._hierarchyOrder[index];
    },
/**
*   Gets the hierarchy identified by the specified index or hierarchyName, or the current hierarchy (in case the argument is omitted).
*   The hierarchy is returned as an object with the following properties:<ul>
*     <li>index {int} Integer indicating the ordinal position of this hiearchy within the axis.</li>
*     <li>name {string} String that holds the name of this hierarchy.</li>
*   </ul>
*   In addition, the XML/A specification suggests the following standard properties:<ul>
*     <li>UName {string} the unique name of this hierarchy</li>
*     <li>Caption {string} the human friendly name for this hierarchy</li>
*     <li>LName {string} the level name</li>
*     <li>LNum {int} the level number</li>
*     <li>DisplayInfo {int} displayinfo</li>
*   </ul>
*   @method hierarchy
*   @param hierarchyIndexOrName {int|string} The ordinal or name of the hierarchy that is to be retrieved. When omitted, the the current hierarchy is returned.
*   @return {string} The hierarchy specified by the argument index or name, or the current hierarchy if the argument is omitted.
*/
    hierarchy: function(hierarchyIndexOrName){
        if (_isUnd(hierarchyIndexOrName)) index = this._hierarchyIndex;
        var index, hierarchyName, hierarchy;
        if (_isNum(hierarchyIndexOrName)) {
            if (hierarchyIndexOrName !== parseInt(hierarchyIndexOrName, 10)
            ||  hierarchyIndexOrName >= this.numHierarchies
            )
                Xmla.Exception._newError(
                    "INVALID_HIERARCHY",
                    "Xmla.Dataset.Axis.hierarchyDef",
                    hierarchyIndexOrName
                )._throw();
            hierarchyName = this.hierarchyName(hierarchyIndexOrName);
        }
        else hierarchyName = hierarchyIndexOrName;
        hierarchy = this._hierarchyDefs[hierarchyName];
        if (_isUnd(hierarchy))
            Xmla.Exception._newError(
                "INVALID_HIERARCHY",
                "Xmla.Dataset.Axis.hierarchyDef",
                hierarchyName
            )._throw();
        return hierarchy;
    },
/**
*   Gets the member for the specified hierarchy from the current tuple. The member has the following structure: <ul>
*     <li><code>index</code> - <code>int</code></li>
*     <li><code>hierarchy</code> - <code>string</code>. Name of the hiearchy to which this member belongs.</li>
*     <li><code>UName</code> - <code>string</code>. Unique name of this member.</li>
*     <li><code>Caption</code> - <code>string</code>. Human friendly name for this member.</li>
*     <li><code>LName</code> - <code>string</code>. Name of the level to which this member belongs.</li>
*     <li><code>LNum</code> - <code>int</code>. Number of the level to which this member belongs. Typically, the top-level is level 0, its children are level 1 and so on.</li>
*     <li><code>DisplayInfo</code> - <code>int</code>. A 4 byte value. The 2 least significant bytes form a 16 bit integer that conveys the number of children of this member.
*     The remaining two most significant bytes form a 16 bit bitfield.
*     </li>
*   </ul>
*   <p>
*   The <code>index</code> and <code>hierarchy</code> properties are non standard and always added by Xmla4js.
*   The properties <code>UName</code>, <code>Caption</code>, <code>LName</code> and <code>LNum</code> are defined by the XML/A standard, and should always be present.
*   The property <code>DisplayInfo</code> is non-standard, but often available.
*   Other properties may be present depending on the specific XML/A provider.
*   </p>
*   @method member
*   @param hierarchyIndexOrName {int|string} The ordinal or name of the hierarchy from which the member is to be retrieved. When omitted, the the current hierarchy is returned.
*   @return {object} The member of the current tuple that belongs to the specified hierarchy, If the argument is omitted the member that belongs current hierarchy is retrieved from the current tuple.
*/
    member: function(hierarchyIndexOrName){
        if (_isUnd(hierarchyIndexOrName)) {
          index = this._hierarchyIndex;
        }
        var index, hierarchyName;
        switch(typeof(hierarchyIndexOrName)){
            case "string":
                index = this.hierarchyIndex(hierarchyIndexOrName);
                hierarchyName = hierarchyIndexOrName;
                break;
            case "number":
                if (hierarchyIndexOrName !== parseInt(hierarchyIndexOrName, 10) ||
                    hierarchyIndexOrName >= this.numHierarchies
                )
                    Xmla.Exception._newError(
                        "INVALID_HIERARCHY",
                        "Xmla.Dataset.Axis.hierarchyDef",
                        hierarchyIndexOrName
                    )._throw();
                index = hierarchyIndexOrName;
                break;
        }
        return this._member(index);
    },
    _member: function(index){
        var memberNode = this._members[index],
            childNodes = memberNode.childNodes,
            i, n = childNodes.length,
            hierarchyName = this.hierarchyName(index),
            hierarchyDef = this._hierarchyDefs[hierarchyName],
            properties = hierarchyDef.properties,
            property,
            member = {
                index: index,
                hierarchy: hierarchyName
            },
            el,
            valueConverter
        ;
        for (i = 0; i < n; i++) {
            el = childNodes[i];
            if (el.nodeType !== 1) {
              continue;
            }
            property = properties[el.nodeName];
            if (!property) {
              continue;
            }
            member[property.propertyName || property.name] = property.converter(_getElementText(el));
        }
        return member;
    },
/**
*   Check if the member has the specified property.
*   XML/A defines these standard properties:<ul>
*     <li><code>UName</code></li>
*     <li><code>Caption</code></li>
*     <li><code>LName</code></li>
*     <li><code>LNum</code></li>
*     <li><code>DisplayInfo</code></li>
*   </ul>
*   The XML/A provider may return specific additional properties.
*   @method hasMemberProperty
*   @param propertyName {string} The name of the property to check for.
*   @return {boolean} returns <code>true</code> if the current member has the specified property, <code>false</code> if it doesn't.
*/
    hasMemberProperty: function(propertyName) {
        return !_isUnd(this._memberProperties[propertyName]);
    },
/**
*   Gets the current tuple as an array of members.
*   For a description of the structure of the member elements, see <code><a href="#method_member">member()</a></code>.
*   @method readAsArray
*   @param array {array} An existing array to store the members in. If omitted, a new array is returned.
*   @return {array} An array of members that represents the current tuple.
*/
    readAsArray: function(array){
        if (!array) array = [];
        var i, n = this.numHierarchies;
        for (i = 0; i < n; i++) array[i] = this._member(i);
        return array;
    },
/**
*   Gets the current tuple as an object.
*   The object's keys are the hierarchy names, and the members of the current tuple are used as values for the keys.
*   For a description of the structure of the member elements, see <code><a href="#method_member">member()</a></code>.
*   @method readAsObject
*   @param object {object} An existing object to store the tuple data in. If omitted, a new object is returned.
*   @return {object} An object that represents the current tuple.
*/
    readAsObject: function(object){
        if (!object) object = {};
        var i, n = this.numHierarchies;
        for (i = 0; i < n; i++) object[this._hierarchyOrder[i]] = this._member(i);
        return object;
    },
/**
*   Gets the current tuple as an array of members and advances the internal tuple pointer.
*   For a description of the structure of the member elements, see <code><a href="#method_member">member()</a></code>.
*   @method fetchAsArray
*   @param array {array} An existing array to store the members in. If omitted, a new array is returned.
*   @return {array|false} An array of members that represents the current tuple, or <code>false</code> if there are no more tuples.
*/
    fetchAsArray: function(array){
        if (this.hasMoreTuples()) {
            array = this.readAsArray(array);
            this.nextTuple();
        }
        else array = false;
        return array;
    },
/**
*   Gets the current tuple as an object and advances the current tuple pointer.
*   The object's keys are the hierarchy names, and the members of the current tuple are used as values for the keys.
*   For a description of the structure of the member elements, see <code><a href="#method_member">member()</a></code>.
*   @method fetchAsObject
*   @param object {object} An existing object to store the tuple data in. If omitted, a new object is returned.
*   @return {object} An object that represents the current tuple.
*/
    fetchAsObject: function(object){
        if (this.hasMoreTuples(object)){
            object = this.readAsObject();
            this.nextTuple();
        }
        else object = false;
        return object;
    },
/**
*   Fetches all tuples and returns them as an array of arrays.
*   Each element of the returned array is an array of member objects.
*   For a description of the structure of the member elements, see <code><a href="#method_member">member()</a></code>.
*   @method fetchAllAsArray
*   @param rows {array} An existing array to store the tuples in. If omitted, a new array is returned.
*   @return {[[array]]} An array of arrays representing all tuples that belong to this axis.
**/
    fetchAllAsArray: function(rows){
        var row;
        if (!rows) rows = [];
        while((row = this.fetchAsArray())) rows.push(row);
        this.reset();
        return rows;
    },
/**
*   Fetches all tuples and returns them as an array of objects.
*   Each element of the returned array is a tuple object.
*   The object's keys are the hierarchy names, and the members of the current tuple are used as values for the keys.
*   For a description of the structure of the member elements, see <code><a href="#method_member">member()</a></code>.
*   @method fetchAllAsObject
*   @param rows {array} An existing array to store the tuples in. If omitted, a new array is returned.
*   @return {[[object]]} An array of arrays representing all tuples that belong to this axis.
**/
    fetchAllAsObject: function(rows){
        var row;
        if (!rows) rows = [];
        while((row = this.fetchAsObject())) rows.push(row);
        this.reset();
        return rows;
    }
}

/**
*   <p>
*   This class implements a Cellset object.
*   </p>
*   <p>
*   You do not need to instantiate objects of this class yourself.
*   Rather, the <code><a href="Xmla.Dataset.html#class_Xmla.Dataset">Xmla.Dataset</a></code> class creates instances of this class to represent the cells (the value of the measures) of an MDX query.
*   (see <code><a href="Xmla.Dataset.html#method_getCellset">getCellset()</a></code>.)
*
*   @class Xmla.Dataset.Cellset
*   @constructor
*/
Xmla.Dataset.Cellset = function(dataset){
    this._dataset = dataset;
    this._initCellset();
    return this;
}

Xmla.Dataset.Cellset.prototype = {
    _dataset: null,
    _cellNodes: null,
    _cellCount: null,
    _cellNode: null,
    _cellProperties: null,
    _idx: null,
    _cellOrd: null,
    _initCellset: function(){
        var root = this._dataset._root,
            cellSchema, cellSchemaElements, numCellSchemaElements, cellSchemaElement,
            cellInfoNodes, cellInfoNode, type,
            propertyNodes, propertyNode, propertyNodeTagName, numPropertyNodes, i, j
        ;
        cellSchema = _getComplexType(root, "CellData");
        if (!cellSchema)
            Xmla.Exception._newError(
                "ERROR_PARSING_RESPONSE",
                "Xmla.Dataset.Cellset",
                root
            )._throw();
        cellSchemaElements = _getElementsByTagNameNS(
            cellSchema, _xmlnsSchema, _xmlnsSchemaPrefix, "element"
        );
        numCellSchemaElements = cellSchemaElements.length;
        cellInfoNodes = _getElementsByTagNameNS(
            root, _xmlnsDataset, "", "CellInfo"
        );
        if (!cellInfoNodes || cellInfoNodes.length===0)
            Xmla.Exception._newError(
                "ERROR_PARSING_RESPONSE",
                "Xmla.Rowset",
                root
            )._throw();

        cellInfoNode = cellInfoNodes[0];
        propertyNodes = _getElementsByTagNameNS(
            cellInfoNode, _xmlnsDataset, "", "*"
        );
        this._cellProperties = {};
        //examine cell property info so we can parse them
        numPropertyNodes = propertyNodes.length;
        var me = this;
        var makePropertyGetter = function(propertyNodeTagName){
          me["cell" + propertyNodeTagName] = function(){
            return this.cellProperty(propertyNodeTagName);
          };
        };
        for(i = 0; i < numPropertyNodes; i++) {
            propertyNode = propertyNodes[i];
            propertyNodeTagName = propertyNode.nodeName;
            //find the xsd:element node that describes this property
            for (j = 0; j < numCellSchemaElements; j++) {
                cellSchemaElement = cellSchemaElements[j];
                if (_getAttribute(cellSchemaElement, "name") !== propertyNodeTagName) {
                  continue;
                }
                type = _getAttribute(cellSchemaElement, "type");
                this._cellProperties[propertyNodeTagName] = _typeConverterMap[type];
                //this["cell" + propertyNodeTagName] = new Function("return this.cellProperty(\"" + propertyNodeTagName + "\")");
                makePropertyGetter(propertyNodeTagName);
                break;
            }
            //extra: if the schema doesn't explicitly define this property, we somehow have to
            if (!this._cellProperties[propertyNodeTagName]) {
                type = _getAttribute(propertyNode, "type");
                if (!type) {
                  type = (propertyNodeTagName === "Value") ? "xs:decimal" : "xs:string";
                }
                this._cellProperties[propertyNodeTagName] = _typeConverterMap[type];
                //this["cell" + propertyNodeTagName] = new Function("return this.cellProperty(\"" + propertyNodeTagName + "\")");
                makePropertyGetter(propertyNodeTagName);
            }
        }
        this._cellNodes = _getElementsByTagNameNS(
            root, _xmlnsDataset, "", "Cell"
        );
        this._cellCount = this._cellNodes.length;
        this.reset();
    },
    _getCellNode: function(index){
    //console.debug(index);
        if (!_isUnd(index)) {
          this._idx = index;
        }
        this._cellNode = this._cellNodes[this._idx];
        this._cellOrd = this._getCellOrdinal(this._cellNode);
    },
    _getCellOrdinal: function(node){
        return parseInt(_getAttribute(node, "CellOrdinal"), 10);
    },
/**
*   Returns the number of cells contained in this cellset.
*   This is the number of cells that is actually present in the cellset - not the number of logical cells.
*   The nuber of logical cells can be be calculated by multiplying the tuple counts of all axes of the data set.
*   The XML/A provider will typically not return empty cells, hence, the cellCount may be less than the logical cell count.
*   @method cellCount
*   @return {int} The number of cells in this cellset.
*/
    cellCount: function() {
        return this._cellNodes.length;
    },
/**
*   Resets the internal cell pointer to the argument, or to 0 if the argument is omitted.
*   Normally, you shouldn't have to call this method yourself.
*   @method reset
*   @param idx {int}
*/
    reset: function(idx){
        this._idx = idx ? idx : 0;
        if (this.hasMoreCells()) {
          this._getCellNode();
        }
    },
/**
*   Check if there are cells to iterate through.
*   @method hasMoreCells
*   @return {boolean} <code>true</code> if there are more cells to iterate, <code>false</code> if there are no more cells to iterate.
*/
    hasMoreCells: function(){
        return this._idx < this._cellCount;
    },
/**
*   Advance to the next (physical) cell.
*   Note that this method may appear to be skipping cells. This happens when the XML/A provider omits empty cells in the response.
*   @method nextCell
*   @return {int} returns the ordinal of the next cell, or -1 if there was no next cell.
*/
    nextCell: function(){
        this._idx += 1;
        if (this.hasMoreCells()) {
            this._getCellNode();
            return this._cellOrd;
        }
        else {
            this._idx = -1;
            return -1;
        }
    },
/**
*   Returns the internal cell pointer. This is the fysical cell pointer.
*   To get the logical cell pointer, see <code><a href="#method_cellOrdinal">cellOrdinal()</a></code>
*   @method curr
*   @return {int} returns the internal cell pointer.
*/
    curr: function(){
        return this._idx;
    },
/**
*   Check if the cell has the specified property.
*   XML/A defines these standard properties:<ul>
*     <li><code>Value</code></li>
*     <li><code>FmtValue</code></li>
*     <li><code>ForeColor</code></li>
*     <li><code>BackColor</code></li>
*   </ul>
*   Whether all these properties are returned depends on the XML/A provider and on the query.
*   The XML/A provider may return specific additional properties.
*   @method hasCellProperty
*   @param propertyName {string} The name of the property to check for.
*   @return {boolean} returns <code>true</code> if the current cell has the specified property, <code>false</code> if it doesn't.
*/
    hasCellProperty: function(propertyName) {
        return !_isUnd(this._cellProperties[propertyName]);
    },
/**
*   Return the value of the current property of the current cell.
*   XML/A defines these standard properties:<ul>
*     <li><code>Value</code></li>
*     <li><code>FmtValue</code></li>
*     <li><code>ForeColor</code></li>
*     <li><code>BackColor</code></li>
*   </ul>
*   Whether all these properties are returned depends on the XML/A provider and on the query.
*   The XML/A provider may return specific additional properties.
*   @method cellProperty
*   @param propertyName {string} The name of the property to retrieve.
*   @return {mixed} returns the value of the specified property of the current cell.
*/
    cellProperty: function(propertyName){
        var text, type, valueConverter,
            valueEl = _getElementsByTagNameNS(
              this._cellNode, _xmlnsDataset, "", propertyName
            ), value;
        if (valueEl.length) {
          valueEl = valueEl[0];
          text = _getElementValue(valueEl);
          valueConverter = this._cellProperties[propertyName];
          if (!valueConverter) {
              type = _getAttributeNS(
                  valueEl,
                  _xmlnsSchemaInstance,
                  _xmlnsSchemaInstancePrefix,
                  "type"
              );
              valueConverter = _getValueConverter(type);
          }
          value = valueConverter(text);
        }
        else {
          value = null;
        }
        return value;
    },
/**
*   Returns the ordinal number of the current cell.
*   The ordinal is the logical cell pointer, which may be different than the physical cell pointer.
*   To get the physical cell pointer, see <code><a href="#method_curr">curr()</a></code>
*   @method cellOrdinal
*   @return {int} returns the logical cell pointer.
*/
    cellOrdinal: function() {
        return this._cellOrd;
    },
    _readCell: function(node, object){
        var p, cellProp, cellProperty;
        for (p in this._cellProperties){
            cellProp = _getElementsByTagNameNS(
                node, _xmlnsDataset, "", p
            )[0];
            if (!cellProp) {
              continue;
            }
            cellProperty = this._cellProperties[p];
            if (cellProperty) {
              object[p] = cellProperty(_getElementText(cellProp));
            }
            else
            if (p === "Value") {
              object[p] = _getElementValue(cellProp);
            }
            else {
              object[p] = _getElementText(cellProp);
            }
        }
        object.ordinal = this._getCellOrdinal(node);
        return object;
    },
/**
 *  Reads the current cell into the specified object.
*   @method readCell
*   @param {object} object An existing object to use for the current cell. If omitted, a new object will be created.
*   @return {object} An object that represents the current cell.
*/
    readCell: function(object) {
        if (!object) {
          object = {};
        }
        return this._readCell(this._cellNode, object);
    },
/**
 *  Iterate through each cell.
*   @method eachCell
*   @param {function()} callback
*   @param {object} scope
*   @param {object} args
*   @return {boolean}
*/
    eachCell: function(callback, scope, args) {
        var mArgs = [null];
        if (!scope) {
          scope = this;
        }
        if (args) {
            if (!_isArr(args)) {
              args = [args];
            }
            mArgs = mArgs.concat(args);
        }
        var ord;
        while (ord !== -1 && this.hasMoreCells()){
            ord = this.nextCell();
            mArgs[0] = this.readCell();
            if (callback.apply(scope, mArgs)===false) {
              return false;
            }
        }
        this._idx = 0;
        return true;
    },
/**
 *  Get a cell by its physical index.
 *  This method should typically not be called by clients.
 *  Instead, they should use <code><a href="#method_getByOrdinal">getByOrdinal()</a></code>
*   @method getByIndex
*   @param {int} index - the physical index of the cell within the cellset.
*   @param {object} object - optional. An object to copy the properties of the specified cell to. If omitted, a new object will be returned instead.
*   @return {object} An object that represents the cell.
*/
    getByIndex: function(index, object) {
        this._getCellNode(index);
        return this.readCell(object);
    },
/**
 *  Get a cell by its logical index.
*   @method getByOrdinal
*   @param {int} ordinal - the ordinal number of the cell to retrieve.
*   @param {object} object - optional. An object to copy the properties of the specified cell to. If omitted, a new object will be returned instead.
*   @return {object} An object that represents the cell.
*/
    getByOrdinal: function(ordinal, object) {
        var node, ord, idx, lastIndex = this.cellCount() - 1;
        idx = ordinal > lastIndex ? lastIndex : ordinal;
        while(true) {
            node = this._cellNodes[idx];
            ord = this._getCellOrdinal(node);
            if (ord === ordinal) return this.getByIndex(idx, object);
            else
            if (ord > ordinal) idx--;
            else return null;
        }
    },
/**
 *  Get the physical cell index for the specified ordinal number.
 *  This method is useful to calculate boundaries to retrieve a range of cells.
 *  @method indexForOrdinal
 *  @param {int} ordinal - the ordinal number for which the index shoul dbe returned
 *  @return {int} The physical index.
 */
    indexForOrdinal: function(ordinal){
        var cellNodes = this._cellNodes,
            n = cellNodes.length,
            index = Math.min(ordinal, n-1),
            cellOrdinal, node
        ;
        while(index >= 0) {
            //get the node at the current index
            node = cellNodes[index];
            cellOrdinal = this._getCellOrdinal(node);
            if (cellOrdinal === ordinal) {
              return index;
            }
            else
            if (cellOrdinal > ordinal) {
              index--;
            }
            else {
              return -1;
            }
        }
        return -1;
    },
/**
 *  Get a range of cells that fits the specified ordinals.
 *  This method is useful to grab a slice of cells for a subset of the axes.
 *  (You can use <code><a href="#method_cellOrdinalForTupleIndexes">cellOrdinalForTupleIndexes</a></code> to calculate ordinals in terms of tuple indexes.)
 *  The returned range only contains cells that actually exist so the ordinal of adjacent cells may have gaps,
 * @method fetchRangeAsArray
 * @param {int} from - the ordinal number indicating the start of the range
 * @param {int} to - the ordinal number indicating the end of the range
 * @return {[object]} - An array of cells that fit the specified range.
 */
    fetchRangeAsArray: function(from, to){
        var range = [], cellNodes = this._cellNodes, n = cellNodes.length;
        if (n === 0) {
          return range;
        }

        var cellNode, ordinal;
        if (_isUnd(to) || to === -1) {
          to = this._getCellOrdinal(cellNodes[n-1]);
        }
        if (_isUnd(from) || from === -1) {
          from = this._getCellOrdinal(cellNodes[0]);
        }

        //start at to (or at end of array of cells in case empty cells exist)
        var toIndex = Math.min(to, n - 1);
        while (toIndex >= 0) {
          cellNode = cellNodes[toIndex];
          ordinal = this._getCellOrdinal(cellNode);
          if (ordinal <= to) {
            break;
          }
          toIndex -= 1;
        }

        if (toIndex === -1) {
          //Would be very strange to arrive here.
          return range;
        }

        if (ordinal < from) {
          //The ordinal closest to "to" lies before "from" -> no cells are in range.
          return range;
        }

        var fromIndex = Math.min(toIndex, from);
        while (fromIndex >= 0) {
          cellNode = cellNodes[fromIndex];
          ordinal = this._getCellOrdinal(cellNode);
          if (ordinal <= from) {
            if (ordinal < from) {
              fromIndex += 1;
            }
            break;
          }
          fromIndex -= 1;
        }

        if (fromIndex === -1) {
          fromIndex = 0;
        }

        var index;
        for (index = fromIndex; index <= toIndex; index++) {
          cellNode = cellNodes[index];
          range.push(this._readCell(cellNode, {}));
        }
        return range;
    },
/**
 *  Calculate the ordinal based on the specified tuple indexes.
*   @method cellOrdinalForTupleIndexes
*   @param {int...} tuple index - a variable list of integer arguments. Arguments represent the index of a tuple on the query axes. Tuple indexes should be specified by descending order of axes. For example, if you have a DataSet with 2 Axes, pass the row tuple index as the first argument, and the column tuple index as the last argument.
*   @return {int} The ordinal number for this combination of tuple indexes. This return value can be used as argument for <code><a href="#method_getByOrdinal">getByOrdinal()</a></code>
*/
    cellOrdinalForTupleIndexes: function() {
        return this._dataset.cellOrdinalForTupleIndexes.apply(this._dataset, arguments);
    },
/**
 *  Get the cell corresponding to the specified tuple indexes.
*   @method getByTupleIndexes
*   @param {int...} ordinal
*   @return {object}
*/
    getByTupleIndexes: function() {
        return this.getByOrdinal(this.cellOrdinalForTupleIndexes.apply(this, arguments));
    },
/**
 *  Close this cellset.
*   @method close
*/
    close: function(){
        this._dataset = null;
        this._cellNodes = null;
        this._cellNode = null;
    }
}


/**
*   <p>
*   This class is used to indicate an runtime errors occurring in any of the methods of the xmla4js classes.
*   </p>
*   <p>
*   You do not need to instantiate objects of this class yourself.
*   Rather, instances of this class are created and thrown at runtime whenever an error occurs.
*   The purpose is to provide a clean and clear way for applications that use xmla4js to recognize and handle Xmla4js specific runtime errors.
*   </p>
*   <p>
*   To handle Xmla4js errors, you can use a <code>try...catch</code> block like this:
*   </p>
<pre>
&nbsp;try {
&nbsp;    ...general xmla4js work...
&nbsp;} catch (exception) {
&nbsp;    if (exception instanceof Xmla.Exception) {
&nbsp;        ...use exception.code, exception.message and exception.data to handle the exception.
&nbsp;    } else {
&nbsp;        ...handle other errors...
&nbsp;    }
&nbsp;}
</pre>
*
*   @class Xmla.Exception
*   @constructor
*/
Xmla.Exception = function(type, code, message, helpfile, source, data, args, detail, actor){
    this.type = type;
    this.code = code;
    this.message = message;
    this.source = source;
    this.helpfile = helpfile;
    this.data = data;
    this.args = args;
    this.detail = detail;
    this.actor = actor;
    return this;
};

/**
*   Can appear as value for the <code><a href="#property_type">type</a></code> property of instances of the <code><a href="#class_Xmla.Exception">Xmla.Exception</a></code> class,
*   and indicates that this <code>Xmla.Exception</code> signals a warning.
*
*   @property TYPE_WARNING
*   @static
*   @final
*   @type string
*   @default <code>warning</code>
*/
Xmla.Exception.TYPE_WARNING = "warning";
/**
*   Can appear as value for the <code><a href="#property_type">type</a></code> property of instances of the <code><a href="#class_Xmla.Exception">Xmla.Exception</a></code> class,
*   and indicates that this <code>Xmla.Exception</code> signals an error.
*
*   @property TYPE_ERROR
*   @static
*   @final
*   @type string
*   @default <code>error</code>
*/
Xmla.Exception.TYPE_ERROR = "error";

var _exceptionHlp = "http://code.google.com/p/xmla4js/wiki/ExceptionCodes";

/**
*   Exception code indicating a <code>requestType</code> option was expected but ommitted.
*
*   @property MISSING_REQUEST_TYPE_CDE
*   @static
*   @final
*   @type {int}
*   @default <code>-1</code>
*/
Xmla.Exception.MISSING_REQUEST_TYPE_CDE = -1;
Xmla.Exception.MISSING_REQUEST_TYPE_MSG = "Missing_Request_Type";
Xmla.Exception.MISSING_REQUEST_TYPE_HLP = _exceptionHlp +
                                    "#" + Xmla.Exception.MISSING_REQUEST_TYPE_CDE +
                                    "_" + Xmla.Exception.MISSING_REQUEST_TYPE_MSG;
/**
*   Exception code indicating a <code>statement</code> option was expected but ommitted.
*
*   @property MISSING_STATEMENT_CDE
*   @static
*   @final
*   @type {int}
*   @default <code>-2</code>
*/
Xmla.Exception.MISSING_STATEMENT_CDE = -2;
Xmla.Exception.MISSING_STATEMENT_MSG = "Missing_Statement";
Xmla.Exception.MISSING_STATEMENT_HLP = _exceptionHlp +
                                    "#" + Xmla.Exception.MISSING_STATEMENT_CDE +
                                    "_" + Xmla.Exception.MISSING_STATEMENT_MSG;

/**
*   Exception code indicating a <code>url</code> option was expected but ommitted.
*
*   @property MISSING_URL_CDE
*   @static
*   @final
*   @type {int}
*   @default <code>-3</code>
*/
Xmla.Exception.MISSING_URL_CDE = -3;
Xmla.Exception.MISSING_URL_MSG = "Missing_URL";
Xmla.Exception.MISSING_URL_HLP = _exceptionHlp +
                                    "#" + Xmla.Exception.MISSING_URL_CDE +
                                    "_" + Xmla.Exception.MISSING_URL_MSG;

/**
*   Exception code indicating a <code>events</code> were expected but ommitted.
*
*   @property NO_EVENTS_SPECIFIED_CDE
*   @static
*   @final
*   @type {int}
*   @default <code>-4</code>
*/
Xmla.Exception.NO_EVENTS_SPECIFIED_CDE = -4;
Xmla.Exception.NO_EVENTS_SPECIFIED_MSG = "No_Events_Specified";
Xmla.Exception.NO_EVENTS_SPECIFIED_HLP = _exceptionHlp +
                                    "#" + Xmla.Exception.NO_EVENTS_SPECIFIED_CDE  +
                                    "_" + Xmla.Exception.NO_EVENTS_SPECIFIED_MSG;

/**
*   Exception code indicating a <code>events</code> were specifeid in the wrong format.
*
*   @property WRONG_EVENTS_FORMAT_CDE
*   @static
*   @final
*   @type {int}
*   @default <code>-5</code>
*/
Xmla.Exception.WRONG_EVENTS_FORMAT_CDE = -5;
Xmla.Exception.WRONG_EVENTS_FORMAT_MSG = "Wrong_Events_Format";
Xmla.Exception.WRONG_EVENTS_FORMAT_HLP = _exceptionHlp +
                                    "#" + Xmla.Exception.NO_EVENTS_SPECIFIED_CDE  +
                                    "_" + Xmla.Exception.NO_EVENTS_SPECIFIED_MSG;

/**
*   Exception code indicating that the event name was unrecognized.
*
*   @property UNKNOWN_EVENT_CDE
*   @static
*   @final
*   @type {int}
*   @default <code>-6</code>
*/
Xmla.Exception.UNKNOWN_EVENT_CDE = -6;
Xmla.Exception.UNKNOWN_EVENT_MSG = "Unknown_Event";
Xmla.Exception.UNKNOWN_EVENT_HLP = _exceptionHlp +
                                    "#" + Xmla.Exception.UNKNOWN_EVENT_CDE  +
                                    "_" + Xmla.Exception.UNKNOWN_EVENT_MSG;
/**
*   Exception code indicating that no proper handler was passed for the events.
*
*   @property INVALID_EVENT_HANDLER_CDE
*   @static
*   @final
*   @type {int}
*   @default <code>-7</code>
*/
Xmla.Exception.INVALID_EVENT_HANDLER_CDE = -7;
Xmla.Exception.INVALID_EVENT_HANDLER_MSG = "Invalid_Events_Handler";
Xmla.Exception.INVALID_EVENT_HANDLER_HLP = _exceptionHlp +
                                    "#" + Xmla.Exception.INVALID_EVENT_HANDLER_CDE  +
                                    "_" + Xmla.Exception.INVALID_EVENT_HANDLER_MSG;
/**
*   Exception code indicating that the rrepsonse could not be parsed
*
*   @property ERROR_PARSING_RESPONSE_CDE
*   @static
*   @final
*   @type {int}
*   @default <code>-8</code>
*/
Xmla.Exception.ERROR_PARSING_RESPONSE_CDE = -8;
Xmla.Exception.ERROR_PARSING_RESPONSE_MSG = "Error_Parsing_Response";
Xmla.Exception.ERROR_PARSING_RESPONSE_HLP = _exceptionHlp +
                                    "#" + Xmla.Exception.ERROR_PARSING_RESPONSE_CDE  +
                                    "_" + Xmla.Exception.ERROR_PARSING_RESPONSE_MSG ;
/**
*   Exception code indicating the field name is not valid.
*
*   @property INVALID_FIELD_CDE
*   @static
*   @final
*   @type {int}
*   @default <code>-9</code>
*/
Xmla.Exception.INVALID_FIELD_CDE = -9;
Xmla.Exception.INVALID_FIELD_MSG = "Invalid_Field";
Xmla.Exception.INVALID_FIELD_HLP = _exceptionHlp +
                                    "#" + Xmla.Exception.INVALID_FIELD_CDE  +
                                    "_" + Xmla.Exception.INVALID_FIELD_MSG;

/**
*   Exception code indicating a general XMLHttpRequest error.
*   If this error occurs, the data object of the exception will have these members:
*   <ul>
*       <li>request: the options that make up the original HTTP request</li>
*       <li>status: the HTTP status code</li>
*       <li>statusText: the HTTP status text</li>
*   </ul>
*   @property HTTP_ERROR_CDE
*   @static
*   @final
*   @type {int}
*   @default <code>-10</code>
*/
Xmla.Exception.HTTP_ERROR_CDE = -10;
Xmla.Exception.HTTP_ERROR_MSG = "HTTP Error";
Xmla.Exception.HTTP_ERROR_HLP = _exceptionHlp +
                                    "#" + Xmla.Exception.HTTP_ERROR_CDE  +
                                    "_" + Xmla.Exception.HTTP_ERROR_MSG;

/**
*   Exception code indicating the hierarchy name is not valid.
*
*   @property INVALID_HIERARCHY_CDE
*   @static
*   @final
*   @type {int}
*   @default <code>-11</code>
*/
Xmla.Exception.INVALID_HIERARCHY_CDE = -11;
Xmla.Exception.INVALID_HIERARCHY_MSG = "Invalid_Hierarchy";
Xmla.Exception.INVALID_HIERARCHY_HLP = _exceptionHlp +
                                    "#" + Xmla.Exception.INVALID_HIERARCHY_CDE  +
                                    "_" + Xmla.Exception.INVALID_HIERARCHY_MSG;

/**
*   Exception code indicating a problem reading a member property
*
*   @property UNEXPECTED_ERROR_READING_MEMBER_CDE
*   @static
*   @final
*   @type {int}
*   @default <code>-12</code>
*/
Xmla.Exception.UNEXPECTED_ERROR_READING_MEMBER_CDE = -12;
Xmla.Exception.UNEXPECTED_ERROR_READING_MEMBER_MSG = "Error_Reading_Member";
Xmla.Exception.UNEXPECTED_ERROR_READING_MEMBER_HLP = _exceptionHlp +
                                    "#" + Xmla.Exception.UNEXPECTED_ERROR_READING_MEMBER_CDE  +
                                    "_" + Xmla.Exception.UNEXPECTED_ERROR_READING_MEMBER_MSG;

/**
*   Exception code indicating the requested axis does not exist
*
*   @property INVALID_AXIS
*   @static
*   @final
*   @type {int}
*   @default <code>-13</code>
*/
Xmla.Exception.INVALID_AXIS_CDE = -13;
Xmla.Exception.INVALID_AXIS_MSG = "The requested axis does not exist.";
Xmla.Exception.INVALID_AXIS_HLP = _exceptionHlp +
                                    "#" + Xmla.Exception.INVALID_AXIS_CDE  +
                                    "_" + Xmla.Exception.INVALID_AXIS_MSG;

/**
*   Exception code indicating illegal number of axis arguments
*
*   @property ILLEGAL_ARGUMENT
*   @static
*   @final
*   @type {int}
*   @default <code>-14</code>
*/
Xmla.Exception.ILLEGAL_ARGUMENT_CDE = -14;
Xmla.Exception.ILLEGAL_ARGUMENT_MSG = "Illegal arguments";
Xmla.Exception.ILLEGAL_ARGUMENT_HLP = _exceptionHlp +
                                    "#" + Xmla.Exception.ILLEGAL_ARGUMENT_CDE  +
                                    "_" + Xmla.Exception.ILLEGAL_ARGUMENT_MSG;

/**
*   Exception code indicating that we couldn't instantiate a xml http request object
*
*   @property ERROR_INSTANTIATING_XMLHTTPREQUEST
*   @static
*   @final
*   @type {int}
*   @default <code>-15</code>
*/
Xmla.Exception.ERROR_INSTANTIATING_XMLHTTPREQUEST_CDE = -15;
Xmla.Exception.ERROR_INSTANTIATING_XMLHTTPREQUEST_MSG = "Error creating XML Http Request";
Xmla.Exception.ERROR_INSTANTIATING_XMLHTTPREQUEST_HLP = _exceptionHlp +
                                    "#" + Xmla.Exception.ERROR_INSTANTIATING_XMLHTTPREQUEST_CDE  +
                                    "_" + Xmla.Exception.ERROR_INSTANTIATING_XMLHTTPREQUEST_MSG;

Xmla.Exception._newError = function(codeName, source, data){
    return new Xmla.Exception(
        Xmla.Exception.TYPE_ERROR,
        Xmla.Exception[codeName + "_CDE"],
        Xmla.Exception[codeName + "_MSG"],
        Xmla.Exception[codeName + "_HLP"],
        source,
        data
    );
};

Xmla.Exception.prototype = {
/**
*   This propery indicates what kind of exception occurred. It can have one of the following values: <dl>
*       <dt><code><a href="property_TYPE_WARNING">TYPE_WARNING</a></code></dt><dd>Indicates a warning</dd>
*       <dt><code><a href="property_TYPE_ERROR">TYPE_ERROR</a></code></dt><dd>Indicates an error</dd>
*   </dl>
*   @property type
*   @type {string}
*   @default {null}
*/
    type: null,
/**
*   A code that can be used to identify this particular kind of exception.
*   @property code
*   @type {int}
*   @default {null}
*/
    code: null,
/**
*   A human readable message that describes the nature of the error or warning.
*   @property message
*   @type {string}
*   @default {null}
*/
    message: null,
/**
*   A name that indicates in what component (on the client or server side) this error or warning occurred.
*   @property source
*   @type {string}
*   @default {null}
*/
    source: null,
/**
*   A path or url that points to a document that contains more information about this error.
*   @property helpfile
*   @type {string}
*   @default {null}
*/
    helpfile: null,
/**
*   Additional data captured when the exception was instantiated.
*   The type of information stored here is dependent upon the nature of the error.
*   @property data
*   @type {string}
*   @default {null}
*/
    data: null,
    _throw: function(){
        throw this;
    },
/**
*   A reference to the built-in <code>arguments</code> array of the function that is throwing the exception
*   This can be used to get a "stack trace"
*   @property args
*   @type {array}
*/
    args: null,
/**
 *  Returns a string representing this exception
*   @method toString
*   @return a string representing this exception
*/
    toString: function(){
        var string =  this.type + " " +
                      this.code + ": " + this.message +
                      " (source: " + this.source  + ", " +
                      " actor: " + this.actor + ")";
        return string;
    },
/**
 *  Get a stack trace.
*   @method getStackTrace
*   @return an array of objects describing the function on the stack
*/
    getStackTrace: function(){
        var funcstring, stack = "";
        if (this.args) {
            var func = this.args.callee;
            while (func){
                funcstring = String(func);
                func = func.caller;
            }
        }
        return stack;
    }
};

/*
*   Register Xmla.
*   In an amd (https://github.com/amdjs/amdjs-api/wiki/AMD) environment, use the define function
*   Otherwise, add it to the global window variable.
*   For server side environemnts that do not have a proper window object,
*   simply create a global variable called window and assign an object to it that you want to function as the Xmla container.
*/
if (typeof(define)==="function" && define.amd) {
  define(function (){
      return Xmla;
  });
}
else {
  window.Xmla = Xmla;
}
return Xmla;
})(typeof exports === "undefined" ? window : exports);