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

Esquema XML anyAttribute Element


❮ Referência Completa do Esquema XML

Definição e uso

O elemento anyAttribute permite que o autor estenda o documento XML com atributos não especificados pelo esquema.

Informações do elemento

  • Elementos pai: complexType, restrição (ambos simpleContent e complexContent), extensão (ambos simpleContent e complexContent), attributeGroup

Sintaxe

<anyAttribute
id=ID
namespace=namespace
processContents=lax|skip|strict
any attributes
>

(annotation?)

</anyAttribute>

(O sinal ? declara que o elemento pode ocorrer zero ou uma vez dentro do elemento anyAttribute)

Attribute Description
id Optional. Specifies a unique ID for the element
namespace Optional. Specifies the namespaces containing the attributes that can be used. Can be set to one of the following:
  • ##any - attributes from any namespace is allowed (this is default)
  • ##other - attributes from any namespace that is not the namespace of the parent element can be present
  • ##local - attributes must come from no namespace
  • ##targetNamespace - attributes from the namespace of the parent element can be present
  • List of {URI references of namespaces, ##targetNamespace, ##local} - attributes from a space-delimited list of the namespaces can be present
processContents Optional. Specifies how the XML processor should handle validation against the elements specified by this any element. Can be set to one of the following:
  • strict - the XML processor must obtain the schema for the required namespaces and validate the elements (this is default)
  • lax - same as strict but; if the schema cannot be obtained, no errors will occur
  • skip - The XML processor does not attempt to validate any elements from the specified namespaces
any attributes Optional. Specifies any other attributes with non-schema namespace

Exemplo 1

O exemplo a seguir mostra uma declaração para um elemento chamado "person". Usando o elemento <anyAttribute> o autor pode adicionar qualquer número de atributos ao elemento "person":

<xs:element name="person">
  <xs:complexType>
    <xs:sequence>
      <xs:element name="firstname" type="xs:string"/>
      <xs:element name="lastname" type="xs:string"/>
    </xs:sequence>
    <xs:anyAttribute/>
  </xs:complexType>
</xs:element>

❮ Referência Completa do Esquema XML