Tutorial de XML

XML INÍCIO Introdução ao XML XML Como usar Árvore XML Sintaxe XML Elementos XML Atributos XML Namespaces XML Exibição XML XML HttpRequest Analisador de XML XML DOM XML XPath XML XSLT XML XQuery XML XLink Validador de XML XML DTD Esquema XML Servidor XML Exemplos XML Teste de XML Certificado XML

XML AJAX

Introdução AJAX AJAX XML Http Solicitação AJAX Resposta AJAX Arquivo XML AJAX PHP AJAX ASP AJAX Banco de dados AJAX Aplicativos AJAX Exemplos AJAX

XML DOM

Introdução ao DOM Nós DOM Acesso ao DOM Informações do nó DOM Lista de nós DOM Travessia do DOM Navegação DOM Valores de obtenção do DOM Nós de alteração do DOM Remoção de nós do DOM Substituir nós DOM DOM Criar nós DOM Adicionar nós Nós clones DOM Exemplos de DOM

Tutorial XPath

Introdução ao XPath Nós XPath Sintaxe XPath Eixos XPath Operadores XPath Exemplos de XPath

Tutorial XSLT

Introdução ao XSLT Idiomas XSL Transformação XSLT XSLT <modelo> XSLT <valor-de> XSLT <para-cada> XSLT <classificar> XSLT <if> XSLT <escolha> Aplicar XSLT XSLT no cliente XSLT no servidor XSLT Editar XML Exemplos de XSLT

Tutorial XQuery

Introdução ao XQuery Exemplo de XQuery XQuery FLWOR XQuery HTML Termos de XQuery Sintaxe XQuery Adicionar XQuery Seleção de XQuery Funções XQuery

XML DTD

Introdução DTD Blocos de construção de DTD Elementos DTD Atributos DTD Elementos DTD vs Attr Entidades DTD Exemplos de DTD

Esquema XSD

Introdução ao XSD XSD Como fazer XSD <esquema> Elementos XSD Atributos XSD Restrições XSD

Complexo XSD

Elementos XSD XSD vazio Apenas elementos XSD Somente texto XSD XSD Misto Indicadores XSD XSD <qualquer> XSD <qualquer atributo> Substituição XSD Exemplo de XSD

Dados XSD

Cadeia XSD Data XSD XSD Numérico XSD Misc Referência XSD

Serviços da Web

Serviços XML XML WSDL XML SOAP XML RDF XML RSS

Referências

Tipos de nós DOM Nó DOM Lista de nós DOM DOM NamedNodeMap Documento DOM Elemento DOM Atributo DOM Texto DOM DOM CDATA Comentário DOM DOM XMLHttpRequest Analisador de DOM Elementos XSLT Funções XSLT/XPath

item de esquema XML


❮ Referência Completa do Esquema XML

Definição e uso

O elemento de esquema define o elemento raiz de um esquema.

Informações do elemento

  • Elementos pai: NONE

Sintaxe

<schema
id=ID
attributeFormDefault=qualified|unqualified
elementFormDefault=qualified|unqualified
blockDefault=(#all|list of (extension|restriction|substitution))
finalDefault=(#all|list of (extension|restriction|list|union))
targetNamespace=anyURI
version=token
xmlns=anyURI
any attributes
>

((include|import|redefine|annotation)*,(((simpleType|complexType|
group|attributeGroup)|element|attribute|notation),annotation*)*)

</schema>

Attribute Description
id Optional. Specifies a unique ID for the element
attributeFormDefault Optional. The form for attributes declared in the target namespace of this schema. The value must be "qualified" or "unqualified". Default is "unqualified". "unqualified" indicates that attributes from the target namespace are not required to be qualified with the namespace prefix. "qualified" indicates that attributes from the target namespace must be qualified with the namespace prefix
elementFormDefault Optional. The form for elements declared in the target namespace of this schema. The value must be "qualified" or "unqualified". Default is "unqualified". "unqualified" indicates that elements from the target namespace are not required to be qualified with the namespace prefix. "qualified" indicates that elements from the target namespace must be qualified with the namespace prefix
blockDefault Optional. Specifies the default value of the block attribute on element and complexType elements in the target namespace. The block attribute prevents a complex type (or element) that has a specified type of derivation from being used in place of this complex type. This value can contain #all or a list that is a subset of extension, restriction, or substitution:
  • extension - prevents complex types derived by extension
  • restriction - prevents complex types derived by restriction
  • substitution - prevents substitution of elements
  • #all - prevents all derived complex types
finalDefault Optional. Specifies the default value of the final attribute on element, simpleType, and complexType elements in the target namespace. The final attribute prevents a specified type of derivation of an element, simpleType, or complexType element. For element and complexType elements, this value can contain #all or a list that is a subset of extension or restriction. For simpleType elements, this value can additionally contain list and union:
  • extension - prevents derivation by extension
  • restriction - prevents derivation by restriction
  • list - prevents derivation by list
  • union - prevents derivation by union
  • #all - prevents all derivation
targetNamespace Optional. A URI reference of the namespace of this schema
version Optional. Specifies the version of the schema
xmlns A URI reference that specifies one or more namespaces for use in this schema. If no prefix is assigned, the schema components of the namespace can be used with unqualified references
any attributes Optional. Specifies any other attributes with non-schema namespace

Exemplo 1

<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

<xs:element name="values" type="xs:string" />

</xs:schema>

Exemplo 2

Neste exemplo, os componentes do esquema (nome do elemento, tipo) no namespace http://www.w3.org/2001/XMLSchema não são qualificados e os de https://www.w3schools.com/w3schoolsschema (mystring) são qualificados com o prefixo wsc:

<?xml version="1.0"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:wsc="https://www.w3schools.com/w3shoolsschema">

<element name="fname" type="wsc:mystring"/>

</schema>

❮ Referência Completa do Esquema XML