if (schema.Length() || (wallet_ReadFromList(field, schema, dummy, wallet_specificURLFieldToSchema_list, PR_FALSE)) || (wallet_ReadFromList(Strip(field, stripField), schema, dummy, wallet_FieldToSchema_list, PR_FALSE))) {
if (localSchema.Length() || (wallet_ReadFromList(Strip(field, stripField), localSchema, dummy, wallet_FieldToSchema_list, PR_FALSE))) {
wallet_Capture(nsIDocument* doc, const nsString& field, const nsString& value, const nsString& vcard){  /* do nothing if there is no value */  if (!value.Length()) {    return PR_FALSE;  }  /* read in the mappings if they are not already present */  if (!vcard.Length()) {    wallet_Initialize(PR_TRUE);    wallet_InitializeCurrentURL(doc);  }  nsAutoString oldValue;  /* is there a mapping from this field name to a schema name */  nsAutoString schema(vcard);  nsVoidArray* dummy;  nsString stripField;  if (schema.Length() ||      (wallet_ReadFromList(field, schema, dummy, wallet_specificURLFieldToSchema_list, PR_FALSE)) ||      (wallet_ReadFromList(Strip(field, stripField), schema, dummy, wallet_FieldToSchema_list, PR_FALSE))) {    /* field to schema mapping already exists */    /* is this a new value for the schema */    PRInt32 index = 0;    PRInt32 lastIndex = index;    while(wallet_ReadFromList(schema, oldValue, dummy, wallet_SchemaToValue_list, PR_TRUE, index)) {      if (oldValue == value) {        /*         * Remove entry from wallet_SchemaToValue_list and then reinsert.  This will         * keep multiple values in that list for the same field ordered with         * most-recently-used first.  That's useful since the first such entry         * is the default value used for pre-filling.         */        wallet_MapElement * mapElement =          (wallet_MapElement *) (wallet_SchemaToValue_list->ElementAt(lastIndex));        wallet_SchemaToValue_list->RemoveElementAt(lastIndex);        wallet_WriteToList(          mapElement->item1,          mapElement->item2,          mapElement->itemList,           wallet_SchemaToValue_list,          PR_FALSE); /* note: obscure=false, otherwise we will obscure an obscured value */        delete mapElement;        return PR_TRUE;      }      lastIndex = index;    }    /* this is a new value so store it */    dummy = 0;    if (wallet_WriteToList(schema, value, dummy, wallet_SchemaToValue_list, PR_TRUE)) {      wallet_WriteToFile(schemaValueFileName, wallet_SchemaToValue_list);    }  } else {    /* no field to schema mapping so assume schema name is same as field name */    /* is this a new value for the schema */    PRInt32 index = 0;    PRInt32 lastIndex = index;    nsAutoString concat_param;    wallet_GetHostFile(wallet_lastUrl, concat_param);    concat_param.AppendWithConversion(":");    concat_param.Append(field);    while(wallet_ReadFromList(concat_param, oldValue, dummy, wallet_SchemaToValue_list, PR_TRUE, index)) {      if (oldValue == value) {        /*         * Remove entry from wallet_SchemaToValue_list and then reinsert.  This will         * keep multiple values in that list for the same field ordered with         * most-recently-used first.  That's useful since the first such entry         * is the default value used for pre-filling.         */        wallet_MapElement * mapElement =          (wallet_MapElement *) (wallet_SchemaToValue_list->ElementAt(lastIndex));        wallet_SchemaToValue_list->RemoveElementAt(lastIndex);        wallet_WriteToList(          mapElement->item1,          mapElement->item2,          mapElement->itemList,           wallet_SchemaToValue_list,          PR_FALSE); /* note: obscure=false, otherwise we will obscure an obscured value */        delete mapElement;        return PR_TRUE;      }      lastIndex = index;      wallet_GetHostFile(wallet_lastUrl, concat_param);      concat_param.AppendWithConversion(":");      concat_param.Append(field);    }    /* this is a new value so store it */    dummy = 0;    nsAutoString hostFileField;    wallet_GetHostFile(wallet_lastUrl, hostFileField);    hostFileField.AppendWithConversion(":");    hostFileField.Append(field);    if (wallet_WriteToList(hostFileField, value, dummy, wallet_SchemaToValue_list, PR_TRUE)) {      wallet_WriteToFile(schemaValueFileName, wallet_SchemaToValue_list);    }  }  return PR_TRUE;}