Diferencia entre revisiones de «Gambas/Manipular documentos XML»
Contenido eliminado Contenido añadido
Línea 3:
{{Consejo | Es importante aclarar que XHTML es un documento tipo XML pero no son lo mismo. XHTML esta limitado a paginas de internet como su formato estándar. Sin embargo, XML es un formato de propósito general y puede ser usado para trabajar con cualquier tipo de datos}}
== '''
All XML documents begin with
<?xml version=”1.0” encoding=”UTF-16”?>
indicating that the rest of the document contains XML data, specifies which version is being used and Unicode characters in it.
The XML declaration is followed by an element 'root' that can contain any number of sub-elements between their start and end tag. Elements can contain attributes, and attribute names can only appear only once in an element. Elements must be properly nested, should not overlap, and therefore must be closed in the opposite order as they were open. Comments begin with a <! - And End up with ->. With this in mind, take a look at the following''''well-formed XML document.
<?xml version=”1.1” encoding=”UTF-16” ?>
< !--
< !--
<
<element_name attribute_name = "attribute_value">
</
</
As you can see, the document is separated into different lines and there is some indentation to indicate the various levels of nesting, however this is not necessary, any document can go in a single line of text. This formatted this way to help you understand the document. You will find very useful this way to format XML documents when you need to read or edit an XML document into a plain text editor.
== '''Escribir XML''' ==
|