Comparing XSLT and XQuery

  • Both languages use XPath or a derivation of XPath
  • Both languages provide similar constructs for element construction, flow control, iteration, variable binding, conditional expressions, etc.
  • XQuery does not have built-in support for template rules; it does, however, allow recursive function definitions
  • XQuery allows user-defined functions; XSLT currently does not (although named templates are often used to produce the same desired effect)
  • Both languages are slated to have support for XML Schema datatypes
  • XQuery, since it is based (or will be based) on the XML Query Algebra, treats everything as an expression; this is not the case in XSLT
  • XQuery's path expression language does not have built-in support for the non-abbreviated XPath axes (ancestor, preceding-sibling, etc.); it does, however, allow access to parent nodes
  • XQuery's constructs approximate those of a subset of XSLT one might call "down-reference pull"
<<<  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15    >>>