Foros del Web » Programación para mayores de 30 ;) » Programación General »

DTD's y Schemas

Estas en el tema de DTD's y Schemas en el foro de Programación General en Foros del Web. Saludos, Tengo algunos conocimientos básico de xml, y conozco más o menos las dtds, pero he oído que los schemas son mejores? En que consiste ...
  #1 (permalink)  
Antiguo 20/01/2005, 12:17
 
Fecha de Ingreso: marzo-2004
Ubicación: San José, Costa Rica
Mensajes: 234
Antigüedad: 20 años
Puntos: 0
DTD's y Schemas

Saludos,

Tengo algunos conocimientos básico de xml, y conozco más o menos las dtds, pero he oído que los schemas son mejores?

En que consiste un schema y pq es mejor que un dtd?

Gracias.
__________________
Quieres una cuenta de Gmail?
Solo enviame un privado... :-)
  #2 (permalink)  
Antiguo 27/01/2005, 15:59
 
Fecha de Ingreso: febrero-2004
Mensajes: 221
Antigüedad: 20 años, 2 meses
Puntos: 0
Para una persona como vos, que no se molesta en buscar en google, es mejor un dtd.
  #3 (permalink)  
Antiguo 27/01/2005, 16:46
 
Fecha de Ingreso: marzo-2004
Ubicación: San José, Costa Rica
Mensajes: 234
Antigüedad: 20 años
Puntos: 0
Bueno pues gracias...

Sin duda que es mejor buscar en google que escuchar respuestas como las tuyas...
__________________
Quieres una cuenta de Gmail?
Solo enviame un privado... :-)
  #4 (permalink)  
Antiguo 27/01/2005, 22:50
 
Fecha de Ingreso: febrero-2004
Mensajes: 221
Antigüedad: 20 años, 2 meses
Puntos: 0
Sin duda es necesaria una respuesta mia para hacer que una persona como vos use google. No me interesa pelear con vos, solo quiero ayudarte. Perdon

La mejor respuesta a tu pregunta
There are a number of reasons why XML Schema is better than DTD.
XML Schema has Support for Data Types

One of the greatest strengths of XML Schemas is the support for data types.

With the support for data types:

* It is easier to describe permissible document content
* It is easier to validate the correctness of data
* It is easier to work with data from a database
* It is easier to define data facets (restrictions on data)
* It is easier to define data patterns (data formats)
* It is easier to convert data between different data types

XML Schemas use XML Syntax

Another great strength about XML Schemas is that they are written in XML.

Because XML Schemas are written in XML:

* You don't have to learn another language
* You can use your XML editor to edit your Schema files
* You can use your XML parser to parse your Schema files
* You can manipulate your Schema with the XML DOM
* You can transform your Schema with XSLT

XML Schemas Secure Data Communication

When data is sent from a sender to a receiver it is essential that both parts have the same "expectations" about the content.

With XML Schemas, the sender can describe the data in a way that the receiver will understand.

A date like this: "03-11-2004" will, in some countries, be interpreted as 3. November and in other countries as 11. March, but an XML element with a data type like this:

<date type="date">2004-03-11</date>

ensures a mutual understanding of the content because the XML data type date requires the format YYYY-MM-DD.
XML Schemas are Extensible

XML Schemas are extensible, just like XML, because they are written in XML.

With an extensible Schema definition you can:

* Reuse your Schema in other Schemas
* Create your own data types derived from standard types
* Reference multiple schemas from the same document

Well-Formed is not Enough

A well-formed XML document is a document that conforms to the XML syntax rules:

* must begin with the XML declaration
* must have one unique root element
* all start tags must match end-tags
* XML tags are case sensitive
* all elements must be closed
* all elements must be properly nested
* all attribute values must be quoted
* XML entities must be used for special characters

Even if documents are Well-Formed they can still contain errors, and those errors can have serious consequences. Think of this situation: you order 5 gross of laser printers, instead of 5 laser printers. With XML Schemas, most of these errors can be caught by your validating software.
Cita:
Iniciado por W3Schools
  #5 (permalink)  
Antiguo 28/01/2005, 08:24
 
Fecha de Ingreso: marzo-2004
Ubicación: San José, Costa Rica
Mensajes: 234
Antigüedad: 20 años
Puntos: 0
Bueno acepto tus disculpas... ciertamente mi aptitud fue un poco perezosa en un principió....

Ahora he estado investigando un poco al respecto, ok según veo el XML Schema no es más que una DTD sobre la cual basar nuestros docuemtos xml...

Entonces aunque todas las virtudes que haz mencionado son ciertas... el XML Schema y la DTD realmente no son competencia directa sino que se complementan una sobre la otra...?

Y según veo aunque el XML Schema tenga todas esas ventajas y facilidades, la DTD sigue siendo más poderosa... o no?

Bueno muy interesante creo que investigaré un poco más...

Por cierto no se quien sea el Moderador de este foro pero podría tener una sección de faqs...
__________________
Quieres una cuenta de Gmail?
Solo enviame un privado... :-)
  #6 (permalink)  
Antiguo 28/01/2005, 11:34
 
Fecha de Ingreso: febrero-2004
Mensajes: 221
Antigüedad: 20 años, 2 meses
Puntos: 0
En realidad, mas poderoso es el XML Schema y mucho mas moderno.
Sin embargo, DTD va a seguir siendo mas usado por largo rato, ya que lo que haces en un dtd con 10 lineas lo haces en 30 con XSD.

En estos momentos para facilitarte la tarea es muy recomendable que uses XML Spy, que te permite ir creando en forma de arbol el documento, y el escribe todo el codigo.
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 04:23.