You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Serge Emmanuel Pagop <Se...@informatik.stud.uni-erlangen.de> on 2001/06/24 19:21:49 UTC

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: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: Print Problem with the (tree interface)

Posted by Iban Torres <ib...@yahoo.es>.
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" <Se...@informatik.stud.uni-erlangen.de>
To: <xe...@xml.apache.org>
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: xerces-j-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-user-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org