Verifica se o nó atual do XML possui algum atributo declarado.
Sintaxe
DOMHasAtt()
Retorno
Nome | Tipo | Descrição |
---|---|---|
lRet | lógico | Retorna verdadeiro (.T.) caso possua algum atributo. Caso contrário, falso (.F.). |
Exemplos
Exemplo 1
user function TXMLDAtt() Local cXML := "" Local oXML oXML := TXMLManager():New() cXML += '<book isNew="true">' + CRLF cXML += ' <title>A Clash of Kings</title>' + CRLF cXML += ' <author>George R. R. Martin</author>' + CRLF cXML += ' <price>9.99</price>' + CRLF cXML += ' <origin>US</origin>' + CRLF cXML += '</book>' + CRLF if !oXML:Parse( cXML ) conout( "Errors on Parse!" ) return endif // Vai exibir "There is some attribute!", // por causa do atributo isNew, já que // está posicionado em book if !oXML:DOMHasAtt() conout( "There is no attribute!" ) else conout( "There is some attribute!" ) endif oXML:DOMChildNode() // Vai exibir "There no attribute!", // já que está posicionado em title // e esta tag não tem atributos. if !oXML:DOMHasAtt() conout( "There is no attribute!" ) else conout( "There is some attribute!" ) endif return
Visão Geral
Import HTML Content
Conteúdo das Ferramentas