xslt-processor 1.2.2 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/umd/xpath/expressions/binary-expr.d.ts +1 -1
- package/umd/xpath/expressions/function-call-expr.d.ts +1 -1
- package/umd/xpath/expressions/location-expr.d.ts +1 -1
- package/umd/xpath/expressions/step-expr.d.ts +1 -1
- package/umd/xpath/functions/non-standard.d.ts +1 -1
- package/umd/xpath/functions/standard.d.ts +7 -1
- package/umd/xpath/index.d.ts +1 -1
- package/umd/xpath/node-test-comment.d.ts +1 -1
- package/umd/xpath/node-test-element-or-attribute.d.ts +1 -1
- package/umd/xpath/node-test-name.d.ts +1 -1
- package/umd/xpath/node-test-nc.d.ts +1 -1
- package/umd/xpath/node-test-pi.d.ts +1 -1
- package/umd/xpath/node-test-text.d.ts +1 -1
- package/umd/xpath/xpath.d.ts +1 -1
- package/umd/{xpath → xslt}/expr-context.d.ts +3 -1
- package/umd/xslt/xslt-decimal-format-settings.d.ts +28 -0
- package/umd/xslt/xslt.d.ts +2 -0
- package/umd/xslt-processor.js +2 -2
- package/umd/xslt-processor.js.map +1 -1
- package/xpath/expressions/binary-expr.d.ts +1 -1
- package/xpath/expressions/function-call-expr.d.ts +1 -1
- package/xpath/expressions/function-call-expr.js +1 -0
- package/xpath/expressions/function-call-expr.js.map +1 -1
- package/xpath/expressions/location-expr.d.ts +1 -1
- package/xpath/expressions/step-expr.d.ts +1 -1
- package/xpath/functions/non-standard.d.ts +1 -1
- package/xpath/functions/standard.d.ts +7 -1
- package/xpath/functions/standard.js +93 -2
- package/xpath/functions/standard.js.map +1 -1
- package/xpath/index.d.ts +1 -1
- package/xpath/index.js +1 -1
- package/xpath/index.js.map +1 -1
- package/xpath/node-test-comment.d.ts +1 -1
- package/xpath/node-test-element-or-attribute.d.ts +1 -1
- package/xpath/node-test-name.d.ts +1 -1
- package/xpath/node-test-nc.d.ts +1 -1
- package/xpath/node-test-pi.d.ts +1 -1
- package/xpath/node-test-text.d.ts +1 -1
- package/xpath/xpath.d.ts +1 -1
- package/{xpath → xslt}/expr-context.d.ts +3 -1
- package/{xpath → xslt}/expr-context.js +20 -8
- package/xslt/expr-context.js.map +1 -0
- package/xslt/xslt-decimal-format-settings.d.ts +28 -0
- package/xslt/xslt-decimal-format-settings.js +3 -0
- package/xslt/xslt-decimal-format-settings.js.map +1 -0
- package/xslt/xslt.d.ts +2 -0
- package/xslt/xslt.js +43 -8
- package/xslt/xslt.js.map +1 -1
- package/xpath/expr-context.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ExprContext } from "
|
|
1
|
+
import { ExprContext } from "../../xslt/expr-context";
|
|
2
2
|
import { BooleanValue, NodeSetValue, NumberValue, StringValue } from "../values";
|
|
3
3
|
export declare function boolean(context: ExprContext): BooleanValue;
|
|
4
4
|
export declare function ceiling(context: ExprContext): NumberValue;
|
|
@@ -8,6 +8,12 @@ export declare function count(context: ExprContext): NumberValue;
|
|
|
8
8
|
export declare function current(context: ExprContext): NodeSetValue;
|
|
9
9
|
export declare function endsWith(context: ExprContext): BooleanValue;
|
|
10
10
|
export declare function _false(): BooleanValue;
|
|
11
|
+
/**
|
|
12
|
+
* XPath `format-number` function implementation.
|
|
13
|
+
* @param context The Expression Context.
|
|
14
|
+
* @returns A formatted number as string.
|
|
15
|
+
*/
|
|
16
|
+
export declare function formatNumber(context: ExprContext): StringValue;
|
|
11
17
|
export declare function floor(context: ExprContext): NumberValue;
|
|
12
18
|
export declare function generateId(context: ExprContext): StringValue;
|
|
13
19
|
export declare function id(context: ExprContext): NodeSetValue;
|
package/umd/xpath/index.d.ts
CHANGED
package/umd/xpath/xpath.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ExprContext } from '
|
|
1
|
+
import { ExprContext } from '../xslt/expr-context';
|
|
2
2
|
import { BinaryExpr, FunctionCallExpr, LiteralExpr, LocationExpr, NumberExpr, PathExpr, PredicateExpr, StepExpr, TokenExpr, UnaryMinusExpr, UnionExpr, VariableExpr } from './expressions';
|
|
3
3
|
import { Expression } from './expressions/expression';
|
|
4
4
|
import { NodeTestAny } from './node-test-any';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { XNode } from '../dom';
|
|
2
|
+
import { XsltDecimalFormatSettings } from './xslt-decimal-format-settings';
|
|
2
3
|
/** XPath expression evaluation context. An XPath context consists of a
|
|
3
4
|
* DOM node, a list of DOM nodes that contains this node, a number
|
|
4
5
|
* that represents the position of the single node in the list, and a
|
|
@@ -47,6 +48,7 @@ export declare class ExprContext {
|
|
|
47
48
|
ignoreNonElementNodesForNTA: any;
|
|
48
49
|
parent: ExprContext;
|
|
49
50
|
root: XNode;
|
|
51
|
+
decimalFormatSettings: XsltDecimalFormatSettings;
|
|
50
52
|
inApplyTemplates: boolean;
|
|
51
53
|
baseTemplateMatched: boolean;
|
|
52
54
|
/**
|
|
@@ -70,7 +72,7 @@ export declare class ExprContext {
|
|
|
70
72
|
* @param opt_returnOnFirstMatch TODO
|
|
71
73
|
* @param opt_ignoreNonElementNodesForNTA TODO
|
|
72
74
|
*/
|
|
73
|
-
constructor(nodeList: XNode[], outputNodeList: XNode[], opt_position?: number, opt_outputPosition?: number, opt_outputDepth?: number, opt_parent?: ExprContext, opt_caseInsensitive?: any, opt_ignoreAttributesWithoutValue?: any, opt_returnOnFirstMatch?: any, opt_ignoreNonElementNodesForNTA?: any);
|
|
75
|
+
constructor(nodeList: XNode[], outputNodeList: XNode[], opt_position?: number, opt_outputPosition?: number, opt_outputDepth?: number, opt_decimalFormatSettings?: XsltDecimalFormatSettings, opt_parent?: ExprContext, opt_caseInsensitive?: any, opt_ignoreAttributesWithoutValue?: any, opt_returnOnFirstMatch?: any, opt_ignoreNonElementNodesForNTA?: any);
|
|
74
76
|
/**
|
|
75
77
|
* clone() -- creates a new context with the current context as
|
|
76
78
|
* parent. If passed as argument to clone(), the new context has a
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* According to https://www.w3schools.com/xml/ref_xsl_el_decimal-format.asp:
|
|
3
|
+
*
|
|
4
|
+
* @property {string} name: Optional. Specifies a name for this format.
|
|
5
|
+
* @property {string} decimalSeparator: Optional. Specifies the decimal point character. Default is ".".
|
|
6
|
+
* @property {string} groupingSeparator: Optional. Specifies the thousands separator character. Default is ",".
|
|
7
|
+
* @property {string} infinity: Optional. Specifies the string used to represent infinity. Default is "Infinity".
|
|
8
|
+
* @property {string} minusSign: Optional. Specifies the character to represent negative numbers. Default is "-".
|
|
9
|
+
* @property {string} naN: Optional. Specifies the string used when the value is not a number". Default is "NaN".
|
|
10
|
+
* @property {string} percent: Optional. Specifies the percentage sign character. Default is "%".
|
|
11
|
+
* @property {string} perMille: Optional. Specifies the per thousand sign character. Default is "‰".
|
|
12
|
+
* @property {string} zeroDigit: Optional. Specifies the digit zero character. Default is "0".
|
|
13
|
+
* @property {string} digit: Optional. Specifies the character used to indicate a place where a digit is required. Default is #.
|
|
14
|
+
* @property {string} patternSeparator: Optional. Specifies the character used to separate positive and negative subpatterns in a format pattern. Default is ";".
|
|
15
|
+
*/
|
|
16
|
+
export type XsltDecimalFormatSettings = {
|
|
17
|
+
name?: string;
|
|
18
|
+
decimalSeparator: string;
|
|
19
|
+
groupingSeparator: string;
|
|
20
|
+
infinity: string;
|
|
21
|
+
minusSign: string;
|
|
22
|
+
naN: string;
|
|
23
|
+
percent: string;
|
|
24
|
+
perMille: string;
|
|
25
|
+
zeroDigit: string;
|
|
26
|
+
digit: string;
|
|
27
|
+
patternSeparator: string;
|
|
28
|
+
};
|
package/umd/xslt/xslt.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { XDocument, XNode } from '../dom';
|
|
2
2
|
import { ExprContext, XPath } from '../xpath';
|
|
3
3
|
import { XsltOptions } from './xslt-options';
|
|
4
|
+
import { XsltDecimalFormatSettings } from './xslt-decimal-format-settings';
|
|
4
5
|
/**
|
|
5
6
|
* The main class for XSL-T processing. The implementation is NOT
|
|
6
7
|
* complete; some xsl element are left out.
|
|
@@ -28,6 +29,7 @@ import { XsltOptions } from './xslt-options';
|
|
|
28
29
|
export declare class Xslt {
|
|
29
30
|
xPath: XPath;
|
|
30
31
|
options: XsltOptions;
|
|
32
|
+
decimalFormatSettings: XsltDecimalFormatSettings;
|
|
31
33
|
outputDocument: XDocument;
|
|
32
34
|
outputMethod: string;
|
|
33
35
|
outputOmitXmlDeclaration: string;
|