code: private ElemExtensionDecl getElemExtensionDecl(StylesheetRoot stylesheet,
            String namespace)
    {
  
      ElemExtensionDecl decl = null;
      int n = stylesheet.getGlobalImportCount();
  
      for (int i = 0; i < n; i++)
      {
        Stylesheet imported = stylesheet.getGlobalImport(i);
  
        for (ElemTemplateElement child = imported.getFirstChildElem();
                child != null; child = child.getNextSiblingElem())
        {
          if (Constants.ELEMNAME_EXTENSIONDECL == child.getXSLToken())
          {
            decl = (ElemExtensionDecl) child;
  
            String prefix = decl.getPrefix();
            String declNamespace = child.getNamespaceForPrefix(prefix);
  
            if (namespace.equals(declNamespace))
            {
              return decl;
            }
          }
        }
      }
  
      return null;
    }
docs: Return the ElemExtensionDecl for this extension element
  
  
  @param stylesheet Stylesheet root associated with this extension element
  @param namespace Namespace associated with this extension element
  
  @return the ElemExtensionDecl for this extension element.