nsresult ConsumeAttributeValueText(nsString& aString,
nsresult ConsumeAttributeValueText(nsScannerSharedSubstring& aString,
nsresult ConsumeAttributeValueText(nsString& aString,                                   PRInt32& aNewlineCount,                                   nsScanner& aScanner,                                   const nsReadEndCondition& aEndCondition,                                   PRBool aAllowNewlines,                                   PRInt32 aFlag){  nsresult result = NS_OK;  PRBool   done = PR_FALSE;    do {    result = aScanner.ReadUntil(aString,aEndCondition,PR_FALSE);    if(NS_SUCCEEDED(result)) {      PRUnichar ch;      aScanner.Peek(ch);      if(ch == kAmpersand) {        result = ConsumeAttributeEntity(aString,aScanner,aFlag);      }      else if(ch == kCR && aAllowNewlines) {        aScanner.GetChar(ch);        result = aScanner.Peek(ch);        if (NS_SUCCEEDED(result)) {          if(ch == kNewLine) {            aString.AppendLiteral("\r\n");            aScanner.GetChar(ch);          }          else {            aString.Append(PRUnichar('\r'));          }          ++aNewlineCount;        }      }      else if(ch == kNewLine && aAllowNewlines) {        aScanner.GetChar(ch);        aString.Append(PRUnichar('\n'));        ++aNewlineCount;      }      else {        done = PR_TRUE;      }    }  } while (NS_SUCCEEDED(result) && !done);  return result;}