Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

XQueryUtil

 
kamiya sei
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 656
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic