param = new ParameterNode(paramName, expr, global);
param = new ParameterNode(paramName, expr, type);
  void doParse(Node node, boolean root)    throws TransformerConfigurationException  {    try      {        String namespaceUri = node.getNamespaceURI();        if (XSL_NS.equals(namespaceUri) &&            node.getNodeType() == Node.ELEMENT_NODE)          {            String name = node.getLocalName();            NamedNodeMap attrs = node.getAttributes();            if ("stylesheet".equals(name))              {                version = getAttribute(attrs, "version");                String eep = getAttribute(attrs, "extension-element-prefixes");                if (eep != null)                  {                    StringTokenizer st = new StringTokenizer(eep);                    while (st.hasMoreTokens())                      {                        extensionElementPrefixes.add(st.nextToken());                      }                  }                String erp = getAttribute(attrs, "exclude-result-prefixes");                if (erp != null)                  {                    StringTokenizer st = new StringTokenizer(erp);                    while (st.hasMoreTokens())                      {                        excludeResultPrefixes.add(st.nextToken());                      }                  }                parse(node.getFirstChild(), false);              }            else if ("template".equals(name))              {                templates.add(parseTemplate(node, attrs));              }            else if ("param".equals(name) ||                     "variable".equals(name))              {                boolean global = "variable".equals(name);                TemplateNode content = parse(node.getFirstChild());                String paramName = getRequiredAttribute(attrs, "name", node);                String select = getAttribute(attrs, "select");                ParameterNode param;                if (select != null && select.length() > 0)                  {                    if (content != null)                      {                        String msg = "parameter '" + paramName +                          "' has both select and content";                        DOMSourceLocator l = new DOMSourceLocator(node);                        throw new TransformerConfigurationException(msg, l);                      }                    Expr expr = (Expr) xpath.compile(select);                    param = new ParameterNode(paramName, expr, global);                  }                else                  {                    param = new ParameterNode(paramName, null, global);                    param.children = content;                  }                variables.add(param);                bindings.set(paramName, content, global);              }            else if ("include".equals(name) || "import".equals(name))              {                int delta = "import".equals(name) ? -1 : 0;                String href = getRequiredAttribute(attrs, "href", node);                Source source;                synchronized (factory.resolver)                  {                    if (transformer != null)                      {                        factory.resolver                          .setUserResolver(transformer.getURIResolver());                        factory.resolver                          .setUserListener(transformer.getErrorListener());                      }                    source = factory.resolver.resolve(systemId, href);                  }                factory.newStylesheet(source, precedence + delta, this);              }            else if ("output".equals(name))              {                parseOutput(node, attrs);              }            else if ("preserve-space".equals(name))              {                String elements =                  getRequiredAttribute(attrs, "elements", node);                StringTokenizer st = new StringTokenizer(elements,                                                         " \t\n\r");                while (st.hasMoreTokens())                  {                    preserveSpace.add(parseNameTest(st.nextToken()));                  }              }            else if ("strip-space".equals(name))              {                String elements =                  getRequiredAttribute(attrs, "elements", node);                StringTokenizer st = new StringTokenizer(elements,                                                         " \t\n\r");                while (st.hasMoreTokens())                  {                    stripSpace.add(parseNameTest(st.nextToken()));                  }              }            else if ("key".equals(name))              {                parseKey(node, attrs);              }            else if ("decimal-format".equals(name))              {                parseDecimalFormat(node, attrs);              }            else if ("namespace-alias".equals(name))              {                parseNamespaceAlias(node, attrs);              }            else if ("attribute-set".equals(name))              {                parseAttributeSet(node, attrs);              }          }        else if (root)          {            // Literal document element            Attr versionNode =              ((Element)node).getAttributeNodeNS(XSL_NS, "version");            if (versionNode == null)              {                String msg = "no xsl:version attribute on literal result node";                DOMSourceLocator l = new DOMSourceLocator(node);                throw new TransformerConfigurationException(msg, l);              }            version = versionNode.getValue();            Node rootClone = node.cloneNode(true);            NamedNodeMap attrs = rootClone.getAttributes();            attrs.removeNamedItemNS(XSL_NS, "version");            templates.add(new Template(this, null, new Root(),                                       parse(rootClone),                                       precedence,                                       Template.DEFAULT_PRIORITY,                                       null));          }        else          {            // Skip unknown elements, text, comments, etc          }      }    catch (TransformerException e)      {        DOMSourceLocator l = new DOMSourceLocator(node);        throw new TransformerConfigurationException(e.getMessage(), l, e);      }    catch (DOMException e)      {        DOMSourceLocator l = new DOMSourceLocator(node);        throw new TransformerConfigurationException(e.getMessage(), l, e);      }    catch (XPathExpressionException e)      {        DOMSourceLocator l = new DOMSourceLocator(node);        throw new TransformerConfigurationException(e.getMessage(), l, e);      }  }