Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XML
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 11th, 2005, 07:31 AM
Authorized User
 
Join Date: Jan 2005
Location: Chennai, , India.
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to JelfMaria
Default How to get a list of specific tag from xml using v

:)

 I have a problem in accessing a specific tag without considering the same tag inside child nodes.

The problem is:
<bib>
<au>
<fnm> Jelfy</fnm>
<snm>Mary</snm>
</au>
<au>
<fnm> Sumitha</fnm>
<snm>Susan</snm>
</au>
<eds>
<au>
<fnm> Joy</fnm>
<snm>Peter</snm>
</au>
<au>
<fnm> Flora</fnm>
<snm>Sania</snm>
</au>

</eds>
</bib>
Here I want only Jelfy Mary and Sumitha Susan,the <au> inside <eds>
I dont want to extract.I used getelementbytagname,select singlenodes etc but it is fetching all the 4 au tags.
I want only the first 2.Can u help me? :(

__________________
Thanks
Jelfy
Reply With Quote
  #2 (permalink)  
Old January 11th, 2005, 07:47 AM
Friend of Wrox
 
Join Date: Jul 2003
Location: , , United Kingdom.
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

You could use XPath...



dom.selectNodes("bib/au")



HTH,

Chris

Reply With Quote
  #3 (permalink)  
Old January 12th, 2005, 12:39 AM
Authorized User
 
Join Date: Jan 2005
Location: Chennai, , India.
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to JelfMaria
Default


 Without using xpath also that selectnodes works but
the exact problem is:
<bibl>
<bib id="1">
<bookref>
<old>
<au>
<fnm> Jelfy</fnm>
<snm>Mary</snm>
</au>
<au>
<fnm> Sumitha</fnm>
<snm>Susan</snm>
</au>
<eds>
<au>
<fnm> Joy</fnm>
<snm>Peter</snm>
</au>
<au>
<fnm> Flora</fnm>
<snm>Sania</snm>
</au>

</eds>
</old>
</bookref>
</bib>
<bib id="2">
<jnlref>
<present>
<au>
<fnm> Joseph</fnm>
<snm>M</snm>
</au>
<au>
<fnm> Chris</fnm>
<snm>N</snm>
</au>
<eds>
<au>
<fnm> Joy</fnm>
<snm>Peter</snm>
</au>
<au>
<fnm> Flora</fnm>
<snm>Sania</snm>
</au>

</eds>
</present>
</jnlref>
</bib>
</bibl>
Here I want to extract only all <au> tags outside <eds></eds>.
I tried xmlDoc.selectNodes("bibl//bib//au")with xpath but its extracting all the au tags.
Can u pls help me with code?




Reply With Quote
  #4 (permalink)  
Old January 13th, 2005, 06:18 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

How about xmlDoc.selectNodes("bibl/bib/*/*/au")
Reply With Quote
  #5 (permalink)  
Old January 13th, 2005, 09:34 AM
Authorized User
 
Join Date: Jan 2005
Location: Chennai, , India.
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to JelfMaria
Default

Thank You Very Much.....
The * concept usage is extremely helpful to me in solving some of my major project issues.Thanxxxxxxxxxxx.

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a list depending on a tag value josephine XSLT 1 October 26th, 2007 05:39 AM
How to fetch text after specific tag text dipsut XSLT 10 May 23rd, 2007 02:57 PM
how to load specific value from dropdown list? method ASP.NET 1.0 and 1.1 Basics 1 June 17th, 2005 08:08 AM
To get a list of specific tag from xml using v JelfMaria VB How-To 0 January 11th, 2005 07:21 AM
XML to (different <tag>) XML mapping Thodoris XML 4 April 27th, 2004 04:02 AM



All times are GMT -4. The time now is 12:51 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.