Skip to content

Commit

Permalink
Bringing the XSLT version to the context, to be used to implement `up…
Browse files Browse the repository at this point in the history
…per-case` and `lower-case` functions. (#33)
  • Loading branch information
leonelsanchesdasilva committed Nov 4, 2023
1 parent 08ed019 commit effe57f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/xpath/expr-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import { TOK_NUMBER } from './tokens';
import { XNode } from '../dom';
import { XsltDecimalFormatSettings } from '../xslt/xslt-decimal-format-settings';

/** XPath expression evaluation context. An XPath context consists of a
/**
* XPath expression evaluation context. An XPath context consists of a
* DOM node, a list of DOM nodes that contains this node, a number
* that represents the position of the single node in the list, and a
* current set of variable bindings. (See XPath spec.)
Expand Down Expand Up @@ -46,6 +47,7 @@ export class ExprContext {
outputPosition: number;
outputNodeList: XNode[];
outputDepth: number;
xsltVersion: '1.0' | '2.0' | '3.0';

variables: { [name: string]: any };
knownNamespaces: { [alias: string]: string };
Expand Down
1 change: 1 addition & 0 deletions src/xslt/xslt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,7 @@ export class Xslt {
`XSLT version not defined or invalid. Actual resolved version: ${this.version || '(none)'}.`
);
}
context.xsltVersion = this.version as any;
break;
default:
if (stylesheetAttribute.prefix === 'xmlns') {
Expand Down

0 comments on commit effe57f

Please sign in to comment.