Hi Santhosh,

Yes,you are right.On an element node,getNodeValue() returns null.
Only for text nodes and attribute nodes,getNodeValue() makes sense.
In the case of PI nodes,it is aliased to getData() method.

Regards,
Pavani 


> Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
> list-help: <mailto:[EMAIL PROTECTED]>
> list-unsubscribe: <mailto:[EMAIL PROTECTED]>
> list-post: <mailto:[EMAIL PROTECTED]>
> Delivered-To: mailing list [EMAIL PROTECTED]
> From: Santhosh Subramani <[EMAIL PROTECTED]>
> To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
> Subject: RE: JSP XML
> Date: Tue, 21 Aug 2001 11:35:17 -0400
> X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N
> 
> Correct me if I'm wrong.
> On an element Node the return of the getNodeValue() is supposed to be null
> right?
> TAI
> 
> 
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, August 21, 2001 3:41 AM
> To: [EMAIL PROTECTED]
> 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]
> 


-- 

Pavani Mukthipudi
Sun Microsystems.


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

Reply via email to