Ver Mensaje Individual
  #1 (permalink)  
Antiguo 17/06/2011, 10:22
pablokes
 
Fecha de Ingreso: enero-2008
Mensajes: 233
Antigüedad: 16 años, 3 meses
Puntos: 2
insertar registro posición xml

tengo este codigo en donde inserto un registro a un xml

// OBTENMOS LA VARIABLES DEL FORMULARIO
$fecha = $_POST['fecha'];
$titulo = $_POST['titulo'];
$mensaje = $_POST['mensaje'];
$textoBoton = $_POST['textoBoton'];
$link = $_POST['link'];


$xml = simplexml_load_file('noticias.xml');

$sxe = new SimpleXMLElement($xml->asXML());
$person = $sxe->addChild("noticia");
$person->addAttribute('fecha', $fecha);
$person->addChild("titulo", $titulo);
$person->addChild("mensaje", $mensaje);
$person->addChild("image", '2noticia');
$person->addChild("textoBoton", $textoBoton);
$person->addChild("link", $link);
/
$sxe->asXML("noticias.xml");

entonces lo que quiere es insertarlo pero en una determinada posicion de mi xml, es posible hacer esto?? desde ya muchas gracias!