xslt-processor 3.3.1 → 3.4.0
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/README.md +7 -2
- package/dom/xml-output-options.d.ts +1 -1
- package/package.json +2 -2
- package/umd/dom/xml-output-options.d.ts +1 -1
- package/umd/xslt/xslt.d.ts +7 -1
- package/umd/xslt-processor.js.map +1 -1
- package/xslt/xslt.d.ts +7 -1
- package/xslt/xslt.js +6 -2
- package/xslt/xslt.js.map +1 -1
package/README.md
CHANGED
|
@@ -17,12 +17,16 @@ _A JavaScript XSLT processor without native library dependencies._
|
|
|
17
17
|
|
|
18
18
|
## How to
|
|
19
19
|
|
|
20
|
-
Install xslt-processor using [npm](https://docs.npmjs.com/about-npm) or [yarn](https://yarnpkg.com):
|
|
20
|
+
Install xslt-processor using [npm](https://docs.npmjs.com/about-npm), [ohpm](https://ohpm.openharmony.cn/#/en/home) or [yarn](https://yarnpkg.com):
|
|
21
21
|
|
|
22
22
|
```sh
|
|
23
23
|
npm install xslt-processor
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
+
```sh
|
|
27
|
+
ohpm install xslt-processor
|
|
28
|
+
```
|
|
29
|
+
|
|
26
30
|
```sh
|
|
27
31
|
yarn add xslt-processor
|
|
28
32
|
```
|
|
@@ -85,7 +89,7 @@ const xslt = new Xslt(options);
|
|
|
85
89
|
- `cData` (`boolean`, default `true`): resolves CDATA elements in the output. Content under CDATA is resolved as text. This overrides `escape` for CDATA content.
|
|
86
90
|
- `escape` (`boolean`, default `true`): replaces symbols like `<`, `>`, `&` and `"` by the corresponding [HTML/XML entities](https://www.tutorialspoint.com/xml/xml_character_entities.htm). Can be overridden by `disable-output-escaping`, that also does the opposite, unescaping `>` and `<` by `<` and `>`, respectively.
|
|
87
91
|
- `selfClosingTags` (`boolean`, default `true`): Self-closes tags that don't have inner elements, if `true`. For instance, `<test></test>` becomes `<test />`.
|
|
88
|
-
- `outputMethod` (`string`, default `xml`): Specifies the default output method. if `<xsl:output>` is declared in your XSLT file, this will be overridden.
|
|
92
|
+
- `outputMethod` (`string`, default `xml`): Specifies the default output method. if `<xsl:output>` is declared in your XSLT file, this will be overridden. Valid values: `xml`, `html`, `text`, `name`, `xhtml`.
|
|
89
93
|
- `parameters` (`array`, default `[]`): external parameters that you want to use.
|
|
90
94
|
- `name`: the parameter name;
|
|
91
95
|
- `namespaceUri` (optional): the namespace;
|
|
@@ -221,3 +225,4 @@ HTML per se is not strict XML. Because of that, starting on version 2.0.0, this
|
|
|
221
225
|
- XSLT Specification: http://www.w3.org/TR/1999/REC-xslt-19991116
|
|
222
226
|
- W3C DOM Level 3 Core Specification: http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/
|
|
223
227
|
- ECMAScript Language Specification: http://www.ecma-international.org/publications/standards/Ecma-262.htm
|
|
228
|
+
- Arkts Language Specification: https://gitee.com/openharmony/arkcompiler_runtime_core/releases/download/ArkTS-spec-1.2.0-alpha-20250307/arktsspecification.pdf
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xslt-processor",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.0",
|
|
4
4
|
"description": "A JavaScript XSLT Processor",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.js",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"rollup-plugin-terser": "^4.0.3",
|
|
69
69
|
"ts-jest": "^29.2.5",
|
|
70
70
|
"ts-node": "^10.9.2",
|
|
71
|
-
"typescript": "^5.
|
|
71
|
+
"typescript": "^5.9.2"
|
|
72
72
|
},
|
|
73
73
|
"dependencies": {
|
|
74
74
|
"he": "^1.2.0"
|
package/umd/xslt/xslt.d.ts
CHANGED
|
@@ -34,7 +34,7 @@ export declare class Xslt {
|
|
|
34
34
|
options: XsltOptions;
|
|
35
35
|
decimalFormatSettings: XsltDecimalFormatSettings;
|
|
36
36
|
outputDocument: XDocument;
|
|
37
|
-
outputMethod: 'xml' | 'html' | 'text' | 'name';
|
|
37
|
+
outputMethod: 'xml' | 'html' | 'text' | 'name' | 'xhtml';
|
|
38
38
|
outputOmitXmlDeclaration: string;
|
|
39
39
|
version: string;
|
|
40
40
|
firstTemplateRan: boolean;
|
|
@@ -265,5 +265,11 @@ export declare class Xslt {
|
|
|
265
265
|
* @param template The template node.
|
|
266
266
|
*/
|
|
267
267
|
protected xsltWithParam(context: ExprContext, template: XNode): Promise<void>;
|
|
268
|
+
/**
|
|
269
|
+
* Test if the given element is an XSLT element, optionally the one with the given name.
|
|
270
|
+
* @param {XNode} element The element.
|
|
271
|
+
* @param {string} opt_wantedName The name for comparison.
|
|
272
|
+
* @returns True, if element is an XSL node. False otherwise.
|
|
273
|
+
*/
|
|
268
274
|
protected isXsltElement(element: XNode, opt_wantedName?: string): boolean;
|
|
269
275
|
}
|