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

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

?? xmlparser.java

?? java寫的多功能文件編輯器
?? JAVA
?? 第 1 頁 / 共 5 頁
字號:
// XmlParser.java: the main parser class.// NO WARRANTY! See README, and copyright below.// $Id: XmlParser.java,v 1.1.1.1 2001/08/20 22:31:30 gfx Exp $package com.microstar.xml;import java.io.BufferedInputStream;import java.io.EOFException;import java.io.InputStream;import java.io.Reader;import java.net.URL;import java.net.URLConnection;import java.util.Enumeration;import java.util.Hashtable;import java.util.Stack;/**  * Parse XML documents and return parse events through call-backs.  * <p>You need to define a class implementing the <code>XmlHandler</code>  * interface: an object belonging to this class will receive the  * callbacks for the events.  (As an alternative to implementing  * the full XmlHandler interface, you can simply extend the   * <code>HandlerBase</code> convenience class.)  * <p>Usage (assuming that <code>MyHandler</code> is your implementation  * of the <code>XmlHandler</code> interface):  * <pre>  * XmlHandler handler = new MyHandler();  * XmlParser parser = new XmlParser();  * parser.setHandler(handler);  * try {  *   parser.parse("http://www.host.com/doc.xml", null);  * } catch (Exception e) {  *   [do something interesting]  * }  * </pre>  * <p>Alternatively, you can use the standard SAX interfaces  * with the <code>SAXDriver</code> class as your entry point.  * @author Copyright (c) 1997, 1998 by Microstar Software Ltd.  * @author Written by David Megginson &lt;dmeggins@microstar.com&gt;  * @version 1.1  * @see XmlHandler  * @see HandlerBase  * @see SAXDriver  */public class XmlParser {  //  // Use special cheats that speed up the code (currently about 50%),  // but may cause problems with future maintenance and add to the  // class file size (about 500 bytes).  //  private final static boolean USE_CHEATS = true;  //////////////////////////////////////////////////////////////////////  // Constructors.  ////////////////////////////////////////////////////////////////////////  /**    * Construct a new parser with no associated handler.    * @see #setHandler    * @see #parse    */  public XmlParser ()  {  }  /**    * Set the handler that will receive parsing events.    * @param handler The handler to receive callback events.    * @see #parse    * @see XmlHandler    */  public void setHandler (XmlHandler handler)  {    this.handler = handler;  }  /**    * Parse an XML document from a URI.    * <p>You may parse a document more than once, but only one thread    * may call this method for an object at one time.    * @param systemId The URI of the document.    * @param publicId The public identifier of the document, or null.    * @param encoding The suggested encoding, or null if unknown.    * @exception java.lang.Exception Any exception thrown by your    *            own handlers, or any derivation of java.io.IOException    *            thrown by the parser itself.    */  public void parse (String systemId, String publicId, String encoding)    throws java.lang.Exception  {    doParse(systemId, publicId, null, null, encoding);  }  /**    * Parse an XML document from a byte stream.    * <p>The URI that you supply will become the base URI for    * resolving relative links, but &AElig;lfred will actually read    * the document from the supplied input stream.    * <p>You may parse a document more than once, but only one thread    * may call this method for an object at one time.    * @param systemId The base URI of the document, or null if not    *                 known.    * @param publicId The public identifier of the document, or null    *                 if not known.    * @param stream A byte input stream.    * @param encoding The suggested encoding, or null if unknown.    * @exception java.lang.Exception Any exception thrown by your    *            own handlers, or any derivation of java.io.IOException    *            thrown by the parser itself.    */  public void parse (String systemId, String publicId,		     InputStream stream, String encoding)    throws java.lang.Exception  {    doParse(systemId, publicId, null, stream, encoding);  }  /**    * Parse an XML document from a character stream.    * <p>The URI that you supply will become the base URI for    * resolving relative links, but &AElig;lfred will actually read    * the document from the supplied input stream.    * <p>You may parse a document more than once, but only one thread    * may call this method for an object at one time.    * @param systemId The base URI of the document, or null if not    *                 known.    * @param publicId The public identifier of the document, or null    *                 if not known.    * @param reader A character stream.    * @exception java.lang.Exception Any exception thrown by your    *            own handlers, or any derivation of java.io.IOException    *            thrown by the parser itself.    */  public void parse (String systemId, String publicId, Reader reader)    throws java.lang.Exception  {    doParse(systemId, publicId, reader, null, null);  }  private synchronized void doParse (String systemId, String publicId,				     Reader reader, InputStream stream,				     String encoding)    throws java.lang.Exception  {    basePublicId = publicId;    baseURI = systemId;    baseReader = reader;    baseInputStream = stream;    initializeVariables();  	// Set the default entities here.    setInternalEntity(intern("amp"), "&#38;");    setInternalEntity(intern("lt"), "&#60;");    setInternalEntity(intern("gt"), "&#62;");    setInternalEntity(intern("apos"), "&#39;");    setInternalEntity(intern("quot"), "&#34;");    if (handler != null) {      handler.startDocument();    }    pushURL("[document]", basePublicId, baseURI, baseReader, baseInputStream,	    encoding);    parseDocument();    if (handler != null) {      handler.endDocument();    }    cleanupVariables();  }  ////////////////////////////////////////////////////////////////////////  // Constants.  ////////////////////////////////////////////////////////////////////////  //  // Constants for element content type.  //  /**    * Constant: an element has not been declared.    * @see #getElementContentType    */  public final static int CONTENT_UNDECLARED = 0;  /**    * Constant: the element has a content model of ANY.    * @see #getElementContentType    */  public final static int CONTENT_ANY = 1;  /**    * Constant: the element has declared content of EMPTY.    * @see #getElementContentType    */  public final static int CONTENT_EMPTY = 2;  /**    * Constant: the element has mixed content.    * @see #getElementContentType    */  public final static int CONTENT_MIXED = 3;  /**    * Constant: the element has element content.    * @see #getElementContentType    */  public final static int CONTENT_ELEMENTS = 4;  //  // Constants for the entity type.  //  /**    * Constant: the entity has not been declared.    * @see #getEntityType    */  public final static int ENTITY_UNDECLARED = 0;  /**    * Constant: the entity is internal.    * @see #getEntityType    */  public final static int ENTITY_INTERNAL = 1;  /**    * Constant: the entity is external, non-XML data.    * @see #getEntityType    */  public final static int ENTITY_NDATA = 2;  /**    * Constant: the entity is external XML data.    * @see #getEntityType    */  public final static int ENTITY_TEXT = 3;  //  // Constants for attribute type.  //  /**    * Constant: the attribute has not been declared for this element type.    * @see #getAttributeType    */  public final static int ATTRIBUTE_UNDECLARED = 0;  /**    * Constant: the attribute value is a string value.    * @see #getAttributeType    */  public final static int ATTRIBUTE_CDATA = 1;  /**    * Constant: the attribute value is a unique identifier.    * @see #getAttributeType    */  public final static int ATTRIBUTE_ID = 2;  /**    * Constant: the attribute value is a reference to a unique identifier.    * @see #getAttributeType    */  public final static int ATTRIBUTE_IDREF = 3;  /**    * Constant: the attribute value is a list of ID references.    * @see #getAttributeType    */  public final static int ATTRIBUTE_IDREFS = 4;  /**    * Constant: the attribute value is the name of an entity.    * @see #getAttributeType    */  public final static int ATTRIBUTE_ENTITY = 5;  /**    * Constant: the attribute value is a list of entity names.    * @see #getAttributeType    */  public final static int ATTRIBUTE_ENTITIES = 6;  /**    * Constant: the attribute value is a name token.    * @see #getAttributeType    */  public final static int ATTRIBUTE_NMTOKEN = 7;  /**    * Constant: the attribute value is a list of name tokens.    * @see #getAttributeType    */  public final static int ATTRIBUTE_NMTOKENS = 8;  /**    * Constant: the attribute value is a token from an enumeration.    * @see #getAttributeType    */  public final static int ATTRIBUTE_ENUMERATED = 9;  /**    * Constant: the attribute is the name of a notation.    * @see #getAttributeType    */  public final static int ATTRIBUTE_NOTATION = 10;  //  // When the class is loaded, populate the hash table of  // attribute types.  //  /**    * Hash table of attribute types.    */  private static Hashtable attributeTypeHash;  static {    attributeTypeHash = new Hashtable();    attributeTypeHash.put("CDATA", new Integer(ATTRIBUTE_CDATA));    attributeTypeHash.put("ID", new Integer(ATTRIBUTE_ID));    attributeTypeHash.put("IDREF", new Integer(ATTRIBUTE_IDREF));    attributeTypeHash.put("IDREFS", new Integer(ATTRIBUTE_IDREFS));    attributeTypeHash.put("ENTITY", new Integer(ATTRIBUTE_ENTITY));    attributeTypeHash.put("ENTITIES", new Integer(ATTRIBUTE_ENTITIES));    attributeTypeHash.put("NMTOKEN", new Integer(ATTRIBUTE_NMTOKEN));    attributeTypeHash.put("NMTOKENS", new Integer(ATTRIBUTE_NMTOKENS));    attributeTypeHash.put("NOTATION", new Integer(ATTRIBUTE_NOTATION));  }  //  // Constants for supported encodings.  //  private final static int ENCODING_UTF_8 = 1;  private final static int ENCODING_ISO_8859_1 = 2;  private final static int ENCODING_UCS_2_12 = 3;  private final static int ENCODING_UCS_2_21 = 4;  private final static int ENCODING_UCS_4_1234 = 5;  private final static int ENCODING_UCS_4_4321 = 6;  private final static int ENCODING_UCS_4_2143 = 7;  private final static int ENCODING_UCS_4_3412 = 8;  //  // Constants for attribute default value.  //  /**    * Constant: the attribute is not declared.    * @see #getAttributeDefaultValueType    */  public final static int ATTRIBUTE_DEFAULT_UNDECLARED = 0;  /**    * Constant: the attribute has a literal default value specified.    * @see #getAttributeDefaultValueType    * @see #getAttributeDefaultValue    */  public final static int ATTRIBUTE_DEFAULT_SPECIFIED = 1;  /**    * Constant: the attribute was declared #IMPLIED.    * @see #getAttributeDefaultValueType    */  public final static int ATTRIBUTE_DEFAULT_IMPLIED = 2;  /**    * Constant: the attribute was declared #REQUIRED.    * @see #getAttributeDefaultValueType    */  public final static int ATTRIBUTE_DEFAULT_REQUIRED = 3;  /**    * Constant: the attribute was declared #FIXED.    * @see #getAttributeDefaultValueType    * @see #getAttributeDefaultValue    */  public final static int ATTRIBUTE_DEFAULT_FIXED = 4;  //  // Constants for input.  //  private final static int INPUT_NONE = 0;  private final static int INPUT_INTERNAL = 1;  private final static int INPUT_EXTERNAL = 2;  private final static int INPUT_STREAM = 3;  private final static int INPUT_BUFFER = 4;  private final static int INPUT_READER = 5;  //  // Flags for reading literals.  //  private final static int LIT_CHAR_REF = 1;  private final static int LIT_ENTITY_REF = 2;  private final static int LIT_PE_REF = 4;  private final static int LIT_NORMALIZE = 8;  //  // Flags for parsing context.  //  private final static int CONTEXT_NONE = 0;  private final static int CONTEXT_DTD = 1;  private final static int CONTEXT_ENTITYVALUE = 2;  private final static int CONTEXT_ATTRIBUTEVALUE = 3;  //////////////////////////////////////////////////////////////////////  // Error reporting.  //////////////////////////////////////////////////////////////////////  /**    * Report an error.    * @param message The error message.    * @param textFound The text that caused the error (or null).    * @see XmlHandler#error    * @see #line    */  void error (String message, String textFound, String textExpected)    throws java.lang.Exception  {    errorCount++;    if (textFound != null) {      message = message + " (found \"" + textFound + "\")";    }    if (textExpected != null) {      message = message + " (expected \"" + textExpected + "\")";    }    if (handler != null) {      String uri = null;      if (externalEntity != null) {	uri = externalEntity.getURL().toString();      }      handler.error(message, uri, line, column);    }  }  /**    * Report a serious error.    * @param message The error message.    * @param textFound The text that caused the error (or null).    */  void error (String message, char textFound, String textExpected)    throws java.lang.Exception  {    error(message, new Character(textFound).toString(), textExpected);  }  //////////////////////////////////////////////////////////////////////  // Major syntactic productions.  //////////////////////////////////////////////////////////////////////  /**    * Parse an XML document.    * <pre>    * [1] document ::= prolog element Misc*    * </pre>    * <p>This is the top-level parsing function for a single XML    * document.  As a minimum, a well-formed document must have    * a document element, and a valid document must have a prolog    * as well.    */  void parseDocument ()    throws java.lang.Exception    {    char c;    parseProlog();    require('<');    parseElement();    try      {      parseMisc();  //skip all white, PIs, and comments      c=readCh();   //if this doesn't throw an exception...      error("unexpected characters after document end",c,null);      }    catch (EOFException e)      {return;}    }  /**    * Skip a comment.    * <pre>    * [18] Comment ::= '&lt;!--' ((Char - '-') | ('-' (Char - '-')))* "-->"    * </pre>    * <p>(The <code>&lt;!--</code> has already been read.)    */  void parseComment ()    throws java.lang.Exception  {    skipUntil("-->");  }  /**    * Parse a processing instruction and do a call-back.    * <pre>    * [19] PI ::= '&lt;?' Name (S (Char* - (Char* '?&gt;' Char*)))? '?&gt;'    * </pre>    * <p>(The <code>&lt;?</code> has already been read.)    * <p>An XML processing instruction <em>must</em> begin with    * a Name, which is the instruction's target.    */  void parsePI ()    throws java.lang.Exception  {    String name;    name = readNmtoken(true);    if (!tryRead("?>")) {      requireWhitespace();

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品69毛片高清亚洲| 亚洲欧美日韩国产综合| 91福利在线免费观看| 丁香啪啪综合成人亚洲小说 | 亚洲精选视频免费看| 中文一区一区三区高中清不卡| 欧美精品一区二区不卡| 精品美女在线观看| 精品国产乱码久久久久久老虎| 日韩区在线观看| 欧美大片一区二区三区| 欧美精品一区二区久久久| 国产丝袜美腿一区二区三区| 久久精品欧美一区二区三区不卡| 久久综合九色综合97婷婷| 精品成人一区二区三区四区| 久久欧美一区二区| 中文字幕一区三区| 一区二区在线观看视频 | 精品日韩一区二区三区| 欧美精品一区在线观看| 2022国产精品视频| 亚洲欧美日韩综合aⅴ视频| 午夜精品福利一区二区三区av| 日韩中文字幕不卡| 国产麻豆精品theporn| 色噜噜偷拍精品综合在线| 欧美撒尿777hd撒尿| 欧美成人猛片aaaaaaa| 日本一区二区综合亚洲| 亚洲成人午夜影院| 国产精品一二一区| 欧美日韩高清一区二区| 26uuu精品一区二区 | 色播五月激情综合网| 884aa四虎影成人精品一区| 精品久久久久香蕉网| 国产精品不卡一区| 日韩国产精品久久久| www.一区二区| 欧美一区二区精美| 亚洲天堂2014| 精品一区二区免费看| 在线欧美一区二区| 国产亚洲欧美色| 日韩精品电影一区亚洲| 9久草视频在线视频精品| 日韩午夜精品视频| 亚洲一区二区三区四区在线观看| 国产精品一二三四| 欧美一区二区黄| 亚洲最快最全在线视频| 成人18精品视频| 精品国产亚洲一区二区三区在线观看 | 国产aⅴ综合色| 91精品国产福利在线观看| 成人欧美一区二区三区黑人麻豆 | 亚洲精品综合在线| 国产91色综合久久免费分享| 日韩视频在线你懂得| 亚洲成人中文在线| 欧美色视频在线| 亚洲欧洲99久久| 国产盗摄视频一区二区三区| 欧美xxx久久| 青青草国产精品亚洲专区无| 欧美在线视频你懂得| 亚洲精品日韩一| 91成人网在线| 亚洲国产精品天堂| 欧美色老头old∨ideo| 亚洲精品亚洲人成人网在线播放| 成人福利视频网站| 国产精品蜜臀在线观看| 成人a区在线观看| 国产精品白丝在线| 成人一区二区三区中文字幕| 国产欧美视频一区二区三区| 国产一区不卡视频| 国产精品私房写真福利视频| 高清成人免费视频| 国产精品高潮呻吟久久| 日本电影亚洲天堂一区| 亚洲电影一区二区| 日韩视频在线你懂得| 国产激情精品久久久第一区二区| 国产午夜亚洲精品不卡| 91影院在线观看| 亚洲第一久久影院| 日韩精品专区在线影院重磅| 久久精品国产99国产| 国产无人区一区二区三区| 99综合影院在线| 日韩av电影一区| 久久久777精品电影网影网| 成人aa视频在线观看| 亚洲一二三专区| 欧美电视剧免费全集观看| 国产伦理精品不卡| 亚洲精品久久久蜜桃| 91.麻豆视频| 国产大片一区二区| 亚洲精品一二三区| 日韩精品一区二区三区四区视频 | 亚洲bt欧美bt精品777| 日韩欧美一级特黄在线播放| 国产不卡视频在线观看| 一区二区三区蜜桃| 精品久久久久久久人人人人传媒 | 日韩西西人体444www| 成人免费黄色大片| 日本亚洲免费观看| 中文字幕一区二区在线播放| 欧美美女bb生活片| 99久久99精品久久久久久| 丝袜亚洲另类欧美综合| 亚洲欧洲精品一区二区精品久久久| 欧美日韩一区二区欧美激情| 丁香另类激情小说| 免费看欧美女人艹b| 亚洲三级在线观看| 久久品道一品道久久精品| 欧美色网一区二区| 成人app软件下载大全免费| 麻豆成人久久精品二区三区红| 中文在线免费一区三区高中清不卡| 91精品国产综合久久精品| 在线亚洲一区观看| 国产在线精品一区二区| 日韩高清一区二区| 一区二区三区欧美| 亚洲同性gay激情无套| 26uuu亚洲婷婷狠狠天堂| 欧美精品一二三| 欧美视频中文字幕| 91啦中文在线观看| 成人免费黄色在线| 国产精品99久久久久久久vr| 久久国产剧场电影| 视频在线在亚洲| 亚洲一区二区三区爽爽爽爽爽| 国产精品私人自拍| 国产精品剧情在线亚洲| 久久精品综合网| 久久久另类综合| 26uuu精品一区二区在线观看| 91麻豆精品国产91久久久久| 欧美日韩情趣电影| 欧美日韩高清在线播放| 欧美三级资源在线| 欧美伊人久久久久久久久影院| 91一区二区在线| 91看片淫黄大片一级| 成人一二三区视频| 波多野结衣在线一区| 99久久亚洲一区二区三区青草| 成人久久18免费网站麻豆| 白白色 亚洲乱淫| 91猫先生在线| 欧美无砖专区一中文字| 91免费观看视频| 欧美日韩高清一区二区三区| 91 com成人网| 国产亚洲精品bt天堂精选| 久久婷婷国产综合精品青草| 久久色在线视频| 国产精品白丝在线| 亚洲成a人片综合在线| 麻豆一区二区三| 国产精品一区在线观看你懂的| av午夜一区麻豆| 欧美日韩中文字幕一区二区| 欧美精品自拍偷拍动漫精品| 日韩午夜电影av| 中文字幕视频一区| 婷婷一区二区三区| 激情亚洲综合在线| 91在线码无精品| 欧美精品少妇一区二区三区| 久久久亚洲高清| 亚洲黄色小视频| 精品一区二区三区在线观看| 岛国精品在线观看| 7777精品久久久大香线蕉| 久久蜜桃av一区二区天堂| 亚洲精品v日韩精品| 狠狠色丁香久久婷婷综| 91国偷自产一区二区开放时间| 日韩一级二级三级| 国产精品毛片a∨一区二区三区| 亚洲一区二区视频| 国产成人精品亚洲日本在线桃色| 在线观看亚洲一区| 久久看人人爽人人| 五月天网站亚洲| a亚洲天堂av| 久久午夜羞羞影院免费观看| 亚洲免费观看高清在线观看| 极品销魂美女一区二区三区| 色天使色偷偷av一区二区|