code: protected void initInputSource(WstxInputSource newInput, boolean isExt,
                                     String entityId)
          throws XMLStreamException
      {
          // Let's make sure new input will be read next time input is needed:
          mInputPtr = 0;
          mInputEnd = 0;
          /* Plus, reset the input location so that'll be accurate for
           * error reporting etc.
           */
          mInputTopDepth = mCurrDepth;
  
          // [WSTX-296]: Check for entity expansion depth against configurable limit
          int entityDepth = mInput.getEntityDepth() + 1;
          verifyLimit("Maximum entity expansion depth", mConfig.getMaxEntityDepth(), entityDepth);
          mInput = newInput;
          mInput.initInputLocation(this, mCurrDepth, entityDepth);
  
          /* 21-Feb-2006, TSa: Linefeeds are NOT normalized when expanding
           *   internal entities (XML, 2.11)
           */
          if (isExt) {
              mNormalizeLFs = true;
          } else {
              mNormalizeLFs = false;
          }
      }
docs: Method called when an entity has been expanded (new input source
  has been created). Needs to initialize location information and change
  active input source.
  
  @param entityId Name of the entity being expanded