You are on page 1of 21

Backend, WCF, Android, Windows Phone 7, iOS (Sesion 01/15)

Periodo: Agosto-Diciembre, 2011 Majahide Payn Hz.

Ejemplo de presentacin Conceptos bsicos


SOAP, REST, WSDL, RPC, RSS, ESB, WCF, XSD, XSLT, JSON Datos estadsticos. Tipos de serializacion

XML

Ejercicio Tarea Bibliografa

Introduccin DataIslands Introduccin a XSLT y Ejemplos Creacin de archivos DTD (Document Type Definitions) Creacin de XML Schema Definitions (XSD)

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.

SOAP REST JSON

XSD XSLT XML DTD

WCF WSDL

RPC RSS ESB

http://www.computerworld.com/s/article/9214206/Smartphone_OS_shootout_Android_vs._iO S_vs._Windows_Phone_

http://www.youtube.com/watch?v=vA73SyeIcRs&feature=player_embedded#at=186

http://www.pcworld.com/article/207451/smackdown_windows_phone_7_phones_vs_iphone_4 _vs_droid_x.html

Blackberry (Mensajera)
Java

Goggle (Desarrollo)
Android

Windows (Innovacin)
Mobile 6.x Phone 7

Apple (Grficos)
iOS

Nokia (Precio ?)
Symbian Linux maemo

Xpath XSLT Xquery Xpointer XLink

Herramientas para XML

Editores simples: Notepad, Textpad, Notepad++, BBEdit Adobe Dreamweaver ( Validacin DTD o XSD ) Altova XMLSpy ( Depuracin de XSLT, Prueba de Xpath) Microsoft Visual Web Developer Express

Estandarizado en 1998 (w3c, World Wide Web Consortion)

Tecnologas Relacionadas

Sintaxis basado en etiquetas Etiquetas personalizadas

Que es XML? Para que se utiliza?


Estructura y descripcin de informacin Intencionalmente para ser utilizado en internet Mecanismo de intercambio de datos entre sistemas dispares.

HTML, RSS (Blogs), AJAX, Web services

http://www.w3c.org

Sintaxis correcta Contenido correspondiente a las etiquetas Validacin de XML Namespaces Ventajas Desacoplamiento de la presentacin Fcil lectura y entendimiento Las etiquetas ayudan a clasificar datos Formato abierto Intercambio entre sistemas que no fueron diseados para comunicarse. Desventajas NO es bueno con grandes cantidades de datos Difcil de leer si es demasiada informacin Ciertos datos no son bien representados (Imgenes, Binarios) Por su simplicidad se recae en el abuso.

<?xml version="1.0" encoding="utf-8"?> <?xmlSpellCheckMode mode=us-english?> <! Este es solo un ejemplo -->
ETIQUETA RAIZ

DECLARACION DIRECTIVAS (INS. PROCESAMIENTO) COMENTARIOS

<! [CDATA[ ] ]>

&#60; <alumnos> CONTENIDO <kardex> ETIQUETAS <matricula>12345</matricula> &copyright; <nombre>Sandra Garcia</nombre> ATRIBUTOS <correo>sandra@dominio.com</correo> <materias> <materia comun="yes" status="cursada" clave="123" cal01="10" cal02="9" cal03="8">Matematicas basicas</materia> <materia status="actual" clave="234" cal01="9" cal02="8" cal03="10">Analisis financiero</materia> <materia status="sincursar" clave="345" cal01="8" cal02="9" cal03="10">Programacion orientada a objetos</materia> </materias> </kardex> ANIDAMIENTO <kardex> <matricula>67890</matricula> DEMO <nombre>Carlos Soto</nombre> <correo>carlos@dominio.com</correo> <materias> <materia comun="yes" status="cursada" clave="123" cal01="10" cal02="9" cal03="8">Matematicas basicas</materia> <materia status="actual" clave="234" cal01="9" cal02="8" cal03="10">Analisis financiero</materia> <materia status="sincursar" clave="345" cal01="8" cal02="9" cal03="10">Programacion orientada a objetos</materia> </materias> </kardex> </alumnos>

<html> <head> <title>Ejemplo de "DataIslands"</title> </head> <body> <xml id="dtExtAlumnos"/> <script language="javascript" type="text/javascript"> dtExtAlumnos.async = false; dtExtAlumnos.load("kardex.xml"); </script> <table dataSrc="#dtExtAlumnos"> <thead> <th>Matricula</th> <th>Nombre</th> <th>Correo</th> </thead> <tr> <td><span datafld="matricula"></span></td> <td><span datafld="nombre"></span></td> <td><span datafld="correo"></span> </td> </tr> </table> </body> </html>

SOLO IE!
ETIQUETA PARA VINCULAR LOS DATOS

* SI NO SE PONE EN OCASIONES NO LO LEE *

VINCULAR LA TABLA CON LA FUENTE DE DATOS

VINCULAR LOS DATOS A DESPLEGAR

DEMO

<?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"> <xsl:output method="xml" indent="yes"/> <xsl:template match="/alumnos"> <xsl:for-each select="kardex"> <div style="border-bottom:solid 1px #000; margin-bottom:5px;"> <div><strong>Matricula: </strong><xsl:value-of select="matricula"/></div> <div><xsl:value-of select="nombre"/></div> <div><strong>Correo electronico: </strong><xsl:value-of select="correo"/></div> <table> <thead> <th>Clave</th> <th>Nombre</th> <th>Cal 1</th> <th>Cal 2</th> <th>Cal 3</th> </thead> <xsl:for-each select="materias/materia"> <xsl:sort select="text()" order="ascending"/> <tr> <td><xsl:value-of select="@clave"/></td> <td><xsl:value-of select="text()"/></td> <td><xsl:value-of select="@cal01"/></td> <td><xsl:value-of select="@cal02"/></td> <td><xsl:value-of select="@cal03"/></td> </tr> </xsl:for-each>

NAMESPACE PLANTILLAS (TEMPLATE)

CICLOS

VALORES

STRUCTURA
SORTEO

</table> </div>
</xsl:for-each> </xsl:template> </xsl:stylesheet>

ATRIBUTOS

DEMO

HTML

PDF

ASCII

RTF

XML

XML DOC

XSL TRANSFORMATION ENGINE IE, Firefox, Saxon, Xalan

RESULTADO

XSLT DOC
<xsl:stylesheet> <xsl:template name=name match=xpath> <xsl:value-of select=xpath> <xsl:attribute> <xsl:text> <xsl:for-each select=xpath> <xsl:if test=condition> <xsl:choose>, <xsl:when>, <xsl:otherwise> <xsl:sort select=xpath> <xsl:call-template name=template name>

<!DOCTYPE kardex [ <!ELEMENT kardex (matricula, nombre, correo+, promedio)> <!ELEMENT matricula (#PCDATA)> <!ELEMENT nombre (#PCDATA)> <!ELEMENT correo (#PCDATA)> <!ELEMENT promedio (#PCDATA)>

DECLARACION

ELEMENTOS PERMITIDOS

VALIDACION DE CONTENIDO

<!ATTLIST correo tipo (personal | trabajo) #REQUIRED> ]>


ATRIBUTOS
<!ELEMENT MISC CUALQUIERCOSA> <!ELEMENT IMG EMPTY > <!ELEMENT NOMBRE (#PCDATA) > <!ELEMENT MATERIAS(MATERIA, )> <!ELEMENT TIPO (BAJA, ACTIVO) > <!ELEMENT MATERIAS(#PCDATA | MAESTRO) >

? = 0, 1 + = 1, o mas * = 0, o mas

<kardex> <matricula>12345</matricula> <nombre>Sandra Garcia</nombre> <correo tipo="personal">sandra@dominio.com</correo> <correo tipo="trabajo">sandra@empresa.com</correo> <promedio>8</promedio> </kardex>

DEMO

<?xml version="1.0" encoding="utf-8"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:element name"kardex"> <xsd:complexType> <xsd:sequence> <xsd:element name="matricula" type="xsd:string" /> <xsd:element name="nombre" type="xsd:string" /> <xsd:element name="correo" type="xsd:string" minOccours="1"> <xsd:complexType mixed="true"> <xsd:attribute name="tipo" use="required"> <xsd:simpleType> <xsd:restriction base="xsd:string"> <xsd:enumeration value="personal"/> <xsd:enumeration value="trabajo" /> </xsd:restriction> </xsd:simpleType> </xsd:attribute> </xsd:complexType> </xsd:element> <xsd:element name="promedio" type="xsd:string"> <xsd:simpleType> <xsd:restriction base="xsd:positiveInteger"> <xsd:minInclusive value="5"/> <xsd:maxInclusive value="10" /> <xsd:pattern value="\d{1}" </xsd:restriction> </xsd:simpleType> </xsd:element> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:schema>

Crear una representacion de un objeto

Que es computo mvil? Ventajas y desventajas de cada tipo de serializacion Como esta distribuido el mercado? Revisar W3C Ejemplo de etiquetas validas e invalidas Tarjeta de presentacin XML + CSS Factura = DataIslands

Service-Oriented Architecture
A Field Guide to Integration XML and Web Services Thomas Erl Prentice Hall, USA, March 2009

World Wide Web Consortium http://www.w3c.org

You might also like