Tip, Keep context straight in XSLT

Use the current() function as an anchor for XPath expressions

From the developerWorks archives

Uche Ogbuji

Date archived: December 6, 2016 | First published: February 01, 2003

Developers frequently forget where context changes in XPath. XSLT provides an anchor for the initial context used for XPath expressions -- the current() function. In this tip, Uche Ogbuji warns about common bugs associated with changing context, and explains how to use current(). To follow this tip, you should be familiar with the basics of XPath and XSLT.

This content is no longer being updated or maintained. The full article is provided "as is" in a PDF file. Given the rapid evolution of technology, some steps and illustrations may have changed.



static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=XML
ArticleID=12346
ArticleTitle=Tip: Keep context straight in XSLT
publish-date=02012003