xpath                
            Controlla se il testo di un nodo è vuoto
        
        
            
    Ricerca…
Sintassi
- booleana (path_to_node / text ())
 - string (path_to_node)! = ''
 
Osservazioni
La funzione booleana ha altri usi
- Controlla se un nodo è presente
 - Controlla se l'argomento non è un numero (NaN) o è 0
 
La funzione stringa viene utilizzata per restituire il valore stringa di un nodo.
Controlla se Deborah ha un master e il suo valore di testo non è vuoto
XML
<Deborah>
    <address>Dark world</address>
    <master>Babadi</master>
    <ID>#0</ID>
    <colour>red</colour>
    <side>evil</side>
</Deborah>
 XPATH
boolean(/Deborah/master/text())
 O
string(/Deborah/master) != ''
 PRODUZIONE
true
        Controlla se Dobby ha un master e il suo valore di testo non è vuoto
XML
<Dobby>
    <address>Hogwartz</address>
    <master></master>
    <colour>wheatish</colour>
    <side>all good</side>
</Dobby>
 XPATH
boolean(/Dobby/master/text())
 O
string(/Dobby/master) != ''
 PRODUZIONE
false
    
    
    
    
    Modified text is an extract of the original Stack Overflow Documentation
        Autorizzato sotto CC BY-SA 3.0
        Non affiliato con Stack Overflow