rv = NS_New_HTMLToTXT_SinkStream(&sink, &outString, wrapCol, flags);
rv = NS_New_HTMLToTXT_SinkStream(&sink, &outString, nsnull, wrapCol, flags);
HTML2text(nsString& inString, nsString& inType, nsString& outType,          int flags, int wrapCol, nsString& compareAgainst){  nsresult rv = NS_OK;  nsString outString;  // Create a parser  nsIParser* parser;   rv = nsComponentManager::CreateInstance(kParserCID, nsnull,                                           kIParserIID,(void**)&parser);  if (NS_FAILED(rv))  {    printf("Unable to create a parser : 0x%x\n", rv);    return NS_ERROR_FAILURE;  }  nsIHTMLContentSink* sink = nsnull;  // Create the appropriate output sink  if (outType == "text/html")    rv = NS_New_HTML_ContentSinkStream(&sink, &outString, flags);  else  // default to plaintext    rv = NS_New_HTMLToTXT_SinkStream(&sink, &outString, wrapCol, flags);  if (NS_FAILED(rv))  {    printf("Couldn't create new content sink: 0x%x\n", rv);    return rv;  }  parser->SetContentSink(sink);  nsIDTD* dtd = nsnull;  if (inType == "text/xif")    rv = NS_NewXIFDTD(&dtd);  else    rv = NS_NewNavHTMLDTD(&dtd);  if (NS_FAILED(rv))  {    printf("Couldn't create new HTML DTD: 0x%x\n", rv);    return rv;  }  parser->RegisterDTD(dtd);  char* inTypeStr = inType.ToNewCString();  rv = parser->Parse(inString, 0, inTypeStr, PR_FALSE, PR_TRUE);  delete[] inTypeStr;  if (NS_FAILED(rv))  {    printf("Parse() failed! 0x%x\n", rv);    return rv;  }  NS_IF_RELEASE(dtd);  NS_IF_RELEASE(sink);  NS_RELEASE(parser);  if (compareAgainst.Length() > 0)    return Compare(outString, compareAgainst);  char* charstar = outString.ToNewUTF8String();  printf("Output string is:\n--------------------\n%s--------------------\n",         charstar);  delete[] charstar;  return NS_OK;}