Code example for Element

Methods: getAttributeNode, getNodeName

0
      Element root = (Element) node;
      /* AndroidManifest.xml starts with something like 
         <manifest xmlns:android="http://schemas.android.com/apk/res/android" 
                   package="org.foo.simpleandroidapp"> 
       */ 
      if ("manifest".equals(root.getNodeName()) 
          && (root.getAttributeNode("xmlns:android") != null
              || root.getAttributeNode("package") != null)) {
        LOG.log(Level.FINE, "enabled -> {0}", node);
        return true; 
      } 
    } 
    return false; 
  } 
 
  private boolean useLayoutGrammar(GrammarEnvironment ctx) {
    FileObject fo = ctx.getFileObject();
    if (fo == null) {
      return false; 
    } 
    Project p = FileOwnerQuery.getOwner(fo);