• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Why XPath?

Refer to the Mini Case Study from Chapter 10. If you look at the order of the elements in the XML file and compare that order with the order in the XHTML output in the screen shot, it is clear that you are transforming the XML data and reordering it. You are not outputting the elements in the order they exist in the input document.

To transform the XML elements the way you want, you need a way of identifying particular parts of the original XML file and choosing only the desired parts to change. This is where XPath comes in. XPath allows you to match patterns of elements and thus identify unambiguously the element(s) you want to work on.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint