Académique Documents
Professionnel Documents
Culture Documents
DTD
<!ELEMENT nombreElemento (TIPOELEMENTO)> &#decimal; &#xHexadecimal;
Siendo TIPOELEMENTO: ó
#PCDATA una cadena < <
Lista_elementos
separado por , para indicar secuencia
> >
separado por | para indicar alternativas "e;
seguido de ? =0..1 Opcional. & &
seguido de * =0..n Opcional y Repetible espacio
seguido de + =1..n Requerido y Repetible
EMPTY sin contenido, normalmente se le definen atributos
En XML sera <disco formato=CD titulo=hola />
ANY cualquier tipo de contenido, es demasiado libre
Utilizar atributos cuando su contenido no sea susceptible de contener otros elementos. Los
valores de los atributos debern ir entre comillas.
<!ATTLIST nombreElemento
nombreAtributo TIPOATRIBUTO OBLIGATORIO
nombreAtributo TIPOATRIBUTO OBLIGATORIO >
Siendo TIPOATRIBUTO:
CDATA una cadena
(Lista_valores separado por | para indicar posibles valores)
ID -> Idenitficador nico
IDREF ->
NMTOKEN ->
Siendo OBLIGATORIO:
#REQUIRED -> el atributo es obligatorio
#IMPLIED -> el atributo es opcional
#FISXED -> el atributo siempre tiene le mismo valor
valorPredeterminado
Se pueden definir sinnimos ENTITY para ahorrar escribir en las definiciones
<!ENTITY % nombreSinonimo Definicin> % indica que es una entidad parmetro
p.ejemplo <!ENTITY % mediaObj audio|video|text>
<!ENTITY % SupermediaObj %mediaObj;|olor|sabor>
<!ENTITY nombreSinonimo Definicin>
<!ENTITY oacute >
ó & indica que es una entidad
<!ELEMENT root (row)+ >
<!ELEMENT row (field)+ >
<!ELEMENT field (#PCDATA) >
<!ATTLIST field name CDATA #REQUIRED >
, (secuencia) <sequence>
| (alternativas) <choice>
? (Opcional) Se han de emplear los atributos
+(Requerido y Repetible) Soportado predefinidos de maxOccurs y
*(Opcional y Repetible) minOccurs
Se pueden agrupar declaraciones de
ATTLIST <attributeGroup>
<attributes>
Tipo de atributo CDATA, ID,
<simpleType>predefinidos
IDREF, NOTATION, ...
ENTITY NO Soportado Las entidades son declaradas en
declaraciones de marcas en el XML
XMLSchema.xsd
xsd:puede ser cualquier cadena
<?xml version="1.0"?>
<hojaPedido fechaPedido="1999-10-20">
<enviarA pais="EEUU">
<nombre>Alice Smith</nombre>
<calle>123 Maple Street</calle>
<ciudad>Mill Valley</ciudad>
<estado>CA</estado>
<zip>90952</zip>
</enviarA>
<facturarA pais="EEUU">
<nombre>Robert Smith</nombre>
<calle>8 Oak Avenue</calle>
<ciudad>Old Town</ciudad>
<estado>PA</estado>
<zip>95819</zip>
</facturarA>
<comentario>Deprisa, mi csped parece una selva!</comentario>
<elementos>
<elemento numProducto="872-AA">
<nombreProducto>Cortacesped</nombreProducto>
<cantidad>1</cantidad>
<precioEEUU>148.95</precioEEUU>
<comentario>Confirmar que es elctrico</comentario>
</elemento>
<elemento numProducto="926-AA">
<nombreProducto>Monitor para bebes</nombreProducto>
<cantidad>1</cantidad>
<precioEEUU>39.98</precioEEUU>
<fechaEnvio>1999-05-21</fechaEnvio>
</elemento>
</elementos>
</hojaPedido>
Le corresponde
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:annotation>
<xsd:documentation xml:lang="es">
Esquema de hoja de pedido para Example.com.
Copyright 2000 Example.com. Todos los derechos reservados.
</xsd:documentation>
</xsd:annotation>
<xsd:element name="hojaPedido" type="TipoHojaPedido"/>
<xsd:element name="comentario" type="xsd:string"/>
<xsd:complexType name="TipoHojaPedido">
<xsd:sequence>
<xsd:element name="enviarA" type="direccionEEUU"/>
<xsd:element name="facturarA" type="direccionEEUU"/>
<xsd:element ref="comentario" minOccurs="0"/>
<xsd:element name="elementos" type="Elementos"/>
</xsd:sequence>
<xsd:attribute name="fechaPedido" type="xsd:date"/>
</xsd:complexType>
<xsd:complexType name="direccionEEUU">
<xsd:sequence>
<xsd:element name="nombre" type="xsd:string"/>
<xsd:element name="calle" type="xsd:string"/>
<xsd:element name="ciudad" type="xsd:string"/>
<xsd:element name="estado" type="xsd:string"/>
<xsd:element name="zip" type="xsd:decimal"/>
</xsd:sequence>
<xsd:attribute name="pais" type="xsd:NMTOKEN" fixed="EEUU"/>
</xsd:complexType>
<xsd:complexType name="Elementos">
<xsd:sequence>
<xsd:element name="elemento" minOccurs="0" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="nombreProducto" type="xsd:string"/>
<xsd:element name="cantidad">
<xsd:simpleType>
<xsd:restriction base="xsd:positiveInteger">
<xsd:maxExclusive value="100"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="precioEEUU" type="xsd:decimal"/>
<xsd:element ref="comentario" minOccurs="0"/>
<xsd:element name="fechaEnvio" type="xsd:date" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="numProducto" type="TipoNumP" use="required"/>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<!-- Stock Keeping Unit [Cdigo de Almacenaje], -->
<!-- un cdigo para identificar productos -->
<xsd:simpleType name=" TipoNumP ">
<xsd:restriction base="xsd:string">
<xsd:pattern value="\d{3}-[A-Z]{2}"/>
<!-- tres dgitos seguidos de un guin seguido de dos caracteres ASCII en maysculas -->
</xsd:restriction>
</xsd:simpleType>
</xsd:schema>
Para los Elementos los atributos minOccurs y el maxOccurs es 1 y se le puede asignar unbounded
[sin lmite]. Para los atributos su atributo use puede ser required y otional
Los valores por defecto de elementos y atributos son declarados utilizando el atributo default
Tipo Simple Ejemplos (delimitados por comas)
string Confirmar que es elctrico
token Confirmar que es elctrico
byte -1, 126
unsignedByte 0, 126
integer -126789, -1, 0, 1, 126789
positiveInteger 1, 126789
negativeInteger -126789, -1
int -1, 126789675
unsignedInt 0, 1267896754
long -1, 12678967543233
unsignedLong 0, 12678967543233
short -1, 12678
unsignedShort 0, 12678
decimal -1.23, 0, 123.4, 1000.00
float -INF, -1E4, -0, 0, 12.78E-2, 12, INF, NaN
double -INF, -1E4, -0, 0, 12.78E-2, 12, INF, NaN
boolean true, false 1, 0
time 13:20:00.000, 13:20:00.000-05:00
dateTime 1999-05-31T13:20:00.000-05:00
date 1999-05-31
anyURI http://www.example.com/, http://www.example.com/doc.html#ID5
ID
IDREF
NMTOKEN US, Brasil
Propiedades de tipos simples:
Todos: pattern, enumeration, whiteSpace
Cadenas: Length, minLength, maxLength,
Nmeros y fechas: minInclusive,maxInclusive, minExclusive, maxExclusive,
Nmeros: totalDigits, fractionDigits
<!--ó -->
<xsd:element name="oacute" type="xsd:token" fixed=""/>
Definicin de miEntero, rango de 10000-99999
<xsd:simpleType name="miEntero">
<xsd:restriction base="xsd:integer">
<xsd:minInclusive value="10000"/>
<xsd:maxInclusive value="99999"/>
</xsd:restriction>
</xsd:simpleType>
Utilizacin de la Propiedad Enumeration
<xsd:simpleType name="estadoEEUU">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="AK"/>
<xsd:enumeration value="AL"/>
<xsd:enumeration value="AR"/>
<!-- y as el resto ... -->
</xsd:restriction>
</xsd:simpleType>
Crear una Lista de 6 elementos miEntero
<xsd:simpleType name="listaDeMisEnteros">
<xsd:list itemType="miEntero"/>
<xsd:length value="6"/>
</xsd:simpleType>
todos los elementos de un grupo pueden aparecer una vez o ninguna, y pueden aparecer en cualquier orden
<xsd:complexType name="TipoHojaPedido">
<xsd:all>
<xsd:element name="enviarA" type="direccionEEUU"/>
<xsd:element name="facturarA" type="direccionEEUU"/>
<xsd:element ref="comentario" minOccurs="0"/>
<xsd:element name="elementos" type="Elementos"/>
</xsd:all>
<xsd:attribute name="fechaPedido" type="xsd:date"/>
</xsd:complexType>
eXtensibility Style Lenguaje. XSL
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/strict.dtd>
<!-- ESTO ES SOLO UN EJEMPLO -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<xsl:script>
<![CDATA[
var gMaxHeight = 0;
var gnumPerRow = ""
function breakRow(e) {
if (gnumPerRow == "") {
gnumPerRow = e.selectSingleNode("//options").getAttribute("numperrow");
}
return ((absoluteChildNumber(e) - 1)%gnumPerRow) == 0;
}
]]>
</xsl:script>
<xsl:script language="VBScript">
<![CDATA[
Option Explicit
Dim iResultCount
Function CountResults(n)
iResultCount = iResultCount + 1
End Function
]]>
</xsl:script>
<html xmlns=http://www.w3.org/TR/xhtnl1/strict>
<head>
<title>Facturaci&oacuote;n de subvenciones</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="ProgId" content="Access.Application" />
<meta name="VBSForEventHandlers" value="true" />
<link rel=stylesheet type=text/css href=hojaestilos.css> <!--Es escluyente de estilos locales -->
<style type=text/css> <!--para style y script en XHTML es necesario ponerlo en <![CDATA[ -->
<![CDATA[
@import URL(hoja.css);
P{color:yellow; font-size:10pt;}
]]>
</style>
<script type="text/javascript" src="../images/CSScriptLib.js"></script>
<script language="VBScript">
<!-- On Error Resume Next
Set NewDocumentButton = CreateObject("SharePoint.OpenDocuments.1")
fNewDoc = IsObject(NewDocumentButton)
Sub Window_OnLoad()
Set PivotChart.DataSource = PivotTable
End Sub
-->
<script >
<!-- function ScreenResolutionInit() {
if(window.parent.g_bInHighScreenRes) {
spanScreenResolution.style.visibility='hidden';
}
alert(L_NewDocumentRuntimeError_Text);
}
-->
</SCRIPT>
<OBJECT classid="CLSID:0002E553-0000-0000-C000-000000000046" id="MSODSC" tabIndex="-1"> </OBJECT>
</head>
<body bgcolor="#ffffff" onload="CSScriptInit(); >
<a ref.= onmouseover="return CSIShow( 1) onclick="CSAction(2)> onclick="removeSession(); return false;">
<img src=foto.gif height="2" width="4" border="0" alt="Image Info" /></a>
<a href="javascript:goNext()" onmouseover="this.style.color='red';return showName()"
onblur="status='';this.style.color='darkblue'">Siguiente sugerencia</a>
<a name=marcador1 />
<a href="#marcador1> ir a primera </a>
<center> <h1>Direccin General de Aviacin Civil</h1> </center>
<div class="rojo" >
<center> <b><i>Seccin de Tarifas</b></i> </center>
<strong> Color Management</strong>
</div>
<ol type=A start=5>
<li> Numeracin 5-E </li>
<li> Numeracin 6-F </li>
<li> Numeracin 7-G </li>
</ol>
<ul>
<li> vieta 1 </li>
<li> vieta 2</li>
<li> vieta 3 </li>
</ul>
<hr /> esto hace una linea horizontal
<b><font face="verdana" size="1">FACTURACIN </font></b>
<P> Esto es un prrafo con espaciado de prrafo anterior y posterior </P>
<P /> parrafo vacio
<br />
<pre> Respeta los espacios,sin colapsarlos </pre>
<xsl:for-each select="facturacion/factura">
<table border="0" width=100%>
<tr>
<td align=right>N.I.F. de la compaa area: </td> <td><b> <xsl:value-of select=@cif" /> </b> </td>
</tr>
<tr>
<td>nm. factura: </td> <td bgcolor="#ffcc99"> <b> <xsl:value-of select=@num" /> </b> </td>
</tr>
<tr>
<td>fecha de factura: </td> <td bgcolor="#ffcc99"> <b> <xsl:value-of select=@fecha" /> </b> </td>
</tr>
</table>
<br />
<script>
document.write(window.parent.g_ClickNextStr);
</script>
<xsl:for-each select="billete">
<p /> <hr /> Atributos: <xsl:value-of select="./@numero" />
BILLETE: <b> <xsl:value-of select=@numero" /> </b> Elementos: <xsl:value-of select="./importebruto" />
<br />
FECHA DEL BILLETE: <xsl:value-of select=@fecha" />
<table border="0">
<tr>
<th>IMPORTE BRUTO: </th>
<td bgcolor="#ffcc99"> <xsl:value-of select=importebruto" /> </td>
</tr>
<tr>
<th>DESCUENTOS: </th>
<td bgcolor="#ffcc99"> <xsl:value-of select=descuentos" /> </td>
</tr>
<tr>
<th>SUBVENCION NETA: </th>
<td bgcolor="#ffcc99"> <xsl:value-of select=subvencionneta" /> </td>
</tr>
</table>
<p /> <b>VUELOS</b> <br />
<table border="0">
<tr>
<th>NMERO</th> <th>FECHA</th> <th>HORA</th> <th>Ca Vuelo</th> <th>ORIGEN</th>
<th>DESTINO</th>
</tr>
<xsl:for-each select=vuelo">
<tr>
<td bgcolor="#ffcc99"> <xsl:value-of select=@numero" /> </td>
<td bgcolor="#ffcc99"> <xsl:value-of select=@fecha" /> </td>
<td bgcolor="#ffcc99"> <xsl:value-of select=@hora" /> </td>
<td bgcolor="#ffcc99"> <xsl:value-of select=@cif" /> </td>
<td bgcolor="#ffcc99"> <xsl:value-of select=@origen" /> </td>
<td bgcolor="#ffcc99"> <xsl:value-of select=@destino" /> </td>
</tr>
<xsl:for-each select=cupon">
<tr>
<th colspan="6">CUPON</th>
</tr>
<tr>
<th>DNI:</th> <td bgcolor="#ffcc99" colspan="2"> <xsl:value-of select=@dni" /> </td>
<th>TIPO DESC.:</th> <td bgcolor="#ffcc99" colspan="2"> <xsl:value-of select=@tiposubvencion" /></td>
</tr>
</xsl:for-each> <!-- cupon" -->
</xsl:for-each><!-- vuelo" -->
</table>
<p />
<xsl:for-each select="extras">
Se pueden usar los .. para hacer referencia al padre
EXTRAS <br />
<xsl:for-each select="extra"> . retorna concatenado todo lo que de l cuelgue
<b>extra:</b><xsl:value-of select="." />
<b>valor:</b>
<xsl:if test="valor[.='200']"> MALO </xsl:if>
<xsl:if test="valor[.!='200']"> bueno </xsl:if>
<xsl:value-of select="valor"/> <br />
</xsl:for-each>
total=<xsl:value-of select="@total"/>
</xsl:for-each>