XML

11
XML Programación web

description

XML. Programación web. Qué es XML?. XML stands for e X tensible  M arkup  L anguage. XML is designed to transport and store data. XML is important to know, and very easy to learn. Transferencia de Archivos. Archivos Planos - PowerPoint PPT Presentation

Transcript of XML

Page 1: XML

XML

Programación web

Page 2: XML

• XML stands for eXtensible Markup Language.• XML is designed to transport and store data.• XML is important to know, and very easy to

learn.

Qué es XML?

Page 3: XML

• Archivos Planos• Archivos Separados por

caracteres especiales Pipes (|), comas (,), etc.

Transferencia de Archivos

Page 4: XML

• web.xml• faces-config.xml• hibernate.xml• applicationContext.xml• Ant (Automatización de • pruebas)

Archivos de configuración

Page 5: XML

<?xml version="1.0" encoding="ISO-8859-1"?>

<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">

<display-name>Servlet de ejemplo</display-name> <description> Hola Mundo Servlet </description>

<!-- Publicamos nuestro servlet aqui -->

<servlet> <servlet-name>HWServlet</servlet-name> <servlet-class>com.softtek.servlet.ejemplos.HelloWorldServlet</servlet-class> </servlet>

<servlet-mapping> <servlet-name>HWServlet</servlet-name> <url-pattern>/HelloWorldServlet</url-pattern> </servlet-mapping>

<!-- Fin de la publicacion de servlets -->

</web-app>

Web.xml J2EE JspServlets Project

Page 6: XML

Web Services

Intercambio de datos entre diferentes plataformas

XML

Page 7: XML

<?xml version="1.0" encoding="UTF-8"?><note>  <to>Tove</to>  <from>Jani</from>  <heading>Reminder</heading>  <body>Don't forget me this weekend!</body></note>

Ejemplo 1. Nota.

Page 8: XML

<bookstore>  <book category="COOKING">    <title lang="en">Everyday Italian</title>    <author>Giada De Laurentiis</author>    <year>2005</year>    <price>30.00</price>  </book>  <book category="CHILDREN">    <title lang="en">Harry Potter</title>    <author>J K. Rowling</author>    <year>2005</year>    <price>29.99</price>  </book>  <book category="WEB">    <title lang="en">Learning XML</title>    <author>Erik T. Ray</author>    <year>2003</year>    <price>39.95</price>  </book></bookstore>

Ejemplo 2. Bookstore

Page 9: XML

• <bookstore>  <book-category="COOKING">

<book>    <title lang="en">Everyday Italian</title>     <author>Giada De Laurentiis</author>    <year>2005</year>     <price>30.00</price>

• </book>

<book>    <title lang="en">Everyday Spanish Food</title>     <author>Giada De Laurentiis</author>    <year>2012</year>     <price>60.00</price>

• </book>–   </book-cateogory>

• </bookstore>

Ejemplo 3.- Bookstore 2 (multiples elementos).

Page 10: XML

• An XML document with correct syntax is called "Well Formed".

• An XML document validated against a DTD is "Well Formed" and "Valid".

Note.dtd

<!DOCTYPE note

[

<!ELEMENT note (to,from,heading,body)>

<!ELEMENT to (#PCDATA)>

<!ELEMENT from (#PCDATA)>

<!ELEMENT heading (#PCDATA)>

<!ELEMENT body (#PCDATA)>

]>

XML DTD

Page 11: XML

• http://w3schools.com/xml/

Referencias