Package com.google.gwt.xml.client

Examples of com.google.gwt.xml.client.NamedNodeMap


  return element.getAttribute(name);
    }

    public HashMap<String, String> getAttributes() {
  final HashMap<String, String> map = new HashMap<String, String>();
  final NamedNodeMap attributes = element.getAttributes();
  for (int index = 0; index < attributes.getLength(); index++) {
      final Node attrib = attributes.item(index);
      map.put(attrib.getNodeName(), attrib.getNodeValue());
  }
  return map;
    }
View Full Code Here


  return map;
    }

    public Map<String, String> getAttributtes() {
  final HashMap<String, String> attributes = new HashMap<String, String>();
  final NamedNodeMap original = element.getAttributes();
  for (int index = 0; index < original.getLength(); index++) {
      final Node node = original.item(index);
      attributes.put(node.getNodeName(), node.getNodeValue());
  }
  return attributes;
    }
View Full Code Here

            (applicationElement.getAttributes().getNamedItem(WadlXml.application_xsi_schemaLocation) != null)) {
          Analyzer analyzer = new Analyzer("");       
          application = new ApplicationNode(analyzer);       
          analyzer.setApplication(application);
         
          NamedNodeMap attributes = applicationElement.getAttributes();
          for (int i = 0; i < attributes.getLength(); i++) {
            Node attribute = attributes.item(i);
            if ((attribute.getNodeName().equals(WadlXml.application_xmlns)) ||
                (attribute.getNodeName().equals(WadlXml.application_xmlns_xsd)) ||
                (attribute.getNodeName().equals(WadlXml.application_xmlns_xsi)) ||
                (attribute.getNodeName().equals(WadlXml.application_xsi_schemaLocation))) {
              continue;
View Full Code Here

   * Ensures that a certain node contains only white-listed attributes
   * @param node The node to check
   * @param allowedAttributes The allowed attributes
   */
  private boolean containsOnlyAllowedAttributes(Node node, String[] allowedAttributes) {   
    NamedNodeMap attributeNodes = node.getAttributes();
    for (int i = 0; i < attributeNodes.getLength(); i++) {     
      if (!Tools.contains(allowedAttributes, attributeNodes.item(i).getNodeName())) {       
        return false;      
      }     
    }
    return true;
  }
View Full Code Here


    private Image parseImage(Node imageNode) {
        Image image = null;
        if (imageNode != null) {
            NamedNodeMap attributes = imageNode.getAttributes();
            if (attributes != null) {
                image = new Image(attributes.getNamedItem("url").getNodeValue());
            }
        }
        return image;
    }
View Full Code Here

          .getChildElements(dataSetNode.getChildNodes());
      List<DataEntry> results = new ArrayList<DataEntry>();

      for (Node dataNode : dataSetNodeChildren) {
        DataEntry dataEntry = new DataEntry();
        NamedNodeMap dataNodeAttributes = dataNode.getAttributes();

        Node valueNode = DOMUtil.getChildElements(
            dataNode.getChildNodes()).get(0); // expected to have
                              // just one child‚
        NamedNodeMap valueNodeAttributes = valueNode.getAttributes();

        dataEntry.key = dataNodeAttributes.getNamedItem("key")
            .getNodeValue();
        dataEntry.java = dataNodeAttributes.getNamedItem("javaType")
            .getNodeValue();
        dataEntry.xsd = valueNodeAttributes.getNamedItem("xsi:type")
            .getNodeValue();

        List<Node> valueChildElements = DOMUtil
            .getChildElements(valueNode.getChildNodes());
View Full Code Here

      // TODO : pass this assertion
      // assertEquals("#cdata-section",
      // ageProperty.getFirstChild().getNodeName());

      // "spouse" child bean assertions
      NamedNodeMap innerBeanAgePropertyAttributes = beanList.item(1).getChildNodes().item(0).getAttributes();
      assertEquals("age", innerBeanAgePropertyAttributes.getNamedItem("name").getNodeValue());
      assertEquals("11", innerBeanAgePropertyAttributes.getNamedItem("value").getNodeValue());

      // bean from "util" namespace
      Element name = (Element) testBean.getNextSibling();
      assertEquals("property-path", name.getTagName());
      assertEquals("property-path", name.getNodeName());
View Full Code Here

      List<DataEntry> results = new ArrayList<DataEntry>();

      for(Node dataNode : dataSetNodeChildren)
      {
        DataEntry dataEntry = new DataEntry();
        NamedNodeMap dataNodeAttributes = dataNode.getAttributes();

        Node valueNode = DOMUtil.getChildElements(dataNode.getChildNodes()).get(0); // expected to have just one child‚
        NamedNodeMap valueNodeAttributes = valueNode.getAttributes();

        dataEntry.key = dataNodeAttributes.getNamedItem("key").getNodeValue();
        dataEntry.java = dataNodeAttributes.getNamedItem("javaType").getNodeValue();
        dataEntry.xsd = valueNodeAttributes.getNamedItem("xsi:type").getNodeValue();

        List<Node> valueChildElements = DOMUtil.getChildElements(valueNode.getChildNodes());

        if(valueChildElements.isEmpty()
            && valueNode.hasChildNodes()
View Full Code Here

      List<DataEntry> results = new ArrayList<DataEntry>();

      for(Node dataNode : dataSetNodeChildren)
      {
        DataEntry dataEntry = new DataEntry();
        NamedNodeMap dataNodeAttributes = dataNode.getAttributes();

        Node valueNode = filterChildNodes(dataNode.getChildNodes()).get(0); // expected to have just one child‚
        NamedNodeMap valueNodeAttributes = valueNode.getAttributes();

        dataEntry.key = dataNodeAttributes.getNamedItem("key").getNodeValue();
        dataEntry.java = dataNodeAttributes.getNamedItem("javaType").getNodeValue();
        dataEntry.xsd = valueNodeAttributes.getNamedItem("xsi:type").getNodeValue();

        List<Node> valueChildElements = filterChildNodes(valueNode.getChildNodes());
       
        if(valueChildElements.isEmpty()
            && valueNode.hasChildNodes()
View Full Code Here

        for (int i = 0; i < node.getLength(); i++) {
            Node nd = node.item(i);
            switch (nd.getNodeType()) {
                case Node.ELEMENT_NODE:
                    HashMap<String, String> attr = new HashMap<String, String>();
                    NamedNodeMap nnm = nd.getAttributes();
                    for (int j = 0; j < nnm.getLength(); j++) {
                        Node nm = nnm.item(j);
                        attr.put(nm.getNodeName(), nm.getNodeValue());
                    }
                    handler.onNodeStart(nd.getNodeName(), attr, nd.getNamespaceURI());
                    processNodes(nd.getChildNodes());
                    handler.onNodeEnd(nd.getNodeName());
View Full Code Here

TOP

Related Classes of com.google.gwt.xml.client.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.