1 / 11

XML

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

Télécharger la présentation

XML

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. XML Programación web

  2. Qué es 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.

  3. Transferencia de Archivos • Archivos Planos • Archivos Separados por caracteres especiales Pipes (|), comas (,), etc.

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

  5. Web.xml J2EE JspServlets Project <?xmlversion="1.0" encoding="ISO-8859-1"?> <web-appxmlns="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 servletaqui --> <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>

  6. Intercambio de datos entre diferentes plataformas Web Services XML

  7. Ejemplo 1. Nota. <?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>

  8. Ejemplo 2. Bookstore <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>

  9. Ejemplo 3.- Bookstore 2 (multiples elementos). • <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>

  10. XML DTD Note.dtd <!DOCTYPE note [ <!ELEMENT note (to,from,heading,body)> <!ELEMENT to (#PCDATA)> <!ELEMENT from (#PCDATA)> <!ELEMENT heading (#PCDATA)> <!ELEMENT body (#PCDATA)> ]> • An XML document with correct syntax is called "Well Formed". • An XML document validated against a DTD is "Well Formed" and "Valid".

  11. Referencias • http://w3schools.com/xml/

More Related