XPath 1.0 Compatibility Mode
( in XSLT and other environments)
- Some things happen differently in XPath 2.0 and XPath 1.0
(e.g.
string(note) when count(note) >
1)
- What happens with a 1.0 stylesheet in a 2.0 processor, or the
reverse?
- Mostly, things run okay
- When not, mostly you can expect errors (not silent variances)
- “Clever” use of XPath 1.0 can get you into trouble
- Saying xsl:stylesheet version="1.0" asks that a
stylesheet be run in XPath 1.0 compatibility mode by a
2.0 processor
- This irons out almost all discrepancies between
data models but see
http://www.w3.org/TR/2003/WD-xpath20-20031112/#id-backwards-compatibility
- Does not actually restrict you to XPath 1.0
- in a processor that
can handle 2.0!
- if you want to do that — use a 1.0 processor