Examples of nsIDOMNamedNodeMap


Examples of org.mozilla.interfaces.nsIDOMNamedNodeMap

    } else {
      for(int i = 0; i < tab; i++) {
        builder.append(' ');
      }
      builder.append('<').append(node.getNodeName());
      nsIDOMNamedNodeMap attributes = node.getAttributes();
      if(attributes != null)  {
        for(long i = 0; i < attributes.getLength(); i++) {
          nsIDOMNode attr = attributes.item(i);
          builder.append(' ').append(attr.getNodeName());
          builder.append('=').append('\"').append(attr.getNodeValue()).append('\"');
        }
      }
      builder.append('>');
View Full Code Here

Examples of org.mozilla.interfaces.nsIDOMNamedNodeMap

    * @return   the map of attributes.
    */
   public static Map<String, String> attributes(nsIDOMNode node) {
      Map<String, String> attributes = new HashMap<String, String>();

      nsIDOMNamedNodeMap node_map = node.getAttributes();
      if (null != node_map) {
         for (long l = 0, len = node_map.getLength(); l < len; l++) {
            nsIDOMNode attribute = node_map.item(l);
            String name = attribute.getNodeName();
            String value = attribute.getNodeValue();
            attributes.put(name, value);
            }
         }
View Full Code Here

Examples of org.mozilla.interfaces.nsIDOMNamedNodeMap

    * @return   the value of the attribute if present, {@code null} otherwise.
    */
   public static String getAttributeValue(nsIDOMNode node, String name) {
      String value = null;

      nsIDOMNamedNodeMap attributes = node.getAttributes();
      if (null != attributes) {
         nsIDOMNode attribute = attributes.getNamedItem(name);
         if (null != attribute) {
            value = attribute.getNodeValue();
            }
         }

View Full Code Here

Examples of org.mozilla.interfaces.nsIDOMNamedNodeMap

    * @param   node   the node to inspect.
    */
   public static void inspectAttributes(nsIDOMNode node) {
      boolean has_attributes = node.hasAttributes();
      if (has_attributes) {
         nsIDOMNamedNodeMap attributes = node.getAttributes();
         long len = attributes.getLength();
         System.out.println("The node has " + len + " attributes");
         for (long i = 0; i < len; i++) {
            nsIDOMAttr attribute = (nsIDOMAttr) attributes.item(i).queryInterface(nsIDOMAttr.NS_IDOMATTR_IID);
            System.out.println("Attribute #" + i + " -> " + attribute.getName() + "=" + attribute.getValue());
            }
         }
      else {
         System.out.println("The node does not have attributes");
View Full Code Here

Examples of org.mozilla.interfaces.nsIDOMNamedNodeMap

    * @return   the map of attributes.
    */
   public static Map<String, String> attributes(nsIDOMNode node) {
      Map<String, String> attributes = new HashMap<String, String>();

      nsIDOMNamedNodeMap node_map = node.getAttributes();
      if (null != node_map) {
         for (long l = 0, len = node_map.getLength(); l < len; l++) {
            nsIDOMNode attribute = node_map.item(l);
            String name = attribute.getNodeName();
            String value = attribute.getNodeValue();
            attributes.put(name, value);
            }
         }
View Full Code Here

Examples of org.mozilla.interfaces.nsIDOMNamedNodeMap

    * @return   the value of the attribute if present, {@code null} otherwise.
    */
   public static String getAttributeValue(nsIDOMNode node, String name) {
      String value = null;

      nsIDOMNamedNodeMap attributes = node.getAttributes();
      if (null != attributes) {
         nsIDOMNode attribute = attributes.getNamedItem(name);
         if (null != attribute) {
            value = attribute.getNodeValue();
            }
         }

View Full Code Here

Examples of org.mozilla.interfaces.nsIDOMNamedNodeMap

   //        itemtype="http://schema.org/CreativeWork"
   //        itemscope=""
   //        style="padding:0px; margin: 0px 0px 10px 0px; width:100%">

      final nsIDOMNode table = context.mock(nsIDOMNode.class);
      final nsIDOMNamedNodeMap map = context.mock(nsIDOMNamedNodeMap.class);

      final nsIDOMNode[] nodes = new nsIDOMNode[] {
         context.mock(nsIDOMNode.class, "cellspacing"),
         context.mock(nsIDOMNode.class, "cellpadding"),
         context.mock(nsIDOMNode.class, "itemtype"),
View Full Code Here

Examples of org.mozilla.interfaces.nsIDOMNamedNodeMap

    * @param   node   the node to inspect.
    */
   public static void inspectAttributes(nsIDOMNode node) {
      boolean has_attributes = node.hasAttributes();
      if (has_attributes) {
         nsIDOMNamedNodeMap attributes = node.getAttributes();
         long len = attributes.getLength();
         System.out.println("The node has " + len + " attributes");
         for (long i = 0; i < len; i++) {
            nsIDOMAttr attribute = (nsIDOMAttr) attributes.item(i).queryInterface(nsIDOMAttr.NS_IDOMATTR_IID);
            System.out.println("Attribute #" + i + " -> " + attribute.getName() + "=" + attribute.getValue());
            }
         }
      else {
         System.out.println("The node does not have attributes");
View Full Code Here

Examples of org.mozilla.interfaces.nsIDOMNamedNodeMap

   public boolean eval(nsIDOMNode node) {
      boolean evaluation = false;

      boolean has_attribute = node.hasAttributes();
      if (has_attribute) {
         nsIDOMNamedNodeMap attributes = node.getAttributes();

         String name = this.getName();
         nsIDOMNode attribute = attributes.getNamedItem(name);

         if (null != attribute) {
            Pattern pattern = this.getPattern();
            String value = attribute.getNodeValue();
            Matcher matcher = pattern.matcher(value);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.