E' possibile sapere se un node ha dei figli?
Come?
Cla
E' possibile sapere se un node ha dei figli?
Come?
Cla
Spiegati meglio plz.
Devi farlo tramite un linguaggio di programmazione o attraverso l'xsl?
Toeke
uso questo funzione per visualizzare xml:
function DisplayNodes (Node, IndentLevel){
var i;
var b;
var c;
var DisplayString =" ";
if (Node.attributes != null)
if (Node.attributes.length == 2) b="font-weight:bold;padding:0 2px 0 2px;";
if (Node.attributes.length > 0){
DisplayString += "<td style='text-align:left;width:130;font-size:12;" + b + "'>" + Node.attributes(0).nodeValue + "</td>";
DisplayString += "<td style='text-align:left;width:300;" + b + "'>" + Node.attributes(1).nodeValue + "</td>";
if (Node.attributes.length > 2){
if (Node.attributes(4).nodeValue == 'S') c="red"
DisplayString += "<td style='text-align:right;width:75px;'>" + Node.attributes(2).nodeValue + "</td>";
DisplayString += "<td style='text-align:right;width:75px;color:" + c + ";'>" + Node.attributes(3).nodeValue + "</td>";
}
}
for (i=0; i < Node.childNodes.length; ++i){
DisplayString += "<tr>";
DisplayString += DisplayNodes (Node.childNodes(i), IndentLevel + 1);
DisplayString += "</tr>";
}
return DisplayString;
ho bisogno di sapere se il nodo che sto scrivendo e' un nodo padre o figlio per far si che i nodi patre vengano scritti in un modo mentre i figli in un altro
cla