Hi Serge

  I have just tested your code. I made some changes because there were some
text mistakes...probably due to the mail server.

This is the code I tested.....and it worked perfectly. Are you sure that
your nodes have visible names?.I can not see the problem.

     public void traverse(Node node)
       {

              int type = node.getNodeType();
              if(type == Node.ELEMENT_NODE)
              {

               System.out.println(node.getNodeName());
               NodeList children = node.getChildNodes();
               if(children != null)
                   {
                        for(int i = 0; i < children.getLength(); i++)
                        {
                             traverse(children.item(i));
                        }
                   }
              }
     }


 ----- Original Message -----
From: "Serge Emmanuel Pagop" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, June 24, 2001 6:21 PM
Subject: Print Problem with the (tree interface)


> Hi, users
> I have a problem with this method, also when I compile the Program,
> there is no matter and  when I run it there is also no matter, but it
> not  Print out Element Names.
> I do not why? I thinks, this is correct
>
>   public void traverse(Node node){
>
>     nit type = node.getNodeType();
>     if(type == Node.ELEMENT_NODE){
>
>       System.out.println(node.getNodeName());
>       novelist children = node.getChildNodes();
>       if(children != null){
>         forwent i = 0; i < children.getLength(); i++){
>           traverse(children.item(i));
>         }
>       }
>     }
>   }
>
> if somebody can help me? I will be very happy
> Thanes .....
>
> Serge
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to