Newbie : XPath query question

K

Kora.Jaki

I have the following xml document -

<bookstore>
<?xml version="1.0" encoding="ISO-8859-1"?>

<bookstore>

<book category="COOKING">
<title lang="en">Everyday Italian</title>
<author>Giada De Laurentiis</author>
<year>2005</year>
<price>30.00</price>
</book>

<book category="CHILDREN">
<title lang="en">Harry Potter</title>
<author>J K. Rowling</author>
<year>2005</year>
<price>29.99</price>
</book>

<book category="WEB">
<title lang="en">XQuery Kick Start</title>
<author>James McGovern</author>
<year>2003</year>
<price>49.99</price>
</book>

<book category="WEB">
<title lang="en">Learning XML</title>
<author>Erik T. Ray</author>
<year>2003</year>
<price>39.95</price>
</book>

</bookstore>

Using XPath could I get a list of values with title and author for
each book ? What I would like returned is several lines of "title,
author" values.

Thanks.
 
J

Joe Kesselman

Using XPath could I get a list of values with title and author for
each book ? What I would like returned is several lines of "title,
author" values.

XPath: Not by itself; it can retrieve the data but assembling it into
lines is outside XPath's scope.

XSLT or XQuery can do this easily. Or XPath plus a bit of user code.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,967
Messages
2,570,148
Members
46,694
Latest member
LetaCadwal

Latest Threads

Top