|
|
 |
BOOK: Beginning XML 3rd Edition  | This is the forum to discuss the Wrox book Beginning XML, 3rd Edition by David Hunter, Andrew Watt, Jeff Rafter, Jon Duckett, Danny Ayers, Nicholas Chase, Joe Fawcett, Tom Gaven, Bill Patterson; ISBN: 9780764570773 |
|
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: Beginning XML 3rd Edition section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.
|
 |

September 25th, 2008, 06:50 PM
|
|
Registered User
|
|
Join Date: Sep 2003
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
select another attribute value
If I have a XML like so
<Book Title="Othello" Author="William Shakespeare" />
How do I select the value of another attribute if I know the value of the 1st?
i.e. /Book[@Title='Othello'] but I want the value of Author
any ideas?
Thanks
|

September 26th, 2008, 03:28 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 2,922
Thanks: 0
Thanked 13 Times in 12 Posts
|
|
Non book-specific queries are better posted to the general XML forum. In your case the XPath is:
Code:
/Book[@Title='Othello']/@Author
It's the same as : but with the: predicate.
--
Joe ( Microsoft MVP - XML)
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |