/*
(non-Javadoc)
@see
org.exoplatform.services.jcr.impl.xml.importing.SystemViewImporter#startElement
(java.lang.String , java.lang.String, java.lang.String, java.util.Map)
342003
@Override
   public void startElement(String namespaceURI, String localName, String name, Map<String, String> atts)
      throws RepositoryException
   {
      InternalQName elementName = locationFactory.parseJCRName(name).getInternalName();

      if (Constants.SV_NODE_NAME.equals(elementName))
      {
         // sv:node element

         // node name (value of sv:name attribute)
         String svName = getAttribute(atts, Constants.SV_NAME_NAME);
         if (svName == null)
         {
            throw new RepositoryException("Missing mandatory sv:name attribute of element sv:node");
         }
         String svId = getAttribute(atts, Constants.EXO_ID_NAME);
         if (svId == null)
         {
            throw new RepositoryException("Missing mandatory exo:id attribute of element sv:node");
         }

         ImportNodeData newNodeData;
         InternalQName currentNodeName;
         int nodeIndex = 1;
         NodeData parentData = getParent();
         if (!isFirstElementChecked)
         {
            if (!ROOT_NODE_NAME.equals(svName))
            {
               throw new RepositoryException("The first element must be root. But found '" + svName + "'");
            }

            isFirstElementChecked = true;
         }

         if (ROOT_NODE_NAME.equals(svName))
         {
            // remove the wrong root from the stack
            tree.pop();

            newNodeData = addChangesForRootNodeInitialization(parentData);
         }
         else
         {
            currentNodeName = locationFactory.parseJCRName(svName).getInternalName();
            nodeIndex = getNodeIndex(parentData, currentNodeName, null);
            newNodeData = new ImportNodeData(parentData, currentNodeName, nodeIndex);
            newNodeData.setOrderNumber(getNextChildOrderNum(parentData));
            newNodeData.setIdentifier(svId);
            changesLog.add(new ItemState(newNodeData, ItemState.ADDED, true, parentData.getQPath()));
         }
         tree.push(newNodeData);

         mapNodePropertiesInfo.put(newNodeData.getIdentifier(), new NodePropertiesInfo(newNodeData));
      }
      else
      {
         super.startElement(namespaceURI, localName, name, atts);
         if (Constants.SV_PROPERTY_NAME.equals(elementName))
         {
            String svId = getAttribute(atts, Constants.EXO_ID_NAME);
            if (svId == null)
            {
               throw new RepositoryException("Missing mandatory exo:id attribute of element sv:property");
            }
            propertyInfo.setIndentifer(svId);
         }
      }
   }
40207
def startElement (self, name, attrs):
                '''
                '''
                func = getattr(self, 'start_' + name, None)
                if func:
                        func(attrs)
1156420
def startElement(self, name, attrs):
        
        if name in self.ignore_start:
            return
        try:
            handler = getattr(self, '_handle_start_%s' % name)
        except AttributeError:
            raise KeyError("Unknown element start '%s'" % name)
        handler(attrs)
385054
public void startElementBuilder(final String tagName,
                                    final Attributes attrs) {

        this.attrs = attrs;

        this.characters = new StringBuilder();

        final Element element = this.document.createElement( tagName );

        //final DefaultConfiguration config = new DefaultConfiguration( tagName );

        final int numAttrs = attrs.getLength();

        for ( int i = 0; i < numAttrs; ++i ) {
            element.setAttribute( attrs.getLocalName( i ),
                                  attrs.getValue( i ) );
        }

        if ( this.configurationStack.isEmpty() ) {
            this.configurationStack.addLast( element );
        } else {
            ((Element) this.configurationStack.getLast()).appendChild( element );
            this.configurationStack.addLast( element );
        }
    }
600147
@Override
  public void startElement(String namespaceURI, String lName,
                           String qName, Attributes attrs) throws SAXException {
    switch (qName) {
      case "category":
        String catName = attrs.getValue(NAME);
        String catId = attrs.getValue(ID);
        Category.Location location = YES.equals(attrs.getValue(EXTERNAL)) ?
                Category.Location.EXTERNAL : Category.Location.INTERNAL;
        boolean onByDefault = !OFF.equals(attrs.getValue(DEFAULT));
        String tabName = attrs.getValue(TABNAME);
        category = new Category(catId != null ? new CategoryId(catId) : null, catName, location, onByDefault, tabName);
        if (attrs.getValue(TYPE) != null) {
          categoryIssueType = attrs.getValue(TYPE);
        }
        break;
      case "rules":
        String languageStr = attrs.getValue("lang");
        idPrefix = attrs.getValue("idprefix");
        language = Languages.getLanguageForShortCode(languageStr);
        break;
      case "regexp":
        inRegex = true;
        regexMode = "exact".equals(attrs.getValue("type")) ? RegexpMode.EXACT : RegexpMode.SMART;
        regexCaseSensitive = attrs.getValue(CASE_SENSITIVE) != null && YES.equals(attrs.getValue(CASE_SENSITIVE));
        regexpMark = attrs.getValue(MARK) != null ? Integer.parseInt(attrs.getValue(MARK)) : 0;
        break;
      case RULE:
        regex = new StringBuilder();
        inRule = true;
        shortMessage = new StringBuilder();
        message = new StringBuilder();
        suggestionsOutMsg = new StringBuilder();
        url = new StringBuilder();
        id = idPrefix != null ? idPrefix + attrs.getValue(ID) : attrs.getValue(ID);
        name = attrs.getValue(NAME);
        if (inRuleGroup) {
          subId++;
          if (id == null) {
            id = ruleGroupId;
          }
          if (name == null) {
            name = ruleGroupDescription;
          }
        }

        if (inRuleGroup && ruleGroupDefaultOff && attrs.getValue(DEFAULT) != null) {
          throw new RuntimeException("Rule group " + ruleGroupId + " is off by default, thus rule " + id + " cannot specify 'default=...'");
        }
        if (inRuleGroup && ruleGroupDefaultOff) {
          defaultOff = true;
        } else {
          defaultOff = OFF.equals(attrs.getValue(DEFAULT));
        }

        correctExamples = new ArrayList<>();
        incorrectExamples = new ArrayList<>();
        errorTriggeringExamples = new ArrayList<>();
        suggestionMatches.clear();
        suggestionMatchesOutMsg.clear();
        if (attrs.getValue(TYPE) != null) {
          ruleIssueType = attrs.getValue(TYPE);
        }
        break;
      case PATTERN:
        startPattern(attrs);
        tokenCountForMarker = 0;
        interpretPosTagsPreDisambiguation = YES.equals(attrs.getValue(RAW_TAG));
        break;
      case ANTIPATTERN:
        inAntiPattern = true;
        antiPatternCounter++;
        caseSensitive = YES.equals(attrs.getValue(CASE_SENSITIVE));
        tokenCounter = 0;
        tokenCountForMarker = 0;
        break;
      case AND:
        inAndGroup = true;
        tokenCountForMarker++;
        break;
      case OR:
        inOrGroup = true;
        tokenCountForMarker++;
        break;
      case UNIFY:
        inUnification = true;
        uniNegation = YES.equals(attrs.getValue(NEGATE));
        break;
      case UNIFY_IGNORE:
        inUnificationNeutral = true;
        break;
      case FEATURE:
        uFeature = attrs.getValue(ID);
        break;
      case TYPE:
        uType = attrs.getValue(ID);
        uTypeList.add(uType);
        break;
      case TOKEN:
        setToken(attrs);
        if (!inAndGroup && !inOrGroup) {
          tokenCountForMarker++;
        }
        break;
      case EXCEPTION:
        setExceptions(attrs);
        break;
      case EXAMPLE:
        String typeVal = attrs.getValue(TYPE);
        if ("incorrect".equals(typeVal) || attrs.getValue("correction") != null) {
          inIncorrectExample = true;
          incorrectExample = new StringBuilder();
          exampleCorrection = new StringBuilder();
          if (attrs.getValue("correction") != null) {
            exampleCorrection.append(attrs.getValue("correction"));
          }
        } else if ("triggers_error".equals(typeVal)) {
          inErrorTriggerExample = true;
          errorTriggerExample = new StringBuilder();
        } else {
          // no attribute implies the sentence is a correct example
          inCorrectExample = true;
          correctExample = new StringBuilder();
        }
        break;
      case "filter":
        filterClassName = attrs.getValue("class");
        filterArgs = attrs.getValue("args");
        break;
      case MESSAGE:
        inMessage = true;
        inSuggestion = false;
        message = new StringBuilder();
        break;
      case SUGGESTION:
        if (YES.equals(attrs.getValue("suppress_misspelled"))) {
          message.append(PLEASE_SPELL_ME);
        }
        if (inMessage) {
          message.append("<suggestion>");
        } else {  //suggestions outside message
          suggestionsOutMsg.append("<suggestion>");
        }
        inSuggestion = true;
        break;
      case "short":
        if (inRule) {
          inShortMessage = true;
          shortMessage = new StringBuilder();
        } else {
          inShortMessageForRuleGroup = true;
          shortMessageForRuleGroup = new StringBuilder();
        }
        break;
      case "url":
        if (inRule) {
          inUrl = true;
          url = new StringBuilder();
        } else {
          inUrlForRuleGroup = true;
          urlForRuleGroup = new StringBuilder();
        }
        break;
      case RULEGROUP:
        ruleGroupId = attrs.getValue(ID);
        ruleGroupDescription = attrs.getValue(NAME);
        ruleGroupDefaultOff = OFF.equals(attrs.getValue(DEFAULT));
        urlForRuleGroup = new StringBuilder();
        shortMessageForRuleGroup = new StringBuilder();
        inRuleGroup = true;
        subId = 0;
        if (attrs.getValue(TYPE) != null) {
          ruleGroupIssueType = attrs.getValue(TYPE);
        }
        break;
      case MATCH:
        setMatchElement(attrs);
        break;
      case MARKER:
        if (inIncorrectExample) {
          incorrectExample.append(MARKER_TAG);
        } else if (inCorrectExample) {
          correctExample.append(MARKER_TAG);
        } else if (inErrorTriggerExample) {
          errorTriggerExample.append(MARKER_TAG);
        } else if (inPattern || inAntiPattern) {
          startPos = tokenCounter;
          inMarker = true;
        }
        break;
      case UNIFICATION:
        uFeature = attrs.getValue("feature");
        inUnificationDef = true;
        break;
      case "equivalence":
        uType = attrs.getValue(TYPE);
        break;
      case PHRASES:
        inPhrases = true;
        break;
      case "includephrases":
        break;
      case "phrase":
        if (inPhrases) {
          phraseId = attrs.getValue(ID);
        }
        break;
      case "phraseref":
        if (attrs.getValue("idref") != null) {
          preparePhrase(attrs);
          tokenCountForMarker++;
        }
        break;
    }
  }
179894
public void startElement(String elemName, Attributes attrs) {
        writeStartElement(elemName, attrs);
        m_tagStack.push(elemName);
    }
561322
public void startElement(String uri, String name, String qName, Attributes atts)
    {
        boolean isDebug = logger.isDebugEnabled();
        try
        {
            switch (getLiteralId(qName))
            {
                case JDBC_CONNECTION_DESCRIPTOR:
                    {
                        if (isDebug) logger.debug("   > " + tags.getTagById(JDBC_CONNECTION_DESCRIPTOR));
                        JdbcConnectionDescriptor newJcd = new JdbcConnectionDescriptor();
                        currentAttributeContainer = newJcd;

                        conDesList.add(newJcd);
                        m_CurrentJCD = newJcd;

                        // set the jcdAlias attribute
                        String jcdAlias = atts.getValue(tags.getTagById(JCD_ALIAS));
                        if (isDebug) logger.debug("     " + tags.getTagById(JCD_ALIAS) + ": " + jcdAlias);
                        m_CurrentJCD.setJcdAlias(jcdAlias);

                        // set the jcdAlias attribute
                        String defaultConnection = atts.getValue(tags.getTagById(DEFAULT_CONNECTION));
                        if (isDebug) logger.debug("     " + tags.getTagById(DEFAULT_CONNECTION) + ": " + defaultConnection);
                        m_CurrentJCD.setDefaultConnection(Boolean.valueOf(defaultConnection).booleanValue());
                        if (m_CurrentJCD.isDefaultConnection())
                        {
                            if (defaultConnectionFound)
                            {
                                throw new MetadataException("Found two jdbc-connection-descriptor elements with default-connection=\"true\"");
                            }
                            else
                            {
                                defaultConnectionFound = true;
                            }
                        }

                        // set platform attribute
                        String platform = atts.getValue(tags.getTagById(DBMS_NAME));
                        if (isDebug) logger.debug("     " + tags.getTagById(DBMS_NAME) + ": " + platform);
                        m_CurrentJCD.setDbms(platform);

                        // set jdbc-level attribute
                        String level = atts.getValue(tags.getTagById(JDBC_LEVEL));
                        if (isDebug) logger.debug("     " + tags.getTagById(JDBC_LEVEL) + ": " + level);
                        m_CurrentJCD.setJdbcLevel(level);

                        // set driver attribute
                        String driver = atts.getValue(tags.getTagById(DRIVER_NAME));
                        if (isDebug) logger.debug("     " + tags.getTagById(DRIVER_NAME) + ": " + driver);
                        m_CurrentJCD.setDriver(driver);

                        // set protocol attribute
                        String protocol = atts.getValue(tags.getTagById(URL_PROTOCOL));
                        if (isDebug) logger.debug("     " + tags.getTagById(URL_PROTOCOL) + ": " + protocol);
                        m_CurrentJCD.setProtocol(protocol);

                        // set subprotocol attribute
                        String subprotocol = atts.getValue(tags.getTagById(URL_SUBPROTOCOL));
                        if (isDebug) logger.debug("     " + tags.getTagById(URL_SUBPROTOCOL) + ": " + subprotocol);
                        m_CurrentJCD.setSubProtocol(subprotocol);

                        // set the dbalias attribute
                        String dbalias = atts.getValue(tags.getTagById(URL_DBALIAS));
                        if (isDebug) logger.debug("     " + tags.getTagById(URL_DBALIAS) + ": " + dbalias);
                        m_CurrentJCD.setDbAlias(dbalias);

                        // set the datasource attribute
                        String datasource = atts.getValue(tags.getTagById(DATASOURCE_NAME));
                        // check for empty String
                        if(datasource != null && datasource.trim().equals("")) datasource = null;
                        if (isDebug) logger.debug("     " + tags.getTagById(DATASOURCE_NAME) + ": " + datasource);
                        m_CurrentJCD.setDatasourceName(datasource);

                        // set the user attribute
                        String user = atts.getValue(tags.getTagById(USER_NAME));
                        if (isDebug) logger.debug("     " + tags.getTagById(USER_NAME) + ": " + user);
                        m_CurrentJCD.setUserName(user);

                        // set the password attribute
                        String password = atts.getValue(tags.getTagById(USER_PASSWD));
                        if (isDebug) logger.debug("     " + tags.getTagById(USER_PASSWD) + ": " + password);
                        m_CurrentJCD.setPassWord(password);

                        // set eager-release attribute
                        String eagerRelease = atts.getValue(tags.getTagById(EAGER_RELEASE));
                        if (isDebug) logger.debug("     " + tags.getTagById(EAGER_RELEASE) + ": " + eagerRelease);
                        m_CurrentJCD.setEagerRelease(Boolean.valueOf(eagerRelease).booleanValue());

                        // set batch-mode attribute
                        String batchMode = atts.getValue(tags.getTagById(BATCH_MODE));
                        if (isDebug) logger.debug("     " + tags.getTagById(BATCH_MODE) + ": " + batchMode);
                        m_CurrentJCD.setBatchMode(Boolean.valueOf(batchMode).booleanValue());

                        // set useAutoCommit attribute
                        String useAutoCommit = atts.getValue(tags.getTagById(USE_AUTOCOMMIT));
                        if (isDebug) logger.debug("     " + tags.getTagById(USE_AUTOCOMMIT) + ": " + useAutoCommit);
                        m_CurrentJCD.setUseAutoCommit(Integer.valueOf(useAutoCommit).intValue());

                        // set ignoreAutoCommitExceptions attribute
                        String ignoreAutoCommitExceptions = atts.getValue(tags.getTagById(IGNORE_AUTOCOMMIT_EXCEPTION));
                        if (isDebug) logger.debug("     " + tags.getTagById(IGNORE_AUTOCOMMIT_EXCEPTION) + ": " + ignoreAutoCommitExceptions);
                        m_CurrentJCD.setIgnoreAutoCommitExceptions(Boolean.valueOf(ignoreAutoCommitExceptions).booleanValue());

                        break;
                    }
                case CONNECTION_POOL:
                    {
                        if (m_CurrentJCD != null)
                        {
                            if (isDebug) logger.debug("    > " + tags.getTagById(CONNECTION_POOL));
                            final ConnectionPoolDescriptor m_CurrentCPD = m_CurrentJCD.getConnectionPoolDescriptor();
                            this.currentAttributeContainer = m_CurrentCPD;

                            String maxActive = atts.getValue(tags.getTagById(CON_MAX_ACTIVE));
                            if (isDebug) logger.debug("     " + tags.getTagById(CON_MAX_ACTIVE) + ": " + maxActive);
                            if (checkString(maxActive)) m_CurrentCPD.setMaxActive(Integer.parseInt(maxActive));

                            String maxIdle = atts.getValue(tags.getTagById(CON_MAX_IDLE));
                            if (isDebug) logger.debug("     " + tags.getTagById(CON_MAX_IDLE) + ": " + maxIdle);
                            if (checkString(maxIdle)) m_CurrentCPD.setMaxIdle(Integer.parseInt(maxIdle));

                            String maxWait = atts.getValue(tags.getTagById(CON_MAX_WAIT));
                            if (isDebug) logger.debug("     " + tags.getTagById(CON_MAX_WAIT) + ": " + maxWait);
                            if (checkString(maxWait)) m_CurrentCPD.setMaxWait(Integer.parseInt(maxWait));

                            String minEvictableIdleTimeMillis = atts.getValue(tags.getTagById(CON_MIN_EVICTABLE_IDLE_TIME_MILLIS));
                            if (isDebug) logger.debug("     " + tags.getTagById(CON_MIN_EVICTABLE_IDLE_TIME_MILLIS) + ": " + minEvictableIdleTimeMillis);
                            if (checkString(minEvictableIdleTimeMillis)) m_CurrentCPD.setMinEvictableIdleTimeMillis(Long.parseLong(minEvictableIdleTimeMillis));

                            String numTestsPerEvictionRun = atts.getValue(tags.getTagById(CON_NUM_TESTS_PER_EVICTION_RUN));
                            if (isDebug) logger.debug("     " + tags.getTagById(CON_NUM_TESTS_PER_EVICTION_RUN) + ": " + numTestsPerEvictionRun);
                            if (checkString(numTestsPerEvictionRun)) m_CurrentCPD.setNumTestsPerEvictionRun(Integer.parseInt(numTestsPerEvictionRun));

                            String testOnBorrow = atts.getValue(tags.getTagById(CON_TEST_ON_BORROW));
                            if (isDebug) logger.debug("     " + tags.getTagById(CON_TEST_ON_BORROW) + ": " + testOnBorrow);
                            if (checkString(testOnBorrow)) m_CurrentCPD.setTestOnBorrow(Boolean.valueOf(testOnBorrow).booleanValue());

                            String testOnReturn = atts.getValue(tags.getTagById(CON_TEST_ON_RETURN));
                            if (isDebug) logger.debug("     " + tags.getTagById(CON_TEST_ON_RETURN) + ": " + testOnReturn);
                            if (checkString(testOnReturn)) m_CurrentCPD.setTestOnReturn(Boolean.valueOf(testOnReturn).booleanValue());

                            String testWhileIdle = atts.getValue(tags.getTagById(CON_TEST_WHILE_IDLE));
                            if (isDebug) logger.debug("     " + tags.getTagById(CON_TEST_WHILE_IDLE) + ": " + testWhileIdle);
                            if (checkString(testWhileIdle)) m_CurrentCPD.setTestWhileIdle(Boolean.valueOf(testWhileIdle).booleanValue());

                            String timeBetweenEvictionRunsMillis = atts.getValue(tags.getTagById(CON_TIME_BETWEEN_EVICTION_RUNS_MILLIS));
                            if (isDebug) logger.debug("     " + tags.getTagById(CON_TIME_BETWEEN_EVICTION_RUNS_MILLIS) + ": " + timeBetweenEvictionRunsMillis);
                            if (checkString(timeBetweenEvictionRunsMillis)) m_CurrentCPD.setTimeBetweenEvictionRunsMillis(Long.parseLong(timeBetweenEvictionRunsMillis));

                            String whenExhaustedAction = atts.getValue(tags.getTagById(CON_WHEN_EXHAUSTED_ACTION));
                            if (isDebug) logger.debug("     " + tags.getTagById(CON_WHEN_EXHAUSTED_ACTION) + ": " + whenExhaustedAction);
                            if (checkString(whenExhaustedAction)) m_CurrentCPD.setWhenExhaustedAction(Byte.parseByte(whenExhaustedAction));

                            String connectionFactoryStr = atts.getValue(tags.getTagById(CONNECTION_FACTORY));
                            if (isDebug) logger.debug("     " + tags.getTagById(CONNECTION_FACTORY) + ": " + connectionFactoryStr);
                            if (checkString(connectionFactoryStr)) m_CurrentCPD.setConnectionFactory(ClassHelper.getClass(connectionFactoryStr));

                            String validationQuery = atts.getValue(tags.getTagById(VALIDATION_QUERY));
                            if (isDebug) logger.debug("     " + tags.getTagById(VALIDATION_QUERY) + ": " + validationQuery);
                            if (checkString(validationQuery)) m_CurrentCPD.setValidationQuery(validationQuery);

                            // abandoned connection properties
                            String logAbandoned = atts.getValue(tags.getTagById(CON_LOG_ABANDONED));
                            if (isDebug) logger.debug("     " + tags.getTagById(CON_LOG_ABANDONED) + ": " + logAbandoned);
                            if (checkString(logAbandoned)) m_CurrentCPD.setLogAbandoned(Boolean.valueOf(logAbandoned).booleanValue());

                            String removeAbandoned = atts.getValue(tags.getTagById(CON_REMOVE_ABANDONED));
                            if (isDebug) logger.debug("     " + tags.getTagById(CON_REMOVE_ABANDONED) + ": " + removeAbandoned);
                            if (checkString(removeAbandoned)) m_CurrentCPD.setRemoveAbandoned(Boolean.valueOf(removeAbandoned).booleanValue());

                            String removeAbandonedTimeout = atts.getValue(tags.getTagById(CON_REMOVE_ABANDONED_TIMEOUT));
                            if (isDebug) logger.debug("     " + tags.getTagById(CON_REMOVE_ABANDONED_TIMEOUT) + ": " + removeAbandonedTimeout);
                            if (checkString(removeAbandonedTimeout)) m_CurrentCPD.setRemoveAbandonedTimeout(Integer.parseInt(removeAbandonedTimeout));
                        }
                        break;
                    }

                case OBJECT_CACHE:
                    {
                        String className = atts.getValue(tags.getTagById(CLASS_NAME));
                        if(checkString(className) && m_CurrentJCD != null)
                        {
                            ObjectCacheDescriptor ocd = m_CurrentJCD.getObjectCacheDescriptor();
                            this.currentAttributeContainer = ocd;
                            ocd.setObjectCache(ClassHelper.getClass(className));
                            if (isDebug) logger.debug("    > " + tags.getTagById(OBJECT_CACHE));
                            if (isDebug) logger.debug("     " + tags.getTagById(CLASS_NAME) + ": " + className);
                        }
                        break;
                    }
                case SEQUENCE_MANAGER:
                    {
                        String className = atts.getValue(tags.getTagById(SEQUENCE_MANAGER_CLASS));
                        if(checkString(className))
                        {
                            this.currentSequenceDescriptor = new SequenceDescriptor(this.m_CurrentJCD);
                            this.currentAttributeContainer = currentSequenceDescriptor;
                            this.m_CurrentJCD.setSequenceDescriptor(this.currentSequenceDescriptor);
                            if (isDebug) logger.debug("    > " + tags.getTagById(SEQUENCE_MANAGER));
                            if (isDebug) logger.debug("     " + tags.getTagById(SEQUENCE_MANAGER_CLASS) + ": " + className);
                            if (checkString(className)) currentSequenceDescriptor.setSequenceManagerClass(ClassHelper.getClass(className));
                        }
                        break;
                    }
                case ATTRIBUTE:
                    {
                        //handle custom attributes
                        String attributeName = atts.getValue(tags.getTagById(ATTRIBUTE_NAME));
                        String attributeValue = atts.getValue(tags.getTagById(ATTRIBUTE_VALUE));

                        // If we have a container to store this attribute in, then do so.
                        if (this.currentAttributeContainer != null)
                        {

                            if (checkString(attributeName))
                            {
                                if (isDebug) logger.debug("      > " + tags.getTagById(ATTRIBUTE));
                                if (isDebug) logger.debug("       " + tags.getTagById(ATTRIBUTE_NAME) + ": " + attributeName
                                        + "  "+tags.getTagById(ATTRIBUTE_VALUE) + ": " + attributeValue);
                                this.currentAttributeContainer.addAttribute(attributeName, attributeValue);
//                                logger.info("attribute ["+attributeName+"="+attributeValue+"] add to "+currentAttributeContainer.getClass());
                            }
                            else
                            {
                                logger.info("Found 'null' or 'empty' attribute object for element "+currentAttributeContainer.getClass() +
                                        " attribute-name=" + attributeName + ", attribute-value=" + attributeValue+
                                        " See jdbc-connection-descriptor with jcdAlias '"+m_CurrentJCD.getJcdAlias()+"'");
                            }
                        }
//                        else
//                        {
//                            logger.info("Found attribute (name="+attributeName+", value="+attributeValue+
//                                    ") but I could not assign them to a descriptor");
//                        }

                        break;
                    }
                default :
                    {
                        // noop
                    }
            }
        }
        catch (Exception ex)
        {
            logger.error(ex);
            throw new PersistenceBrokerException(ex);
        }
    }
616322
private boolean checkElement(final StartElement mEvent) throws TTIOException {
        assert mEvent != null;
        boolean retVal = false;

        // Matching element names?
        if (mWtx.getNode().getKind() == IConstants.ELEMENT
            && mWtx.getQNameOfCurrentNode().equals(mEvent.getName())) {
            // Check if atts and namespaces are the same.
            final long nodeKey = mWtx.getNode().getDataKey();

            // Check attributes.
            boolean foundAtts = false;
            boolean hasAtts = false;
            for (final Iterator<?> it = mEvent.getAttributes(); it.hasNext();) {
                hasAtts = true;
                final Attribute attribute = (Attribute)it.next();
                for (int i = 0, attCount = ((ElementNode)mWtx.getNode()).getAttributeCount(); i < attCount; i++) {
                    mWtx.moveToAttribute(i);
                    if (attribute.getName().equals(mWtx.getQNameOfCurrentNode())
                        && attribute.getValue().equals(mWtx.getValueOfCurrentNode())) {
                        foundAtts = true;
                        mWtx.moveTo(nodeKey);
                        break;
                    }
                    mWtx.moveTo(nodeKey);
                }

                if (!foundAtts) {
                    break;
                }
            }
            if (!hasAtts && ((ElementNode)mWtx.getNode()).getAttributeCount() == 0) {
                foundAtts = true;
            }

            // Check namespaces.
            boolean foundNamesps = false;
            boolean hasNamesps = false;
            for (final Iterator<?> namespIt = mEvent.getNamespaces(); namespIt.hasNext();) {
                hasNamesps = true;
                final Namespace namespace = (Namespace)namespIt.next();
                for (int i = 0, namespCount = ((ElementNode)mWtx.getNode()).getNamespaceCount(); i < namespCount; i++) {
                    mWtx.moveToNamespace(i);
                    final ITreeNameData namenode = (ITreeNameData)mWtx.getNode();
                    if (namespace.getNamespaceURI().equals(mWtx.nameForKey(namenode.getURIKey()))
                        && namespace.getPrefix().equals(mWtx.nameForKey(namenode.getNameKey()))) {
                        foundNamesps = true;
                        mWtx.moveTo(nodeKey);
                        break;
                    }
                    mWtx.moveTo(nodeKey);
                }

                if (!foundNamesps) {
                    break;
                }
            }
            if (!hasNamesps && ((ElementNode)mWtx.getNode()).getNamespaceCount() == 0) {
                foundNamesps = true;
            }

            // Check if atts and namespaces are the same.
            if (foundAtts && foundNamesps) {
                retVal = true;
            } else {
                retVal = false;
            }
        }

        return retVal;
    }
278075
def startElement(self, node):
        """"""
        if node is None:
            return

        if self.__filter_location is not None:
            # dont even parse includes.
            # FIXME: go back on dependencies ?
            if node.location.file is None:
                return
            elif node.location.file.name not in self.__filter_location:
                return
        # find and call the handler for this element
        log.debug(
            '%s:%d: Found a %s|%s|%s',
            node.location.file,
            node.location.line,
            node.kind.name,
            node.displayname,
            node.spelling)
        # build stuff.
        try:
            stop_recurse = self.parse_cursor(node)
            # Signature of parse_cursor is:
            # if the fn returns True, do not recurse into children.
            # anything else will be ignored.
            if stop_recurse is not False:  # True:
                return
            # if fn returns something, if this element has children, treat
            # them.
            for child in node.get_children():
                self.startElement(child)
        except InvalidDefinitionError:
            # if the definition is invalid
            pass
        # startElement returns None.
        return None
347371
@BeforeSuite(alwaysRun=true)
	@Parameters(value={"parameters"})
	public static void startSelenium(String parameters)
	{
		parametersMap = parameterScanner(parameters);
		
		parametersInfo();
		
		String 	browserName = parametersMap.get("browser"),
				profile = parametersMap.get("profile"),
				chromeDriverBin = parametersMap.get("chromeDriverBin"),
				ieDriverBin = parametersMap.get("ieDriverBin"),
				chromeBin = parametersMap.get("chromeBin"),
				languages = parametersMap.get("languages");
				
		if(browserName == null){
			throw new IllegalArgumentException(String.format(ErrorMessages.ERROR_TEMPLATE_VARIABLE_NULL,"browser"));
		}
		
		if(driver == null) {
			if(BrowsersList.FIREFOX.equalsString(browserName)){
				FirefoxProfile fp = new FirefoxProfile();
				fp.setPreference("dom.max_script_run_time", 0);
				fp.setPreference("dom.max_chrome_script_run_time", 0);
				if(profile != null && !profile.isEmpty()){
					fp.setPreference("webdriver.firefox.profile", profile);
				}
				if(languages != null && !languages.isEmpty()){
					fp.setPreference("intl.accept_languages", languages);
				}
				driver = new WebDriverAdapter(new FirefoxDriver(fp));
			}
			else if(BrowsersList.CHROME.equalsString(browserName)) {
				
				if(chromeBin == null){
					throw new IllegalArgumentException(String.format(ErrorMessages.ERROR_TEMPLATE_VARIABLE_NULL,"chromeBin"));
				}
				
				
				// Optional, if not specified, WebDriver will search your path for chromedriver 
				// in the system environment. (OBS: To evade problems, webdriver.chrome.driver MUST have a value.
				if(System.getProperty("webdriver.chrome.driver") == null || System.getProperty("webdriver.chrome.driver").isEmpty()){
					if(chromeDriverBin == null){
						throw new IllegalArgumentException(String.format(ErrorMessages.ERROR_TEMPLATE_VARIABLE_NULL,"chromeDriverBin"));
					}
					System.setProperty("webdriver.chrome.driver", chromeDriverBin);	
				}
				
				ChromeOptions co = new ChromeOptions();
				// Get the chrome binary directory path from System Envionment.
				co.setBinary(new File(chromeBin));
				driver = new WebDriverAdapter(new ChromeDriver(co));
			}
			else if(BrowsersList.IE.equalsString(browserName))
			{
				if(ieDriverBin == null){
						throw new IllegalArgumentException(String.format(ErrorMessages.ERROR_TEMPLATE_VARIABLE_NULL,"ieDriverBin"));
				}
				System.setProperty("webdriver.ie.driver", ieDriverBin);	
				driver = new WebDriverAdapter(new InternetExplorerDriver());
			}
			else if(BrowsersList.HTML_UNIT.equalsString(browserName)){
				driver = new HtmlUnitDriver(true);
			}
			else {
				throw new IllegalArgumentException(ErrorMessages.ERROR_BROWSER_INVALID);
			}
		}
		/* Sets to all driver methods the global timeout of 1 second. 
		 * To tests, Timeouts must be specified on the components.
		 */
		SeleniumController.driver.manage().timeouts().implicitlyWait(1, TimeUnit.SECONDS);
		SeleniumController.builder = new SeleniumBuilder(driver);
		SeleniumController.browser = new SeleniumBrowser();
		ListenerGateway.setWebDriver(driver);
		ListenerGateway.setParameters(parametersMap);
	}
564688
@Override
    public final String getElementText() throws XMLStreamException {
        XMLEvent event = this.previousEvent;
        if (event == null) {
            throw new XMLStreamException(
                    "Must be on START_ELEMENT to read next text, element was null");
        }
        if (!event.isStartElement()) {
            throw new XMLStreamException(
                    "Must be on START_ELEMENT to read next text", event.getLocation());
        }

        final StringBuilder text = new StringBuilder();
        while (!event.isEndDocument()) {
            switch (event.getEventType()) {
                case XMLStreamConstants.CHARACTERS:
                case XMLStreamConstants.SPACE:
                case XMLStreamConstants.CDATA:
                    {
                        final Characters characters = event.asCharacters();
                        text.append(characters.getData());
                        break;
                    }
                case XMLStreamConstants.ENTITY_REFERENCE:
                    {
                        final EntityReference entityReference = (EntityReference) event;
                        final EntityDeclaration declaration = entityReference.getDeclaration();
                        text.append(declaration.getReplacementText());
                        break;
                    }
                case XMLStreamConstants.COMMENT:
                case XMLStreamConstants.PROCESSING_INSTRUCTION:
                    {
                        // Ignore
                        break;
                    }
                default:
                    {
                        throw new XMLStreamException(
                                "Unexpected event type '"
                                        + XMLStreamConstantsUtils.getEventName(event.getEventType())
                                        + "' encountered. Found event: "
                                        + event,
                                event.getLocation());
                    }
            }

            event = this.nextEvent();
        }

        return text.toString();
    }
1081912
@Override
    public void startElement(final String uri, final String localName, final String qName, final Attributes attributes)
            throws SAXException {

        LOG.trace("startElement uri={} localName={} qName={} attributes={}", uri, localName, qName, attributes);

        if (this.isNotInkstandNamespace(uri)) {
            return;
        }
        switch (localName) {
            case "rootNode":
                this.startElementRootNode(attributes);
                break;
            case "node":
                this.startElementNode(attributes);
                break;
            case "mixin":
                this.startElementMixin(attributes);
                break;
            case "property":
                this.startElementProperty(attributes);
                break;
            default:
                break;
        }
    }
872620
@Override
    public void startElement(final String uri, final String localName, final String qName,
                             final Attributes atts) throws SAXException {
        ignoreStack.push(MAP_RELTABLE.matches(atts) ? false : ignoreStack.isEmpty() || ignoreStack.peek());

        Attributes res = atts;
        if (ignoreStack.peek() && MAP_TOPICREF.matches(res)) {
            final URI href = toURI(res.getValue(ATTRIBUTE_NAME_HREF));
            final URI copyTo = toURI(res.getValue(ATTRIBUTE_NAME_COPY_TO));
            final URI source = copyTo != null ? copyTo : href;
            final String scope = res.getValue(ATTRIBUTE_NAME_SCOPE);
            final String format = res.getValue(ATTRIBUTE_NAME_FORMAT);
            // FIXME: handle cascading
            final String processingRole = res.getValue(ATTRIBUTE_NAME_PROCESSING_ROLE);
            if (source != null &&
                    (scope == null || scope.equals(ATTR_SCOPE_VALUE_LOCAL)) &&
                    (format == null || format.equals(ATTR_FORMAT_VALUE_DITA)) &&
                    (processingRole == null || processingRole.equals(ATTR_PROCESSING_ROLE_VALUE_NORMAL))) {
                final URI file = stripFragment(source);
                Integer count = topicrefCount.getOrDefault(file, 0);
                count++;
                topicrefCount.put(file, count);
                if (count > 1) { // not only reference to this topic
                    final FileInfo srcFi = job.getFileInfo(currentFile.resolve(stripFragment(source)));
                    if (srcFi != null) {
                        final FileInfo dstFi = generateCopyToTarget(srcFi, count);
                        copyToMap.put(dstFi, srcFi);

                        final URI dstTempAbs = job.tempDirURI.resolve(dstFi.uri);
                        final URI targetRel = getRelativePath(currentFile, dstTempAbs);
                        final URI target = setFragment(targetRel, href.getFragment());

                        final AttributesImpl buf = new AttributesImpl(atts);
                        XMLUtils.addOrSetAttribute(buf, ATTRIBUTE_NAME_COPY_TO, target.toString());
                        res = buf;
                    }
                }
            }
        }

        getContentHandler().startElement(uri, localName, qName, res);
    }
1285277
protected void startNode(Node node) throws org.xml.sax.SAXException
  {

//   TODO: <REVIEW>
//    A Serializer implements ContentHandler, but not NodeConsumer
//    so drop this reference to NodeConsumer which would otherwise
//    pull in all sorts of things
//    if (m_contentHandler instanceof NodeConsumer)
//    {
//      ((NodeConsumer) m_contentHandler).setOriginatingNode(node);
//    }
//    TODO: </REVIEW>
                
                if (node instanceof Locator)
                {
                        Locator loc = (Locator)node;
                        m_locator.setColumnNumber(loc.getColumnNumber());
                        m_locator.setLineNumber(loc.getLineNumber());
                        m_locator.setPublicId(loc.getPublicId());
                        m_locator.setSystemId(loc.getSystemId());
                }
                else
                {
                        m_locator.setColumnNumber(0);
      m_locator.setLineNumber(0);
                }

    switch (node.getNodeType())
    {
    case Node.COMMENT_NODE :
    {
      String data = ((Comment) node).getData();

      if (m_contentHandler instanceof LexicalHandler)
      {
        LexicalHandler lh = ((LexicalHandler) this.m_contentHandler);

        lh.comment(data.toCharArray(), 0, data.length());
      }
    }
    break;
    case Node.DOCUMENT_FRAGMENT_NODE :

      // ??;
      break;
    case Node.DOCUMENT_NODE :
    
      break;
    case Node.ELEMENT_NODE :
      Element elem_node = (Element) node;
      {
          // Make sure the namespace node
          // for the element itself is declared
          // to the ContentHandler
          String uri = elem_node.getNamespaceURI();
          if (uri != null) {
              String prefix = elem_node.getPrefix();
              if (prefix==null)
                prefix="";
              this.m_contentHandler.startPrefixMapping(prefix,uri);              
          }
      }
      NamedNodeMap atts = elem_node.getAttributes();
      int nAttrs = atts.getLength();
      // System.out.println("TreeWalker#startNode: "+node.getNodeName());

      
      // Make sure the namespace node of
      // each attribute is declared to the ContentHandler
      for (int i = 0; i < nAttrs; i++)
      {
        final Node attr = atts.item(i);
        final String attrName = attr.getNodeName();
        final int colon = attrName.indexOf(':');
        final String prefix;

        // System.out.println("TreeWalker#startNode: attr["+i+"] = "+attrName+", "+attr.getNodeValue());
        if (attrName.equals("xmlns") || attrName.startsWith("xmlns:"))
        {
          // Use "" instead of null, as Xerces likes "" for the 
          // name of the default namespace.  Fix attributed 
          // to "Steven Murray" <smurray@ebt.com>.
          if (colon < 0)
            prefix = "";
          else
            prefix = attrName.substring(colon + 1);

          this.m_contentHandler.startPrefixMapping(prefix,
                                                   attr.getNodeValue());
        }
        else if (colon > 0) {
            prefix = attrName.substring(0,colon);
            String uri = attr.getNamespaceURI();
            if (uri != null)
                this.m_contentHandler.startPrefixMapping(prefix,uri);
        }        
      }

      String ns = m_dh.getNamespaceOfNode(node);
      if(null == ns)
        ns = "";
      this.m_contentHandler.startElement(ns,
                                         m_dh.getLocalNameOfNode(node),
                                         node.getNodeName(),
                                         new AttList(atts, m_dh));
      break;
    case Node.PROCESSING_INSTRUCTION_NODE :
    {
      ProcessingInstruction pi = (ProcessingInstruction) node;
      String name = pi.getNodeName();

      // String data = pi.getData();
      if (name.equals("xslt-next-is-raw"))
      {
        nextIsRaw = true;
      }
      else
      {
        this.m_contentHandler.processingInstruction(pi.getNodeName(),
                                                    pi.getData());
      }
    }
    break;
    case Node.CDATA_SECTION_NODE :
    {
      boolean isLexH = (m_contentHandler instanceof LexicalHandler);
      LexicalHandler lh = isLexH
                          ? ((LexicalHandler) this.m_contentHandler) : null;

      if (isLexH)
      {
        lh.startCDATA();
      }
      
      dispatachChars(node);

      {
        if (isLexH)
        {
          lh.endCDATA();
        }
      }
    }
    break;
    case Node.TEXT_NODE :
    {
      //String data = ((Text) node).getData();

      if (nextIsRaw)
      {
        nextIsRaw = false;

        m_contentHandler.processingInstruction(javax.xml.transform.Result.PI_DISABLE_OUTPUT_ESCAPING, "");
        dispatachChars(node);
        m_contentHandler.processingInstruction(javax.xml.transform.Result.PI_ENABLE_OUTPUT_ESCAPING, "");
      }
      else
      {
        dispatachChars(node);
      }
    }
    break;
    case Node.ENTITY_REFERENCE_NODE :
    {
      EntityReference eref = (EntityReference) node;

      if (m_contentHandler instanceof LexicalHandler)
      {
        ((LexicalHandler) this.m_contentHandler).startEntity(
          eref.getNodeName());
      }
      else
      {

        // warning("Can not output entity to a pure SAX ContentHandler");
      }
    }
    break;
    default :
    }
  }
948641
public void startElement(String uri,
			     String localName,
			     String qName,
			     Attributes a) throws SAXException {
	// always update the depth
	depth++;

	// if we're in an accepted section, simply pass through
	if (isAccepted()) {
	    getContentHandler().startElement(uri, localName, qName, a);
	    return;
	}

	// likewise, if we're excluded, then simply block and return
	if (isExcluded())
	    return;

	// now, not accepted or excluded, let's see if we've got a match.
	// we need to get the appropriate step based on the number of
	// steps we've previously accepted
	Step currentStep = (Step) steps.get(acceptedDepths.size());

	if (nodeMatchesStep(currentStep, uri, localName, qName, a)) {
	    if (DEBUG)
		System.err.println("*** Progressive match (" + acceptedDepths.size() + "): " + localName);
	    // new match (progressive)
	    acceptedDepths.push(Integer.valueOf(depth - 1));

	    // is it enough?  give acceptance another chance...
	    if (isAccepted())
	        getContentHandler().startElement(uri, localName, qName, a);
	} else if (!currentStep.isDepthUnlimited()) {
	    // if the step was preceded by '/' instead of '//', then
	    // we can't have a match at this node or beneath it
	    excludedDepth = depth - 1;
	}

	// nothing left to check; no reason to include node
        return;
    }
1035208
@Override
    public void endElement( String uri, String localName, String qName )
        throws SAXException
    {
        flushCharacters();
        if ( stack.isEmpty() )
        {
            throw new IllegalStateException( "Stack must not be empty when closing the element " + qName
                + " around line " + locator.getLineNumber() + " and column " + locator.getColumnNumber() );
        }
        IndentCheckSaxHandler.ElementEntry startEntry = stack.pop();
        int indentDiff = lastIndent.size - startEntry.expectedIndent.size;
        int expectedIndent = startEntry.expectedIndent.size;
        if ( lastIndent.lineNumber != startEntry.foundIndent.lineNumber && indentDiff != 0 )
        {
            /*
             * diff should be zero unless we are on the same line as start element
             */
            int opValue = expectedIndent - lastIndent.size;
            String op = opValue > 0 ? "Insert" : "Delete";
            String units = opValue == 1 ? "space" : "spaces";
            String message = op + " " + Math.abs( opValue ) + " " + units + ". Expected " + expectedIndent + " found "
                + lastIndent.size + " spaces before end element </" + qName + ">";
            XmlFormatViolation violation =
                new XmlFormatViolation( file, locator.getLineNumber(), locator.getColumnNumber(), message );
            violationHandler.handle( violation );
        }
    }
594998
@Override
	public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
		// 单元格元素
		if (C_ELEMENT.equals(qName)) {

			// 获取当前列坐标
			String tempCurCoordinate = attributes.getValue(R_ATTR);
			// 前一列为null，则将其设置为"@",A为第一列，ascii码为65，前一列即为@，ascii码64
			if (preCoordinate == null) {
				preCoordinate = String.valueOf(ExcelSaxUtil.CELL_FILL_CHAR);
			} else {
				// 存在，则前一列要设置为上一列的坐标
				preCoordinate = curCoordinate;
			}
			// 重置当前列
			curCoordinate = tempCurCoordinate;
			// 设置单元格类型
			setCellType(attributes);
		}

		lastContent = "";
	}