Need to edge out the competition for your dream job? Train for certifications today.
Experts Exchange Solution brought to you by
"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.
Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.
This course will introduce you to C++ 11 and teach you about syntax fundamentals.
1. Select the document node
2. Select the 'root' element
3. Select all 'actor' elements that are direct children of the 'actors' element.
4. Select all 'singer' elements regardless of their positions in the document.
5. Select the 'id' attributes of the 'singer' elements regardless of their positions in the document.
6. Select the textual value of first 'actor' element.
7. Select the last 'actor' element.
8. Select the first and second 'actor' elements using their position.
//actor[position() < 3]
9. Select all 'actor' elements that have an 'id' attribute.
10. Select the 'actor' element with the 'id' attribute value of '3'.
11. Select all 'actor' nodes with the 'id' attribute value lower or equal to '3'.
12. Select all the children of the 'singers' node.
13. Select all the elements in the document.
14. Select all the 'actor' elements AND the 'singer' elements.
15. Select the name of the first element in the document.
16. Select the numeric value of the 'id' attribute of the first 'actor' element.
17. Select the string representation value of the 'id' attribute of the first 'actor' element.
18. Select the length of the first 'actor' element's textual value.
19. Select the local name of the first 'singer' element, i.e. without the namespace.
20. Select the number of 'singer' elements.
21. Select the sum of the 'id' attributes of the 'singer' elements.
Open in new window
<?xml version="1.0" encoding="iso-8859-1"?>
With the XML above "root/child" would only match the "child" node with a value of 'Hello'. "root//child" would match both child nodes ("Hello" and "World")
Hope that makes sense.
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment