result->GetSingleNodeValue(getter_AddRefs(resultNode)); nsXFormsUtils::GetNodeValue(resultNode, text);
rv = result->GetSingleNodeValue(getter_AddRefs(resultNode)); if (resultNode) nsXFormsUtils::GetNodeValue(resultNode, text);
nsXFormsOutputElement::Refresh(){#ifdef DEBUG_XF_OUTPUT  printf("nsXFormsOutputElement::Refresh()\n");#endif  if (!mHTMLElement)    return NS_OK;  nsresult rv;  PRBool hasRef;  rv = mElement->HasAttribute(NS_LITERAL_STRING("ref"), &hasRef);  NS_ENSURE_SUCCESS(rv, rv);  nsCOMPtr<nsIDOMNode> modelNode;  nsCOMPtr<nsIDOMElement> bindElement;  nsCOMPtr<nsIDOMXPathResult> result;  if (hasRef) {    result = nsXFormsUtils::EvaluateNodeBinding(mElement,                                                nsXFormsUtils::ELEMENT_WITH_MODEL_ATTR,                                                NS_LITERAL_STRING("ref"),                                                EmptyString(),                                                nsIDOMXPathResult::FIRST_ORDERED_NODE_TYPE,                                                getter_AddRefs(modelNode),                                                getter_AddRefs(bindElement));  } else {    result = nsXFormsUtils::EvaluateNodeBinding(mElement,                                                nsXFormsUtils::ELEMENT_WITH_MODEL_ATTR,                                                NS_LITERAL_STRING("value"),                                                EmptyString(),                                                nsIDOMXPathResult::STRING_TYPE,                                                getter_AddRefs(modelNode),                                                getter_AddRefs(bindElement));  }  nsCOMPtr<nsIModelElementPrivate> model = do_QueryInterface(modelNode);  if (model) {    model->AddFormControl(this);    if (result) {      nsAutoString text;      if (hasRef) {              nsCOMPtr<nsIDOMNode> resultNode;        result->GetSingleNodeValue(getter_AddRefs(resultNode));        nsXFormsUtils::GetNodeValue(resultNode, text);      } else {        rv = result->GetStringValue(text);        NS_ENSURE_SUCCESS(rv, rv);      }            nsCOMPtr<nsIDOM3Node> dom3Node = do_QueryInterface(mHTMLElement);      NS_ENSURE_TRUE(mHTMLElement, NS_ERROR_FAILURE);      rv = dom3Node->SetTextContent(text);      NS_ENSURE_SUCCESS(rv, rv);    }  }  return NS_OK;}