I want to populate an XML in HTML page and generate xpath when clicked on a xml node/html element. Assume I have below xml.
<bookstore>
<book category="web">
<title lang="en">XQuery Kick Start</title>
<author>Kurt Cagle</author>
<year>2003</year>
<price>49.99</price>
</book>
</bookstore>
Now I want populate this xml in HTML page and when user clicks on <bookstore>
I want to return '/bookstore', click on <book>
should return '/bookstore/book' and click on <title>
should return '/bookstore/book/title'. I want to achieve this using javascript or jquery or angular2. I can achieve this by hard coding the above xml in HTML page but the actual xml is very huge so trying to find some other approach where I can dynamically populate and achieve this requirement.