Ver Mensaje Individual
  #1 (permalink)  
Antiguo 18/03/2011, 11:40
Avatar de juan_14nob
juan_14nob
 
Fecha de Ingreso: abril-2010
Mensajes: 552
Antigüedad: 14 años
Puntos: 6
framework spry

Hola a todos, estoy empezando a utilizar Spry.. en el cual me ha quedado una duda cuando uso en el archivo xml esta primer linea de codigo: "<?xml version="1.0" encoding="iso-8859-1">"

la pagina HTML no me carga el archivo XML

aqui dejo los codigos

[XML]
<?xml version="1.0" encoding="iso-8859-1">
<empleados>
<empleado>
<nombre>Juan</nombre>
<apellido>Carmena</apellido>
<direccion>Pje malaponte 5523</direccion>
<telefono>4649070</telefono>
<email>[email protected]</email>
</empleado>
<empleado>
<nombre>Juan222</nombre>
<apellido>Carmena2</apellido>
<direccion>Pje malaponte 55232222</direccion>
<telefono>46490702</telefono>
<email>[email protected]</email>
</empleado>
<empleado>
<nombre>Juan3333</nombre>
<apellido>Carmena333</apellido>
<direccion>Pje malaponte 552333333</direccion>
<telefono>4649070333333</telefono>
<email>[email protected]</email>
</empleado>
</empleados>
[/XML]

index.html
Código HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:spry="http://ns.adobe.com/spry">
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title> framework Spry </title>
<script type="text/javascript" src="includes/xpath.js"></script>
<script type="text/javascript" src="includes/SpryData.js"></script>

<script language="Javascript" type="text/javascript">
var setDeDatos = new Spry.Data.XMLDataSet("empleados.xml", "empleados/empleado")
</script>
<style type="text/css">
body{
	font-family:"verdana";
	font-size: 14px;
	
}
table{
	border-top: 1px solid #000;
	border-left: 1px solid #000;
}
th, td{
	border-bottom: 1px solid #000;
	border-right: 1px solid #000;
	width: 100px;
	text-align: center;
}
td{
	cursor: pointer;
}
th{
background-color: #C0C0C0;
}

</style>
<body>
<div id="region1" spry:region="setDeDatos">
	<table id="tabla1" cellspacing="0">
	<tr>
	<th>Nombre</th>
	<th>Apellido</th>
	</tr>
	<tr spry:repeat="setDeDatos" onclick="setDeDatos.setCurrentRow('{ds_RowID}')">
	<td>{nombre}</td>
	<td>{apellido}</td>
	</tr>
	</table>
</div>
<br />
<div id="region2" spry:detailregion="setDeDatos">
		<table id="tabla2" cellspacing="0">
		<tr>
		<th>direccion</th>
		<th>telefono</th>
		<th>email</th>
		</tr><tr>
		<td>{direccion}</td>
		<td>{telefono}</td>
		<td>{email}</td>
	
		
		</tr>
		</table>
</body>
</html> 

Última edición por juan_14nob; 18/03/2011 a las 11:42 Razón: error de edicion