Package hu.jokeman.xparser.document

Examples of hu.jokeman.xparser.document.DocumentBuilder


        _name.append ((char) firstChar);
    }

  public ParserState process (int ch) throws ParserException {
        char c = (char) ch;
        DocumentBuilder builder = getDocumentBuilder ();
       
    if (_isShort && c != '>') {
      throw new ParserException ("Invalid short tag.");
    }
       
    if (XMLCharacterSet.isNameChar (c)) {
      if (_isAdded) {
        return new AttributeState (builder, this, ch);
      }
      _name.append (c);
            return this;
    }
       
        if (XMLCharacterSet.isWhiteSpace (c)) {
      if (!_isAdded) {
        builder.createTagStart (_name.toString ());
        _isAdded = true;
      }
      return this;
    }
       
        if (c == '/') {
      _isShort = true;
      return this;
    }
       
        if (c == '>') {
      if (!_isAdded) {
        builder.createTagStart (_name.toString ());
      }
      builder.finishTagStart ();
      if (_isShort) {
        builder.addTagClose (_name.toString ());
      }
      return new NormalState (builder);
    }
   
    throw new ParserException ("Illegal character '" + c + "'.");
View Full Code Here

TOP

Related Classes of hu.jokeman.xparser.document.DocumentBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.