{ PRInt32 offset; PRInt32 endOffset = -1; nsresult result = NS_OK;
{ PRInt32 startOfAttribute = 0; PRInt32 startOfValue = 0; PRInt32 posnOfValueDelimeter = 0; nsresult result = NS_ERROR_FAILURE;
GetQuotedAttributeValue(nsString& aSource,                        const nsString& aAttribute,                        nsString& aValue){  PRInt32 offset;  PRInt32 endOffset = -1;  nsresult result = NS_OK;  offset = aSource.Find(aAttribute);  if (-1 != offset) {    offset = aSource.FindChar('=', PR_FALSE,offset);    PRUnichar next = aSource.CharAt(++offset);    if (kQuote == next) {      endOffset = aSource.FindChar(kQuote,PR_FALSE, ++offset);    }    else if (kApostrophe == next) {      endOffset = aSource.FindChar(kApostrophe, PR_FALSE,++offset);    }    if (-1 != endOffset) {      aSource.Mid(aValue, offset, endOffset-offset);    }    else {      // Mismatched quotes - return an error      result = NS_ERROR_FAILURE;    }  }  else {    aValue.Truncate();  }  return result;}