Visualizzazione dei risultati da 1 a 3 su 3

Discussione: nodi figli

  1. #1

    nodi figli

    E' possibile sapere se un node ha dei figli?
    Come?


    Cla

  2. #2
    Utente di HTML.it L'avatar di Toeke
    Registrato dal
    Aug 2002
    Messaggi
    348
    Spiegati meglio plz.
    Devi farlo tramite un linguaggio di programmazione o attraverso l'xsl?

    Toeke

  3. #3
    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

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.