亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? xml.java

?? AJAX基礎編程--源代碼
?? JAVA
字號:
package org.json;/*Copyright (c) 2002 JSON.orgPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.The Software shall be used for Good, not Evil.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.*/import java.util.Iterator;import java.text.ParseException;/** * This provides static methods to convert an XML text into a JSONObject, * and to covert a JSONObject into an XML text. * @author JSON.org * @version 0.1 */public class XML {    private XML() {}    /** The Character '&'. */    public static final Character AMP   = new Character('&');    /** The Character '''. */    public static final Character APOS  = new Character('\'');    /** The Character '!'. */    public static final Character BANG  = new Character('!');    /** The Character '='. */    public static final Character EQ    = new Character('=');    /** The Character '>'. */    public static final Character GT    = new Character('>');    /** The Character '<'. */    public static final Character LT    = new Character('<');    /** The Character '?'. */    public static final Character QUEST = new Character('?');    /** The Character '"'. */    public static final Character QUOT  = new Character('"');    /** The Character '/'. */    public static final Character SLASH = new Character('/');    /**     * Replace special characters with XML escapes:      * <pre>     * &amp; is replaced by &amp;amp;      * &lt; is replaced by &amp;lt;      * &gt; is replaced by &amp;gt;     * &quot; is replaced by &amp;quot;      * </pre>     */    public static String escape(String string) {        return string            .replaceAll("&", "&amp;")            .replaceAll("<", "&lt;")            .replaceAll(">", "&gt;")            .replaceAll("\"", "&quot;");    }    /**     * Scan the content following the named tag, attaching it to the context.     * @param x       The XMLTokener containing the source string.     * @param context The JSONObject that will include the new material.     * @param name    The tag name.     * @return true if the close tag is processed.     * @throws ParseException     */    private static boolean parse(XMLTokener x, JSONObject context,                                 String name) throws ParseException {        char       c;        int        i;        String     n;        JSONObject o;        String     s;        Object     t;// Test for and skip past these forms://      <!-- ... -->//      <!   ...   >//      <![  ... ]]>//      <?   ...  ?>// Report errors for these forms://      <>//      <=//      <<        t = x.nextToken();// <!        if (t == BANG) {            c = x.next();            if (c == '-') {                if (x.next() == '-') {                    x.skipPast("-->");                    return false;                }                x.back();            } else if (c == '[') {                x.skipPast("]]>");                return false;            }            i = 1;            do {                t = x.nextMeta();                if (t == null) {                    throw x.syntaxError("Missing '>' after '<!'.");                } else if (t == LT) {                    i += 1;                } else if (t == GT) {                    i -= 1;                }            } while (i > 0);            return false;        } else if (t == QUEST) {// <?            x.skipPast("?>");            return false;        } else if (t == SLASH) {// Close tag </            if (name == null || !x.nextToken().equals(name)) {                throw x.syntaxError("Mismatched close tag");            }            if (x.nextToken() != GT) {                throw x.syntaxError("Misshaped close tag");            }            return true;        } else if (t instanceof Character) {            throw x.syntaxError("Misshaped tag");// Open tag <        } else {            n = (String)t;            t = null;            o = new JSONObject();            while (true) {                if (t == null) {                    t = x.nextToken();                }// attribute = value                if (t instanceof String) {                    s = (String)t;                    t = x.nextToken();                    if (t == EQ) {                        t = x.nextToken();                        if (!(t instanceof String)) {                            throw x.syntaxError("Missing value");                        }                        o.accumulate(s, t);                        t = null;                    } else {                        o.accumulate(s, Boolean.TRUE);                    }// Empty tag <.../>                } else if (t == SLASH) {                    if (x.nextToken() != GT) {                        throw x.syntaxError("Misshaped tag");                    }                    if (o.length() == 0) {                        context.accumulate(n, Boolean.TRUE);                    } else {                        context.accumulate(n, o);                    }                    return false;// Content, between <...> and </...>                } else if (t == GT) {                    while (true) {                        t = x.nextContent();                        if (t == null) {                            if (name != null) {                                throw x.syntaxError("Unclosed tag " + name);                            }                            return false;                        } else if (t instanceof String) {                            s = (String)t;                            if (s.length() > 0) {                                o.accumulate("content", s);                            }// Nested element                        } else if (t == LT) {                            if (parse(x, o, n)) {                                if (o.length() == 0) {                                    context.accumulate(n, Boolean.TRUE);                                } else if (o.length() == 1 &&                                           o.opt("content") != null) {                                    context.accumulate(n, o.opt("content"));                                } else {                                    context.accumulate(n, o);                                }                                return false;                            }                        }                    }                } else {                    throw x.syntaxError("Misshaped tag");                }            }        }    }    /**     * Convert a well-formed (but not necessarily valid) XML string into a     * JSONObject. Some information may be lost in this transformation     * because JSON is a data format and XML is a document format. XML uses     * elements, attributes, and content text, while JSON uses unordered     * collections of name/value pairs and arrays of values. JSON does not     * does not like to distinguish between elements and attributes.     * Sequences of similar elements are represented as JSONArrays. Content     * text may be placed in a "content" member. Comments, prologs, DTDs, and     * <code>&lt;[ [ ]]></code> are ignored.     * @param string The source string.     * @return A JSONObject containing the structured data from the XML string.     * @throws ParseException     */    public static JSONObject toJSONObject(String string) throws ParseException {        JSONObject o = new JSONObject();        XMLTokener x = new XMLTokener(string);        while (x.more()) {            x.skipPast("<");            parse(x, o, null);        }        return o;    }    /**     * Convert a JSONObject into a well-formed XML string.     * @param o A JSONObject.     * @return A string.     */    public static String toString(Object o) {        return toString(o, null);    }    /**     * Convert a JSONObject into a well-formed XML string.     * @param o A JSONObject.     * @param tagName The optional name of the enclosing tag.     * @return A string.     */    public static String toString(Object o, String tagName) {        StringBuffer a = null; // attributes, inside the <...>        StringBuffer b = new StringBuffer(); // body, between <...> and </...>        int          i;        JSONArray    ja;        JSONObject   jo;        String       k;        Iterator     keys;        int          len;        String       s;        Object       v;        if (o instanceof JSONObject) {// Emit <tagName            if (tagName != null) {                a = new StringBuffer();                a.append('<');                a.append(tagName);            }// Loop thru the keys. Some keys will produce attribute material, others// body material.            jo = (JSONObject)o;            keys = jo.keys();            while (keys.hasNext()) {                k = keys.next().toString();                v = jo.get(k);                if (v instanceof String) {                    s = (String)v;                } else {                    s = null;                }// Emit a new tag <k... in body                if (tagName == null || v instanceof JSONObject ||                        (s != null && k != "content" && (s.length() > 60 ||                        (s.indexOf('"') >= 0 && s.indexOf('\'') >= 0)))) {                    b.append(toString(v, k));// Emit content in body                } else if (k.equals("content")) {                    b.append(escape(v.toString()));// Emit an array of similar keys in body                } else if (v instanceof JSONArray) {                    ja = (JSONArray)v;                    len = ja.length();                    for (i = 0; i < len; i += 1) {                        b.append(toString(ja.get(i), k));                    }// Emit an attribute                } else {                    a.append(' ');                    a.append(k);                    a.append('=');                    a.append(toString(v));                }            }            if (tagName != null) {// Close an empty element                if (b.length() == 0) {                    a.append("/>");                } else {// Close the start tag and emit the body and the close tag                    a.append('>');                    a.append(b);                    a.append("</");                    a.append(tagName);                    a.append('>');                }                return a.toString();            }            return b.toString();// XML does not have good support for arrays. If an array appears in a place// where XML is lacking, synthesize an <array> element.        } else if (o instanceof JSONArray) {            ja = (JSONArray)o;            len = ja.length();            for (i = 0; i < len; ++i) {                b.append(toString(                    ja.opt(i), (tagName == null) ? "array" : tagName));            }            return b.toString();        } else {            s = (o == null) ? "null" : escape(o.toString());            return (tagName == null) ?                 "\"" + s + "\"" :                 "<" + tagName + ">" + s + "</" + tagName + ">";        }    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文乱码免费一区二区| 五月天激情小说综合| 欧美日本高清视频在线观看| 久久精品免费观看| 国产精品免费av| 日韩欧美色综合网站| 欧美最猛性xxxxx直播| 成人av网站在线| 韩国精品免费视频| 日韩av在线播放中文字幕| 亚洲图片欧美激情| 国产日韩欧美综合在线| 欧美一区二区三区啪啪| 欧美日韩色综合| 99久久伊人网影院| 国产99久久久国产精品| 久久福利资源站| 日韩不卡一二三区| 天天做天天摸天天爽国产一区| 亚洲女人的天堂| 亚洲欧洲精品天堂一级| 亚洲国产精品99久久久久久久久| 欧美大片一区二区| 日韩欧美一级二级三级| 欧美精品日韩综合在线| 欧美综合天天夜夜久久| 91网站最新网址| www.日韩在线| av电影在线不卡| 成人激情电影免费在线观看| 国产精品一区二区三区乱码| 激情欧美一区二区三区在线观看| 麻豆精品一二三| 久久99久久99| 国产综合久久久久久鬼色| 国产综合色精品一区二区三区| 看电视剧不卡顿的网站| 久久99蜜桃精品| 韩国三级电影一区二区| 国产一区高清在线| 国产成人免费视频网站| 成人免费视频播放| 91碰在线视频| 欧美影院午夜播放| 91精品欧美久久久久久动漫| 欧美一级黄色录像| 久久久精品国产免大香伊| 久久精品夜夜夜夜久久| 国产精品久久99| 亚洲免费在线电影| 五月激情综合色| 久久电影网站中文字幕| 国产成人av电影免费在线观看| 成人综合在线观看| 在线观看日韩电影| 日韩一区和二区| 久久精品男人天堂av| 国产精品成人午夜| 亚洲国产日韩一区二区| 美女高潮久久久| 国产91对白在线观看九色| 91在线免费视频观看| 欧美中文字幕一区| 精品国产3级a| 国产精品久久久久一区二区三区| 亚洲精品免费在线播放| 日韩精品三区四区| 国产成人日日夜夜| 在线一区二区视频| 日韩精品一区二区三区四区| 国产精品视频yy9299一区| 一区二区三区日韩欧美精品| 久久不见久久见免费视频1| 成人伦理片在线| 欧美精品粉嫩高潮一区二区| 久久久精品天堂| 亚洲国产sm捆绑调教视频| 理论电影国产精品| 色综合天天性综合| 精品日韩在线一区| 亚洲免费在线观看视频| 国产一区二区三区精品视频| 一本久久精品一区二区 | 337p亚洲精品色噜噜狠狠| 精品久久久久久综合日本欧美 | 免费视频最近日韩| eeuss鲁片一区二区三区| 4438x成人网最大色成网站| 国产精品久久二区二区| 免费观看久久久4p| 色婷婷精品久久二区二区蜜臀av| 日韩精品一区国产麻豆| 一区二区三区高清不卡| 国产精品18久久久久久久久 | 亚洲成av人**亚洲成av**| 国产一区二区看久久| 欧美日韩在线精品一区二区三区激情| 久久久久国产精品人| 日韩影视精彩在线| 99国产精品久久久久久久久久久 | 色偷偷88欧美精品久久久| 久久综合成人精品亚洲另类欧美| 亚洲图片欧美一区| 成人激情黄色小说| 久久这里只有精品6| 日韩中文字幕区一区有砖一区| bt7086福利一区国产| 国产偷国产偷精品高清尤物 | 日本一区二区三区久久久久久久久不 | 亚洲成av人**亚洲成av**| 不卡大黄网站免费看| 久久久久久免费毛片精品| 首页国产欧美日韩丝袜| 欧洲人成人精品| 亚洲女人的天堂| fc2成人免费人成在线观看播放| 精品国产一区二区三区久久久蜜月 | 亚洲男人的天堂av| aaa欧美色吧激情视频| 国产喂奶挤奶一区二区三区| 免费成人深夜小野草| 欧美日韩美少妇| 亚洲第四色夜色| 欧美综合在线视频| 一区二区三区资源| 色婷婷综合久久久中文一区二区| 国产精品理论在线观看| 不卡视频一二三| 1000部国产精品成人观看| 成人小视频免费观看| 日本一区二区综合亚洲| 懂色一区二区三区免费观看| 久久精品亚洲一区二区三区浴池| 国产一区二区视频在线| 久久久久久免费毛片精品| 国产精品亚洲人在线观看| 亚洲国产电影在线观看| 成人天堂资源www在线| 日韩一区在线看| 色屁屁一区二区| 亚洲电影一级片| 欧美精品丝袜久久久中文字幕| 日韩av电影免费观看高清完整版在线观看| 在线播放欧美女士性生活| 秋霞午夜鲁丝一区二区老狼| 日韩欧美成人午夜| 国产精品2024| 亚洲少妇中出一区| 欧美日韩在线精品一区二区三区激情| 丝袜美腿一区二区三区| 欧美大片在线观看一区| 国产91清纯白嫩初高中在线观看| 国产精品国产三级国产三级人妇| 99久久99久久精品免费观看| 亚洲图片自拍偷拍| 日韩女优av电影| 粉嫩高潮美女一区二区三区 | 5566中文字幕一区二区电影| 经典一区二区三区| 国产日韩欧美制服另类| 91麻豆国产在线观看| 日韩中文字幕亚洲一区二区va在线| 欧美一区二区三区日韩视频| 国产91精品露脸国语对白| 一区二区三区在线看| 日韩免费看网站| av高清久久久| 日韩影院在线观看| 亚洲国产精品v| 欧美精品在线观看播放| 国产盗摄一区二区三区| 亚洲免费伊人电影| 精品国产sm最大网站免费看| 99国产精品久久久久久久久久| 偷窥少妇高潮呻吟av久久免费| 久久久久久久电影| 91成人国产精品| 国产伦精品一区二区三区视频青涩 | 国产精品系列在线| 欧美在线啊v一区| 国产综合成人久久大片91| 一区二区三区成人| 在线中文字幕一区| 另类综合日韩欧美亚洲| 国产精品久久久久婷婷二区次| 欧美性大战久久久| 国产一区二区视频在线| 一区二区三区.www| 欧美精品一区二区在线观看| 欧美日韩美女一区二区| 成人午夜视频网站| 美女视频黄频大全不卡视频在线播放| 亚洲国产精品t66y| 欧美一区二区成人| 91网站视频在线观看| 国产精品综合二区| 午夜精品一区二区三区三上悠亚| 国产精品五月天| 欧美电影免费观看高清完整版在| 91黄色小视频|