Encinbauer
Chapucillas
- Registrado
- 23 Nov 2015
- Mensajes
- 87
- Puntos
- 8
Buenas, de un documento XML necesito sacar lo siguiente:
[FONT=Arial, sans-serif]<libros>[/FONT]
[FONT=Arial, sans-serif]<libro año="1999">[/FONT]
[FONT=Arial, sans-serif]<titulo>Economics ofTechnology for Digital TV</titulo>[/FONT]
[FONT=Arial, sans-serif]</libro>[/FONT]
[FONT=Arial, sans-serif]<libro año="2003">[/FONT]
[FONT=Arial, sans-serif]<titulo>AutómatasProgramables</titulo>[/FONT]
[FONT=Arial, sans-serif]</libro>[/FONT]
[FONT=Arial, sans-serif]<libro año="2011">[/FONT]
[FONT=Arial, sans-serif]<titulo>Curso de ProgramaciónWeb</titulo>[/FONT]
[FONT=Arial, sans-serif]</libro>[/FONT]
[FONT=Arial, sans-serif]<libro año="2013">[/FONT]
[FONT=Arial, sans-serif]<titulo>Android 4. Desarrollode Aplicaciones</titulo>[/FONT]
[FONT=Arial, sans-serif]</libro>[/FONT]
[FONT=Arial, sans-serif]</libros>[/FONT]
Yo lo he hecho de la siguiente manera:
<libros>
{for $libro in //libro order by $libro/@año return
<libro>
<titulo>{$libro/titulo}</titulo>
</libro>}
</libros>
El problema es que no se como en el nodo libro, puedo añadir el atributo año.
Espero que alguien pueda solucionarmelo. Gracias.
[FONT=Arial, sans-serif]<libros>[/FONT]
[FONT=Arial, sans-serif]<libro año="1999">[/FONT]
[FONT=Arial, sans-serif]<titulo>Economics ofTechnology for Digital TV</titulo>[/FONT]
[FONT=Arial, sans-serif]</libro>[/FONT]
[FONT=Arial, sans-serif]<libro año="2003">[/FONT]
[FONT=Arial, sans-serif]<titulo>AutómatasProgramables</titulo>[/FONT]
[FONT=Arial, sans-serif]</libro>[/FONT]
[FONT=Arial, sans-serif]<libro año="2011">[/FONT]
[FONT=Arial, sans-serif]<titulo>Curso de ProgramaciónWeb</titulo>[/FONT]
[FONT=Arial, sans-serif]</libro>[/FONT]
[FONT=Arial, sans-serif]<libro año="2013">[/FONT]
[FONT=Arial, sans-serif]<titulo>Android 4. Desarrollode Aplicaciones</titulo>[/FONT]
[FONT=Arial, sans-serif]</libro>[/FONT]
[FONT=Arial, sans-serif]</libros>[/FONT]
Yo lo he hecho de la siguiente manera:
<libros>
{for $libro in //libro order by $libro/@año return
<libro>
<titulo>{$libro/titulo}</titulo>
</libro>}
</libros>
El problema es que no se como en el nodo libro, puedo añadir el atributo año.
Espero que alguien pueda solucionarmelo. Gracias.