Package org.w3c.dom

Examples of org.w3c.dom.NamedNodeMap


  /// @synopsis array getEntities()
  /// @return array of entities of <i>document type</i> node
  public Any m_getEntities()
  { 
    if (_type == Node.DOCUMENT_TYPE_NODE) {
      NamedNodeMap map = ((DocumentType)_node).getEntities();
      int length = map.getLength();
      Array entities = new Array(length);
      for(int i=0; i<length; i++) {
        Node entity = map.item(i);
        if (entity.getNodeType() == Node.DOCUMENT_TYPE_NODE) {
          entities.append(((DocumentType)entity).getName(), new AnyNode(entity));
        }
      }
      return entities;
View Full Code Here


  /// @synopsis array getNotations()
  /// @return array of notations of <i>document type</i> node
  public Any m_getNotations()
  {
    if (_type == Node.DOCUMENT_TYPE_NODE) {
      NamedNodeMap map = ((DocumentType)_node).getNotations();
      int length = map.getLength();
      Array notations = new Array(length);
      for(int i=0; i<length; i++) {
        Node entity = map.item(i);
        if (entity.getNodeType() == Node.DOCUMENT_TYPE_NODE) {
          notations.append(((DocumentType)entity).getName(), new AnyNode(entity));
        }
      }
      return notations;
View Full Code Here

  public void modelChanged(ModelChangeEvent e) throws GUIException {
    MapChangeEvent event = (MapChangeEvent) e;

    if (event.getKey().equals("value")) {
      if (propertyNode.getNodeName().equals("property")) {
        NamedNodeMap map = propertyNode.getAttributes();
        for (int i = 0; i < map.getLength(); i++) {
          String name = map.item(i).getNodeName();
          if (!name.equals("name") && !name.equals("type")) {
            propertyNode.removeAttribute(map.item(i).getNodeName());
          }
        }

        if (!propertyNode.getAttribute("name").equals("border")) {
          NodeList children = propertyNode.getChildNodes();
View Full Code Here

    activateType(dataModel.getValue("type").toString());
  }

  protected void doOK() throws GUIException {
    NamedNodeMap map = anchorNode.getAttributes();
    for (int i = 0; i < map.getLength(); i++) {
      anchorNode.removeAttribute(map.item(i).getNodeName());
    }

    String type = dataModel.getValue("type").toString();

    if (!type.equals("none")) {
View Full Code Here

      final String off = "\n" + offset;

      if (node instanceof Element) {
         String name = node.getNodeName();
         // String value = node.getNodeValue();
         NamedNodeMap attrs = node.getAttributes();
         StringBuffer buf = new StringBuffer(128);
         StringBuffer buf1 = new StringBuffer(50);

         buf.append(off).append("<").append(name);
         if (attrs != null && attrs.getLength() > 0) {
            for (int i=0; i < attrs.getLength(); i++) {
               Node attr = attrs.item(i);
               buf.append(" ").append(attr.getNodeName()).append("='").append(attr.getNodeValue()).append("'");
            }
         }
         boolean hasChilds = node.hasChildNodes();
         if (!hasChilds) {
View Full Code Here

        assertEquals( "element.getNodeName()", name, element.getNodeName() );

        final NodeList nodeList = element.getChildNodes();
        assertEquals( "nodeList.getLength()", 0, nodeList.getLength() );

        final NamedNodeMap attributes = element.getAttributes();
        assertEquals( "attributes.getLength()", 0, attributes.getLength() );
    }
View Full Code Here

        final NodeList nodeList = element.getChildNodes();
        assertEquals( "nodeList.getLength()", 1, nodeList.getLength() );
        final Node node = nodeList.item( 0 );
        assertEquals( "element[0].value", value, node.getNodeValue() );

        final NamedNodeMap attributes = element.getAttributes();
        assertEquals( "attributes.getLength()", 0, attributes.getLength() );
    }
View Full Code Here

        assertEquals( "element.getNodeName()", name, element.getNodeName() );

        final NodeList nodeList = element.getChildNodes();
        assertEquals( "nodeList.getLength()", 0, nodeList.getLength() );

        final NamedNodeMap attributes = element.getAttributes();
        assertEquals( "attributes.getLength()", 1, attributes.getLength() );
        final Node node = attributes.item( 0 );
        assertEquals( "attribute[0].name", key, node.getNodeName() );
        assertEquals( "attribute[0].value", value, node.getNodeValue() );
    }
View Full Code Here

        final NodeList nodeList = element.getChildNodes();
        assertEquals( "nodeList.getLength()", 1, nodeList.getLength() );
        final Node node = nodeList.item( 0 );
        assertEquals( "element[0].name", childName, node.getNodeName() );

        final NamedNodeMap attributes = element.getAttributes();
        assertEquals( "attributes.getLength()", 0, attributes.getLength() );

    }
View Full Code Here

  private void buildDOM(Document doc) throws DOMException {
    NodeList nl = doc.getElementsByTagName("component");
    for (int i=0; i<nl.getLength(); i++) {
      Node n = nl.item(i);
      NamedNodeMap nn = n.getAttributes();
      String className = nn.getNamedItem("class").getNodeValue();
      String key = nn.getNamedItem("name").getNodeValue();
      log.info(" name of the class to load: " + className);
      log.info("class will be stored with key " + key+ " in hashtable");
      try {
        Class cl = java.lang.Class.forName(className);
        if (cl!=null){
View Full Code Here

TOP

Related Classes of org.w3c.dom.NamedNodeMap

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.