Comenzando apuntes DTD
This commit is contained in:
parent
0bef937654
commit
95fe704b4b
|
|
@ -108,4 +108,74 @@ Playlist: https://www.youtube.com/playlist?list=PLqu7Q-jp3eAPhrfYbS-RcTNZn7L2LMz
|
|||
|
||||
XMLCopyEditor: https://xml-copy-editor.sourceforge.io/
|
||||
|
||||
Tutorial XML (Abrirllave.com): https://www.abrirllave.com/xml/
|
||||
Tutorial XML (Abrirllave.com): https://www.abrirllave.com/xml/
|
||||
|
||||
|
||||
---
|
||||
|
||||
|
||||
## Apuntes DTD
|
||||
|
||||
#### Definición
|
||||
|
||||
Es una definición de estructura y sintaxis para los documentos XML o SGML. Se puede incluir dentro del mismo documento XML, ser un archivo separado, o una mezcla de ambas.
|
||||
|
||||
XML con DTD interno
|
||||
```xml
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE marcadores [
|
||||
<!ELEMENT marcadores (pagina)*>
|
||||
<!ELEMENT pagina (nombre, descripcion, url)>
|
||||
<!ELEMENT nombre (#PCDATA)>
|
||||
<!ELEMENT descripcion (#PCDATA)>
|
||||
<!ELEMENT url (#PCDATA)>
|
||||
]>
|
||||
<marcadores>
|
||||
<pagina>
|
||||
<nombre>Abrirllave</nombre>
|
||||
<descripcion>Tutoriales de informática.</descripcion>
|
||||
<url>http://www.abrirllave.com/</url>
|
||||
</pagina>
|
||||
</marcadores>
|
||||
```
|
||||
|
||||
XML con DTD externo (Privado)
|
||||
```dtd
|
||||
<!ELEMENT marcadores (pagina)*>
|
||||
<!ELEMENT pagina (nombre, descripcion, url)>
|
||||
<!ELEMENT nombre (#PCDATA)>
|
||||
<!ELEMENT descripcion (#PCDATA)>
|
||||
<!ELEMENT url (#PCDATA)>
|
||||
```
|
||||
```xml
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE marcadores SYSTEM "marcadores.dtd">
|
||||
<marcadores>
|
||||
<pagina>
|
||||
<nombre>Abrirllave</nombre>
|
||||
<descripcion>Tutoriales de informática.</descripcion>
|
||||
<url>http://www.abrirllave.com/</url>
|
||||
</pagina>
|
||||
</marcadores>
|
||||
```
|
||||
|
||||
XML con DTD externo (Público)
|
||||
```xml
|
||||
<?xml version="1.0" standalone="no"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Título</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Párrafo</p>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
Se suele usar el método externo cuando se utiliza para validar mas de un documento.
|
||||
|
||||
|
||||
|
||||
https://en.wikipedia.org/wiki/XML_schema#Languages
|
||||
Loading…
Reference in New Issue