Two Laptop Bag*
The moose likes XML and Related Technologies and the fly likes XQueryUtil Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XQueryUtil" Watch "XQueryUtil" New topic
Author

XQueryUtil

kamiya sei
Greenhorn

Joined: Dec 12, 2012
Posts: 25
HI all !

I have a file called student.xml

<center name="Softech Aptech">
- <class name="B59B">
- <student>
<name>Tom</name>
<mark>9.5</mark>
<grade>A</grade>
</student>
</class>
- <class name="B560">
- <student>
<name>Mary</name>
<mark>9.5</mark>
<grade>A</grade>
</student>
</class>
</center>



in this file , I want to get 'name' in element student Who have attribute '<class name=B59B>' .So, I use XQueryUtil to call it


Nodes students = XQueryUtil.xquery(doc, "//class/student/name[class[@name='B59B']]");

but it display <name><mark>and <grade> >

can you tell me how to just get '<name>'?


thanks.
g tsuji
Ranch Hand

Joined: Jan 18, 2011
Posts: 499
    
    3
Nodes students = XQueryUtil.xquery(doc, "//class/student/name[class[@name='B59B']]");

but it display <name><mark>and <grade> >

That is unlikely the outcomes of it, so not even sure why you said so.

how to just get '<name>'?

kamiya sei
Greenhorn

Joined: Dec 12, 2012
Posts: 25
g tsuji wrote:
Nodes students = XQueryUtil.xquery(doc, "//class/student/name[class[@name='B59B']]");

but it display <name><mark>and <grade> >

That is unlikely the outcomes of it, so not even sure why you said so.

how to just get '<name>'?




thank you.
that is what I need
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: XQueryUtil
 
Similar Threads
Java Newbie in need of assistance, reading lines from text file and calculating averages.
finding an average
Getting the average to display
Deployment Environment
hello...I need only help....in this question