Expressions in attributes

The syntax of the XPath expression language was carefully crafted to be applicable in a number of circumstances. For example, in some applications of XPath it is useful to be able to add an expression to a URL, and so the syntax needed to be both brief and consistent with the characters allowed in URLs. Similarly, for its use in XSLT, expressions need to be valid attribute values.

Quotation marks often appear in expressions. There must be no conflict between these quotes and the quotes that enclose the attribute value containing the expression. Either single or double quotes can be used, and so when the expression only contains one set of quotes it is a simple matter to avoid using the same quotes as used for the attribute ...

Get XSL companion, The now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.