XPath is a way of pulling out particular data from an XML document. It is used by XSL to determine what should be output in your documents. It is essentially a systematic way of defining an address of each piece of data.
For example, if you have a nested set of tags:
<person>
<age>46</age>
<surname>Adams</surname>
<age>28</age>
<surname>Jones</surname>
</person>
You can pull out just the surnames by the XPATH expression "person/surname". This returns all the surnames inside the person tag, in our example this would return "AdamsJones".
As well as these addresses, XPath lets you use a raft of functions to work with the data returned from your specified address. For example you can use the UpperCase function to change the case of the output. upper-case(person/surname) returns ADAMSJONES.
For the technical author who wants to dabble at this level, XPath combined with XSL enables you to generate datasheets from raw xml data. If your help content is in an XML compliant form (such as XHTML), these technologies also enable you to transform it to a variety of other formats and medium, such as web or pdf.
Leave a Reply