Skip to content

Commit effe57f

Browse files
Bringing the XSLT version to the context, to be used to implement upper-case and lower-case functions. (#33)
1 parent 08ed019 commit effe57f

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/xpath/expr-context.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ import { TOK_NUMBER } from './tokens';
77
import { XNode } from '../dom';
88
import { XsltDecimalFormatSettings } from '../xslt/xslt-decimal-format-settings';
99

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

5052
variables: { [name: string]: any };
5153
knownNamespaces: { [alias: string]: string };

src/xslt/xslt.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,7 @@ export class Xslt {
606606
`XSLT version not defined or invalid. Actual resolved version: ${this.version || '(none)'}.`
607607
);
608608
}
609+
context.xsltVersion = this.version as any;
609610
break;
610611
default:
611612
if (stylesheetAttribute.prefix === 'xmlns') {

0 commit comments

Comments
 (0)