Hi Lakshmi,

  Thanx for your mail.

  Just few things :
  1. what are all the packages i need to import for this method, i have
xerces.jar in my classpath and another doubt
  2. if i need only elementValue i just have to say :
      private String traverse(Node node)


     return elementValue;
     } and return elementValue right.

  Waiting for your earliest reply,

  Thanx Once again.

  With Regards,

b.karthikeyan.
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, August 21, 2001 1:11 PM
Subject: Re: JSP XML


>
>
> Hi Karthikeyan,
>
> This is with regard to your query for getting the content of the tag/node
> "CurrentPage". Using DOM API Xerces allows navigation along the nodes of
an
> XML document. You traverse to the required - "CurrentPage" and get the
> contents using the method getNodeValue() of the Node class.
>
> Eg:-
>
>      private void traverse (Node node)
>      {
>           int type = node.getNodeType();
>           if (type == Node.ELEMENT_NODE)
>           {
>                elementName = node.getNodeName();
>                elementValue = node.getNodeValue();
>           }
>           NodeList children = node.getChildNodes();
>           if (children != null)
>           {
>                for (int i=0; i< children.getLength(); i++)
>                {
>                     traverse(children.item(i));
>                }
>           }
>      }//End of traverse
>
> If any clarification is required, you are always welcome !
>
> Regards,
>
> R.Lakshmi
>
>
>
>
>
>
>
>                     "karthikeyan"
>                     <karthikeyan@aspi        To:
<[EMAIL PROTECTED]>
>                     resys.com>               cc:

>                                              Subject:     JSP XML
>                     20/08/2001 07:41
>                     PM
>                     Please respond to
>                     xerces-j-dev
>
>
>
>
>
> Hi Guys,
>
>   I need an help.  I have this XML Schema.
>
>     <ResultHeader>
>       <MemberID>12345</MemberID>
>       <SearchType>quick</SearchType>
>       <Result>success</Result>
>       <CurrentPage>5</CurrentPage>
>       <TotalPages>10</TotalPages>
>     </ResultHeader>
>
>   I just want to read CurrentPage and TotalPages element content and
> display
> in my JSP page.  Before that i need to store this data in a String.  For
> example currentPage = <CurrentPage> element content which here is 5,
> likewise.
>
>   Is there any method in Xerces where you just say :
> getElementContent("<CurrentPage>") and you will get 5 as a String.
>
>   Waiting for your earliest reply.
>
>   With Regards,
>
> b.karthikeyan.
>
>
>
> ---------------------------------------------------------------------
> 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]



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

Reply via email to