Oracle SOA Suite 12c Essentials — Question 40
Given the following XML document, which two XPath expressions return the same result?
<?xml version ="1.0" encoding ="UTF – 8"?>
<bookstore>
<book category="COOKING">
<title lang="en">Everyday Italian Treats</title>
<author>George Smith</author>
<year>2009</year>
<price>30.00</price>
</book>
<book category="WEB">
<title lang="en">Getting Started with XPath</title>
<author>Tammy Lee</author>
<author>SergieLadloff</author>
<year>2011</year>
<price>49.99</price>
</book>
</bookstore>
Answer options
- A. bookstore/book/author
- B. bookstore/book/author/text ()
- C. bookstore/book/author/*
- D. bookstore//author/text ()
- E. //author/@text
- F. //author/*text
Correct answer: B, C
Explanation
The correct answers B and C both target the author elements within the book elements, but B retrieves the text content directly, while C refers to the author elements generically. The other options either don't return text directly or reference incorrect XPath syntax, such as E and F.