Package org.allcolor.xml.parser.dom

Examples of org.allcolor.xml.parser.dom.CElement


    inXInclude--;
      } // end if
  } // end if

  CElement elem = null;
  if (parser.htmlDocument) {
      elem = document.createElementInternal(name, indexSep);
      if (currentElement != document && elem instanceof IHtmlValidChild) {
    while (!isValidChild(name, currentElement)) {
        parseEndTag(currentElement.name, -1);
        if (currentElement == document)
      break;
    }
      }
  } else {
      elem = new CElement(name, document, indexSep);
  }

  if (firstTag) {
      if (parser.htmlDocument) {
    document.setHTMLDocument(true);
      } // end if
      firstTag = false;
      document.loadXSD(elem);
      if (isAutodoctype() && document.getDoctype() == null) {
    CDocType dt = (CDocType) CXmlParser.dtTr.cloneNode(true);
    document.appendChildInternal(dt);
    document.setDocumentType(dt);
      }
  } // end if

  if (count > 0) {
      if (elem.listAttributes == null) {
    elem.listAttributes = new CNamedNodeMap(elem);
    elem.listAttributes.list = attributes;
    elem.listAttributes.count = count;
    for (int i = 0; i < count; i++) {
        CAttr attr = attributes[i];
        attr.parentNode = elem;
        attr.ownerDocument = document;
        if (attr.name == "xmlns" || attr.prefix == "xmlns") {
      elem.notifyNSChange(attr.localName);
        }
    }
      } else {
    for (int i = 0; i < count; i++) {
        CAttr attr = attributes[i];
        attr.parentNode = elem;
        attr.ownerDocument = document;
        if (attr.name == "xmlns" || attr.prefix == "xmlns") {
      elem.notifyNSChange(attr.localName);
        }
        if (elem.listAttributes == null) {
      elem.listAttributes = new CNamedNodeMap(elem);
        }
        elem.listAttributes.setNamedItemForce(attr);
    } // end for
      }
  }

  if (currentElement == document) {
      document.appendChildInternal(elem);
  } else {
      elem.parentNode = currentElement;
      currentElement.listChild.addItem(elem);
  }

  if (XIncludeAware
    && "http://www.w3.org/2001/XInclude".equals(elem
      .getNamespaceURI())) {
      handleXInclude(elem);

      if (inXInclude > 0) {
    if (name.endsWith("include")) {
View Full Code Here


                );
            elem.setNameOverride(type);
            return elem;
        } else {
          if (indexSep == -1) {
              return new CElement(
                      type,
                      ownerDocument
                  );
          } else {
              return new CElement(
                      type,
                      ownerDocument,
                      indexSep
                  );
          }
View Full Code Here

    inXInclude--;
      } // end if
  } // end if

  CElement elem = null;
  if (parser.htmlDocument) {
      elem = document.createElementInternal(name, indexSep);
      if (currentElement != document && elem instanceof IHtmlValidChild) {
    while (!isValidChild(name, currentElement)) {
        parseEndTag(currentElement.name, -1);
        if (currentElement == document)
      break;
    }
      }
  } else {
      elem = new CElement(name, document, indexSep);
  }
  elem.listChild = new CNodeList(false);

  if (firstTag) {
      if (parser.htmlDocument) {
    document.setHTMLDocument(true);
      } // end if
      firstTag = false;
      document.loadXSD(elem);
      if (isAutodoctype() && document.getDoctype() == null) {
    CDocType dt = (CDocType) CXmlParser.dtTr.cloneNode(true);
    document.appendChildInternal(dt);
    document.setDocumentType(dt);
      }
  } // end if

  if (count > 0) {
      if (elem.listAttributes == null) {
    elem.listAttributes = new CNamedNodeMap(elem);
    elem.listAttributes.list = attributes;
    elem.listAttributes.count = count;
    for (int i = 0; i < count; i++) {
        CAttr attr = attributes[i];
        attr.parentNode = elem;
        attr.ownerDocument = document;
        if (attr.name == "xmlns" || attr.prefix == "xmlns") {
      elem.notifyNSChange(attr.localName);
        }
    }
      } else {
    for (int i = 0; i < count; i++) {
        CAttr attr = attributes[i];
        attr.parentNode = elem;
        attr.ownerDocument = document;
        if (attr.name == "xmlns" || attr.prefix == "xmlns") {
      elem.notifyNSChange(attr.localName);
        }
        if (elem.listAttributes == null) {
      elem.listAttributes = new CNamedNodeMap(elem);
        }
        elem.listAttributes.setNamedItemForce(attr);
    } // end for
      }
  }

  if (currentElement == document) {
      document.appendChildInternal(elem);
  } else {
      elem.parentNode = currentElement;
      currentElement.listChild.addItem(elem);
  }

  if (XIncludeAware
    && "http://www.w3.org/2001/XInclude".equals(elem
      .getNamespaceURI())) {
      handleXInclude(elem);
  } // end if
  else {
      if (parser.htmlDocument && elem instanceof IHtmlValidChild) {
View Full Code Here

         *                 DOCUMENT ME!
         */
  public void startElement(final String uri, final String localName,
    final String qName, final Attributes atts) throws SAXException {
      if (currentElement.getNodeType() != Node.ENTITY_REFERENCE_NODE) {
    CElement elem = new CElement(qName, document);

    for (int i = 0; i < atts.getLength(); i++) {
        CAttr attr = new CAttr(atts.getQName(i), atts.getValue(i),
          document, currentElement, true);
        if (currentElement.listAttributes == null) {
View Full Code Here

                );
            elem.setNameOverride(type);
            return elem;
        } else {
          if (indexSep == -1) {
              return new CElement(
                      type,
                      ownerDocument
                  );
          } else {
              return new CElement(
                      type,
                      ownerDocument,
                      indexSep
                  );
          }
View Full Code Here

TOP

Related Classes of org.allcolor.xml.parser.dom.CElement

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.