CToken* theToken = state->tokenAllocator->CreateTokenOfType(eToken_start,eHTMLTag_unknown, nsLiteralString((PRUnichar*)name));
typedef const PRUnichar* const_PRUnichar_ptr; CToken* theToken = state->tokenAllocator->CreateTokenOfType(eToken_start,eHTMLTag_unknown, nsDependentString(const_PRUnichar_ptr(name)));
void Tokenizer_HandleStartElement(void *userData, const XML_Char *name, const XML_Char **atts) {  XMLParserState* state = (XMLParserState*) userData;  CToken* theToken = state->tokenAllocator->CreateTokenOfType(eToken_start,eHTMLTag_unknown, nsLiteralString((PRUnichar*)name));  if(theToken) {        // If an ID attribute exists for this element, set it on the start token    PRInt32 index = XML_GetIdAttributeIndex(state->parser);    if (index >= 0) {            nsCOMPtr<nsIAtom> attributeAtom = dont_AddRef(NS_NewAtom((const PRUnichar *) atts[index]));      CStartToken* startToken = NS_STATIC_CAST(CStartToken*, theToken);      startToken->SetIDAttributeAtom(attributeAtom);    }    nsExpatTokenizer::AddToken(theToken, NS_OK, state->tokenDeque, state->tokenAllocator);    // For each attribute on this element, create and add attribute tokens to the token queue    int theAttrCount=0;        while(*atts){      theAttrCount++;      CAttributeToken* theAttrToken = (CAttributeToken*)       state->tokenAllocator->CreateTokenOfType(eToken_attribute, eHTMLTag_unknown, nsLiteralString((PRUnichar*)atts[1]));      if(theAttrToken){        PRUnichar* ptr = (PRUnichar*)atts[0];        if ((ptr >= state->bufferStart) && (ptr < state->bufferEnd)) {          PRUint32 len = nsCRT::strlen(ptr);          nsReadingIterator<PRUnichar> start, end;          start = state->currentIterator;          start.advance(ptr - state->bufferStart);          end = start;          end.advance(len);          theAttrToken->BindKey(state->scanner, start, end);        }        else {          theAttrToken->SetKey(nsLiteralString(ptr));        }      }      CToken* theTok=(CToken*)theAttrToken;      nsExpatTokenizer::AddToken(theTok, NS_OK, state->tokenDeque, state->tokenAllocator);      atts += 2;    }    theToken->SetAttributeCount(theAttrCount);  }  else{    //THROW A HUGE ERROR IF WE CANT CREATE A TOKEN!  }}