xslt-processor 4.7.0 → 4.8.1

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/index.d.mts CHANGED
@@ -278,6 +278,14 @@ declare class ExprContext {
278
278
  * Contains the key value of the current group being processed.
279
279
  */
280
280
  currentGroupingKey?: any;
281
+ /**
282
+ * User-defined XSLT functions from xsl:function declarations.
283
+ * Maps QName (namespace:localname) to function definition info.
284
+ */
285
+ userDefinedFunctions?: Map<string, {
286
+ functionDef: XNode;
287
+ executor: (context: ExprContext, functionDef: XNode, args: any[]) => any;
288
+ }>;
281
289
  /**
282
290
  * Constructor -- gets the node, its position, the node set it
283
291
  * belongs to, and a parent context as arguments. The parent context
@@ -790,6 +798,16 @@ declare class Xslt {
790
798
  * Keys are attribute set names, values are arrays of xsl:attribute nodes.
791
799
  */
792
800
  attributeSets: Map<string, XNode[]>;
801
+ /**
802
+ * Map of user-defined functions from xsl:function declarations.
803
+ * Keys are QNames (namespace:localname), values are the function definition nodes.
804
+ */
805
+ userDefinedFunctions: Map<string, XNode>;
806
+ /**
807
+ * Result documents created by xsl:result-document.
808
+ * Keys are the href URIs, values are the serialized output strings.
809
+ */
810
+ resultDocuments: Map<string, string>;
793
811
  /**
794
812
  * Stack of stylesheet metadata for tracking import hierarchy.
795
813
  * Used by apply-imports to find templates from imported stylesheets.
@@ -815,11 +833,21 @@ declare class Xslt {
815
833
  * Manages loaded packages and their components.
816
834
  */
817
835
  private packageRegistry;
836
+ /**
837
+ * Callback for loading external packages.
838
+ * Called when a package is not found in the registry.
839
+ */
840
+ private packageLoader?;
818
841
  /**
819
842
  * Current package being processed (for XSLT 3.0).
820
843
  * null if processing a non-package stylesheet.
821
844
  */
822
845
  private currentPackage;
846
+ /**
847
+ * Current override context (for XSLT 3.0 xsl:original).
848
+ * Tracks the original component when executing an override.
849
+ */
850
+ private currentOverrideContext;
823
851
  /**
824
852
  * Accumulator registry for XSLT 3.0 accumulators.
825
853
  * Stores accumulator definitions and current state during processing.
@@ -1082,6 +1110,15 @@ declare class Xslt {
1082
1110
  * @param output The output node.
1083
1111
  */
1084
1112
  protected xsltPackage(context: ExprContext, template: XNode, output?: XNode): Promise<void>;
1113
+ /**
1114
+ * Loads and registers an external package.
1115
+ * Creates a temporary context and processes the package document.
1116
+ *
1117
+ * @param name The package name/URI.
1118
+ * @param packageDoc The parsed package document.
1119
+ * @param version Optional semantic version string.
1120
+ */
1121
+ protected loadAndRegisterPackage(name: string, packageDoc: XNode, version?: string): Promise<void>;
1085
1122
  /**
1086
1123
  * Implements `<xsl:use-package>` (XSLT 3.0 Section 3.7).
1087
1124
  * Imports another package and makes its public components available.
@@ -1097,6 +1134,14 @@ declare class Xslt {
1097
1134
  * @param template The xsl:expose element.
1098
1135
  */
1099
1136
  protected xsltExpose(context: ExprContext, template: XNode): void;
1137
+ /**
1138
+ * Find a component definition in the package root.
1139
+ * @param packageRoot The package root element
1140
+ * @param type The component type to find
1141
+ * @param name The component name (null for all matching type)
1142
+ * @returns Component information or null if not found
1143
+ */
1144
+ private findComponentInPackageRoot;
1100
1145
  /**
1101
1146
  * Implements `<xsl:accept>` (XSLT 3.0 Section 3.9).
1102
1147
  * Accepts and optionally overrides a component from a used package.
@@ -1104,6 +1149,55 @@ declare class Xslt {
1104
1149
  * @param template The xsl:accept element.
1105
1150
  */
1106
1151
  protected xsltAccept(context: ExprContext, template: XNode): void;
1152
+ /**
1153
+ * Implements <xsl:override> (XSLT 3.0 Section 3.7.2).
1154
+ * Overrides components from a used package.
1155
+ */
1156
+ protected xsltOverride(context: ExprContext, template: XNode, output?: XNode): Promise<void>;
1157
+ /**
1158
+ * Find components in a package matching the given criteria.
1159
+ * Used by xsl:accept to locate components from used packages.
1160
+ *
1161
+ * @param pkg The package to search in
1162
+ * @param componentType The type of component to find
1163
+ * @param namePatterns Array of name patterns ('*' for all, or specific names)
1164
+ * @returns Array of matching components
1165
+ */
1166
+ private findComponentsInPackage;
1167
+ /**
1168
+ * Get the name to use when matching components.
1169
+ * For named components (functions, variables, attribute-sets), returns the name.
1170
+ * For templates, returns the name if present, otherwise returns null (match-based templates).
1171
+ *
1172
+ * @param component The component to get the name from
1173
+ * @returns The component name for matching, or null if unnamed
1174
+ */
1175
+ private getComponentNameForMatching;
1176
+ /**
1177
+ * Implements <xsl:original> (XSLT 3.0 Section 3.7.2).
1178
+ * Calls the original component from within an override.
1179
+ */
1180
+ protected xsltOriginal(context: ExprContext, template: XNode, output?: XNode): Promise<void>;
1181
+ /**
1182
+ * Implements `<xsl:mode>` (XSLT 3.0 Section 3.5).
1183
+ * Declares a mode with visibility and other properties.
1184
+ * Only valid within an xsl:package.
1185
+ */
1186
+ protected xsltMode(context: ExprContext, template: XNode): void;
1187
+ /**
1188
+ * Get the effective component, checking for overrides first.
1189
+ * If the component has been overridden in the current package, returns the override.
1190
+ * Otherwise, returns the original component.
1191
+ * @param component The original component
1192
+ * @returns The effective component (override or original)
1193
+ */
1194
+ private getEffectiveComponent;
1195
+ /**
1196
+ * Collect templates from accepted components in used packages.
1197
+ * @param mode The mode to match (null for default mode)
1198
+ * @returns Array of template priority interfaces
1199
+ */
1200
+ private collectAcceptedTemplates;
1107
1201
  /**
1108
1202
  * Implements `<xsl:stream>` (XSLT 3.0 Section 16).
1109
1203
  * Enables streaming processing of large documents.
@@ -1343,6 +1437,100 @@ declare class Xslt {
1343
1437
  * Sets up the context with the current text and regex groups.
1344
1438
  */
1345
1439
  private processAnalyzeStringContent;
1440
+ /**
1441
+ * Implements `xsl:function` (XSLT 2.0).
1442
+ *
1443
+ * Declares a stylesheet function that can be called from XPath expressions.
1444
+ * Functions are collected during stylesheet initialization and made available
1445
+ * to the XPath evaluator.
1446
+ *
1447
+ * @param context The expression context.
1448
+ * @param template The xsl:function element.
1449
+ */
1450
+ protected xsltFunction(context: ExprContext, template: XNode): void;
1451
+ /**
1452
+ * Coerce a NodeValue to a specific type based on the 'as' attribute.
1453
+ *
1454
+ * @param value The value to coerce.
1455
+ * @param type The target type (e.g., "xs:integer", "xs:string", "xs:boolean").
1456
+ * @returns The coerced value.
1457
+ */
1458
+ protected coerceToType(value: NodeValue, type: string): NodeValue;
1459
+ /**
1460
+ * Execute a user-defined xsl:function.
1461
+ * Called when a function from userDefinedFunctions is invoked from XPath.
1462
+ *
1463
+ * @param context The expression context.
1464
+ * @param functionDef The xsl:function node.
1465
+ * @param args The evaluated arguments passed to the function.
1466
+ * @returns The result of the function execution.
1467
+ */
1468
+ protected executeUserDefinedFunction(context: ExprContext, functionDef: XNode, args: any[]): Promise<any>;
1469
+ /**
1470
+ * Synchronously execute a user-defined xsl:function.
1471
+ * This is used when functions are called from XPath expressions.
1472
+ * Limited to functions that don't require async operations in their body.
1473
+ *
1474
+ * @param context The expression context.
1475
+ * @param functionDef The xsl:function node.
1476
+ * @param args The evaluated arguments passed to the function.
1477
+ * @returns The result of the function execution.
1478
+ */
1479
+ executeUserDefinedFunctionSync(context: ExprContext, functionDef: XNode, args: any[]): any;
1480
+ /**
1481
+ * Implements `xsl:result-document` (XSLT 2.0).
1482
+ *
1483
+ * Creates a secondary output document. The output is stored in the
1484
+ * resultDocuments map, accessible via getResultDocuments().
1485
+ *
1486
+ * @param context The expression context.
1487
+ * @param template The xsl:result-document element.
1488
+ */
1489
+ protected xsltResultDocument(context: ExprContext, template: XNode): Promise<void>;
1490
+ /**
1491
+ * Get all result documents created by xsl:result-document.
1492
+ * @returns A map of href URIs to serialized output strings.
1493
+ */
1494
+ getResultDocuments(): Map<string, string>;
1495
+ /**
1496
+ * Sets the package loader callback.
1497
+ * The callback is called when a package is referenced via xsl:use-package
1498
+ * but is not found in the registry.
1499
+ *
1500
+ * @param loader A function that loads package documents by URI and optional version.
1501
+ * Returns the parsed package document, or null if not found.
1502
+ */
1503
+ setPackageLoader(loader: (uri: string, version?: string) => Promise<XNode | null>): void;
1504
+ /**
1505
+ * Pre-registers a package for use in transformations.
1506
+ * The package is parsed and stored in the internal registry.
1507
+ *
1508
+ * @param name The package name/URI.
1509
+ * @param packageDoc The parsed package document.
1510
+ * @param version Optional semantic version string.
1511
+ */
1512
+ registerPackage(name: string, packageDoc: XNode, version?: string): Promise<void>;
1513
+ /**
1514
+ * Implements `xsl:perform-sort` (XSLT 2.0).
1515
+ *
1516
+ * Sorts a sequence of items without iteration. The sorted sequence
1517
+ * is available via xsl:sequence or other sequence-consuming instructions.
1518
+ *
1519
+ * @param context The expression context.
1520
+ * @param template The xsl:perform-sort element.
1521
+ * @param output The output node.
1522
+ */
1523
+ protected xsltPerformSort(context: ExprContext, template: XNode, output?: XNode): Promise<void>;
1524
+ /**
1525
+ * Implements `xsl:namespace` (XSLT 2.0).
1526
+ *
1527
+ * Creates a namespace node in the result tree.
1528
+ *
1529
+ * @param context The expression context.
1530
+ * @param template The xsl:namespace element.
1531
+ * @param output The output node.
1532
+ */
1533
+ protected xsltNamespace(context: ExprContext, template: XNode, output?: XNode): Promise<void>;
1346
1534
  /**
1347
1535
  * Evaluates a variable or parameter and set it in the current input
1348
1536
  * context. Implements `xsl:variable`, `xsl:param`, and `xsl:with-param`.
@@ -1355,6 +1543,12 @@ declare class Xslt {
1355
1543
  * value. `xsl:variable` and `xsl:with-param` override; `xsl:param` doesn't.
1356
1544
  */
1357
1545
  protected xsltVariable(context: ExprContext, template: XNode, override: boolean): Promise<void>;
1546
+ /**
1547
+ * Register accepted variables from used packages into the context.
1548
+ * Called after processing package use-package declarations.
1549
+ * @param context The expression context.
1550
+ */
1551
+ private registerAcceptedVariables;
1358
1552
  /**
1359
1553
  * Traverses the template node tree. Calls the main processing
1360
1554
  * function with the current input context for every child node of the
@@ -1454,6 +1648,28 @@ declare class Xslt {
1454
1648
  * @param stylesheetElement The stylesheet or transform element.
1455
1649
  */
1456
1650
  private collectAttributeSets;
1651
+ /**
1652
+ * Collect all user-defined function definitions from the stylesheet.
1653
+ * Called at stylesheet initialization time.
1654
+ * @param stylesheetElement The stylesheet or transform element.
1655
+ * @param context The expression context.
1656
+ */
1657
+ private collectUserDefinedFunctions;
1658
+ /**
1659
+ * Register user-defined functions in the expression context.
1660
+ * This makes them available to XPath expressions.
1661
+ * @param context The expression context.
1662
+ */
1663
+ private registerUserDefinedFunctionsInContext;
1664
+ /**
1665
+ * Check if there are any accepted functions in used packages.
1666
+ */
1667
+ private hasAcceptedFunctions;
1668
+ /**
1669
+ * Register accepted functions from used packages.
1670
+ * @param functionsMap The map to register functions into.
1671
+ */
1672
+ private registerAcceptedFunctions;
1457
1673
  /**
1458
1674
  * Apply one or more attribute sets to an element.
1459
1675
  * Parses space-separated attribute set names and applies them.
package/index.d.ts CHANGED
@@ -278,6 +278,14 @@ declare class ExprContext {
278
278
  * Contains the key value of the current group being processed.
279
279
  */
280
280
  currentGroupingKey?: any;
281
+ /**
282
+ * User-defined XSLT functions from xsl:function declarations.
283
+ * Maps QName (namespace:localname) to function definition info.
284
+ */
285
+ userDefinedFunctions?: Map<string, {
286
+ functionDef: XNode;
287
+ executor: (context: ExprContext, functionDef: XNode, args: any[]) => any;
288
+ }>;
281
289
  /**
282
290
  * Constructor -- gets the node, its position, the node set it
283
291
  * belongs to, and a parent context as arguments. The parent context
@@ -790,6 +798,16 @@ declare class Xslt {
790
798
  * Keys are attribute set names, values are arrays of xsl:attribute nodes.
791
799
  */
792
800
  attributeSets: Map<string, XNode[]>;
801
+ /**
802
+ * Map of user-defined functions from xsl:function declarations.
803
+ * Keys are QNames (namespace:localname), values are the function definition nodes.
804
+ */
805
+ userDefinedFunctions: Map<string, XNode>;
806
+ /**
807
+ * Result documents created by xsl:result-document.
808
+ * Keys are the href URIs, values are the serialized output strings.
809
+ */
810
+ resultDocuments: Map<string, string>;
793
811
  /**
794
812
  * Stack of stylesheet metadata for tracking import hierarchy.
795
813
  * Used by apply-imports to find templates from imported stylesheets.
@@ -815,11 +833,21 @@ declare class Xslt {
815
833
  * Manages loaded packages and their components.
816
834
  */
817
835
  private packageRegistry;
836
+ /**
837
+ * Callback for loading external packages.
838
+ * Called when a package is not found in the registry.
839
+ */
840
+ private packageLoader?;
818
841
  /**
819
842
  * Current package being processed (for XSLT 3.0).
820
843
  * null if processing a non-package stylesheet.
821
844
  */
822
845
  private currentPackage;
846
+ /**
847
+ * Current override context (for XSLT 3.0 xsl:original).
848
+ * Tracks the original component when executing an override.
849
+ */
850
+ private currentOverrideContext;
823
851
  /**
824
852
  * Accumulator registry for XSLT 3.0 accumulators.
825
853
  * Stores accumulator definitions and current state during processing.
@@ -1082,6 +1110,15 @@ declare class Xslt {
1082
1110
  * @param output The output node.
1083
1111
  */
1084
1112
  protected xsltPackage(context: ExprContext, template: XNode, output?: XNode): Promise<void>;
1113
+ /**
1114
+ * Loads and registers an external package.
1115
+ * Creates a temporary context and processes the package document.
1116
+ *
1117
+ * @param name The package name/URI.
1118
+ * @param packageDoc The parsed package document.
1119
+ * @param version Optional semantic version string.
1120
+ */
1121
+ protected loadAndRegisterPackage(name: string, packageDoc: XNode, version?: string): Promise<void>;
1085
1122
  /**
1086
1123
  * Implements `<xsl:use-package>` (XSLT 3.0 Section 3.7).
1087
1124
  * Imports another package and makes its public components available.
@@ -1097,6 +1134,14 @@ declare class Xslt {
1097
1134
  * @param template The xsl:expose element.
1098
1135
  */
1099
1136
  protected xsltExpose(context: ExprContext, template: XNode): void;
1137
+ /**
1138
+ * Find a component definition in the package root.
1139
+ * @param packageRoot The package root element
1140
+ * @param type The component type to find
1141
+ * @param name The component name (null for all matching type)
1142
+ * @returns Component information or null if not found
1143
+ */
1144
+ private findComponentInPackageRoot;
1100
1145
  /**
1101
1146
  * Implements `<xsl:accept>` (XSLT 3.0 Section 3.9).
1102
1147
  * Accepts and optionally overrides a component from a used package.
@@ -1104,6 +1149,55 @@ declare class Xslt {
1104
1149
  * @param template The xsl:accept element.
1105
1150
  */
1106
1151
  protected xsltAccept(context: ExprContext, template: XNode): void;
1152
+ /**
1153
+ * Implements <xsl:override> (XSLT 3.0 Section 3.7.2).
1154
+ * Overrides components from a used package.
1155
+ */
1156
+ protected xsltOverride(context: ExprContext, template: XNode, output?: XNode): Promise<void>;
1157
+ /**
1158
+ * Find components in a package matching the given criteria.
1159
+ * Used by xsl:accept to locate components from used packages.
1160
+ *
1161
+ * @param pkg The package to search in
1162
+ * @param componentType The type of component to find
1163
+ * @param namePatterns Array of name patterns ('*' for all, or specific names)
1164
+ * @returns Array of matching components
1165
+ */
1166
+ private findComponentsInPackage;
1167
+ /**
1168
+ * Get the name to use when matching components.
1169
+ * For named components (functions, variables, attribute-sets), returns the name.
1170
+ * For templates, returns the name if present, otherwise returns null (match-based templates).
1171
+ *
1172
+ * @param component The component to get the name from
1173
+ * @returns The component name for matching, or null if unnamed
1174
+ */
1175
+ private getComponentNameForMatching;
1176
+ /**
1177
+ * Implements <xsl:original> (XSLT 3.0 Section 3.7.2).
1178
+ * Calls the original component from within an override.
1179
+ */
1180
+ protected xsltOriginal(context: ExprContext, template: XNode, output?: XNode): Promise<void>;
1181
+ /**
1182
+ * Implements `<xsl:mode>` (XSLT 3.0 Section 3.5).
1183
+ * Declares a mode with visibility and other properties.
1184
+ * Only valid within an xsl:package.
1185
+ */
1186
+ protected xsltMode(context: ExprContext, template: XNode): void;
1187
+ /**
1188
+ * Get the effective component, checking for overrides first.
1189
+ * If the component has been overridden in the current package, returns the override.
1190
+ * Otherwise, returns the original component.
1191
+ * @param component The original component
1192
+ * @returns The effective component (override or original)
1193
+ */
1194
+ private getEffectiveComponent;
1195
+ /**
1196
+ * Collect templates from accepted components in used packages.
1197
+ * @param mode The mode to match (null for default mode)
1198
+ * @returns Array of template priority interfaces
1199
+ */
1200
+ private collectAcceptedTemplates;
1107
1201
  /**
1108
1202
  * Implements `<xsl:stream>` (XSLT 3.0 Section 16).
1109
1203
  * Enables streaming processing of large documents.
@@ -1343,6 +1437,100 @@ declare class Xslt {
1343
1437
  * Sets up the context with the current text and regex groups.
1344
1438
  */
1345
1439
  private processAnalyzeStringContent;
1440
+ /**
1441
+ * Implements `xsl:function` (XSLT 2.0).
1442
+ *
1443
+ * Declares a stylesheet function that can be called from XPath expressions.
1444
+ * Functions are collected during stylesheet initialization and made available
1445
+ * to the XPath evaluator.
1446
+ *
1447
+ * @param context The expression context.
1448
+ * @param template The xsl:function element.
1449
+ */
1450
+ protected xsltFunction(context: ExprContext, template: XNode): void;
1451
+ /**
1452
+ * Coerce a NodeValue to a specific type based on the 'as' attribute.
1453
+ *
1454
+ * @param value The value to coerce.
1455
+ * @param type The target type (e.g., "xs:integer", "xs:string", "xs:boolean").
1456
+ * @returns The coerced value.
1457
+ */
1458
+ protected coerceToType(value: NodeValue, type: string): NodeValue;
1459
+ /**
1460
+ * Execute a user-defined xsl:function.
1461
+ * Called when a function from userDefinedFunctions is invoked from XPath.
1462
+ *
1463
+ * @param context The expression context.
1464
+ * @param functionDef The xsl:function node.
1465
+ * @param args The evaluated arguments passed to the function.
1466
+ * @returns The result of the function execution.
1467
+ */
1468
+ protected executeUserDefinedFunction(context: ExprContext, functionDef: XNode, args: any[]): Promise<any>;
1469
+ /**
1470
+ * Synchronously execute a user-defined xsl:function.
1471
+ * This is used when functions are called from XPath expressions.
1472
+ * Limited to functions that don't require async operations in their body.
1473
+ *
1474
+ * @param context The expression context.
1475
+ * @param functionDef The xsl:function node.
1476
+ * @param args The evaluated arguments passed to the function.
1477
+ * @returns The result of the function execution.
1478
+ */
1479
+ executeUserDefinedFunctionSync(context: ExprContext, functionDef: XNode, args: any[]): any;
1480
+ /**
1481
+ * Implements `xsl:result-document` (XSLT 2.0).
1482
+ *
1483
+ * Creates a secondary output document. The output is stored in the
1484
+ * resultDocuments map, accessible via getResultDocuments().
1485
+ *
1486
+ * @param context The expression context.
1487
+ * @param template The xsl:result-document element.
1488
+ */
1489
+ protected xsltResultDocument(context: ExprContext, template: XNode): Promise<void>;
1490
+ /**
1491
+ * Get all result documents created by xsl:result-document.
1492
+ * @returns A map of href URIs to serialized output strings.
1493
+ */
1494
+ getResultDocuments(): Map<string, string>;
1495
+ /**
1496
+ * Sets the package loader callback.
1497
+ * The callback is called when a package is referenced via xsl:use-package
1498
+ * but is not found in the registry.
1499
+ *
1500
+ * @param loader A function that loads package documents by URI and optional version.
1501
+ * Returns the parsed package document, or null if not found.
1502
+ */
1503
+ setPackageLoader(loader: (uri: string, version?: string) => Promise<XNode | null>): void;
1504
+ /**
1505
+ * Pre-registers a package for use in transformations.
1506
+ * The package is parsed and stored in the internal registry.
1507
+ *
1508
+ * @param name The package name/URI.
1509
+ * @param packageDoc The parsed package document.
1510
+ * @param version Optional semantic version string.
1511
+ */
1512
+ registerPackage(name: string, packageDoc: XNode, version?: string): Promise<void>;
1513
+ /**
1514
+ * Implements `xsl:perform-sort` (XSLT 2.0).
1515
+ *
1516
+ * Sorts a sequence of items without iteration. The sorted sequence
1517
+ * is available via xsl:sequence or other sequence-consuming instructions.
1518
+ *
1519
+ * @param context The expression context.
1520
+ * @param template The xsl:perform-sort element.
1521
+ * @param output The output node.
1522
+ */
1523
+ protected xsltPerformSort(context: ExprContext, template: XNode, output?: XNode): Promise<void>;
1524
+ /**
1525
+ * Implements `xsl:namespace` (XSLT 2.0).
1526
+ *
1527
+ * Creates a namespace node in the result tree.
1528
+ *
1529
+ * @param context The expression context.
1530
+ * @param template The xsl:namespace element.
1531
+ * @param output The output node.
1532
+ */
1533
+ protected xsltNamespace(context: ExprContext, template: XNode, output?: XNode): Promise<void>;
1346
1534
  /**
1347
1535
  * Evaluates a variable or parameter and set it in the current input
1348
1536
  * context. Implements `xsl:variable`, `xsl:param`, and `xsl:with-param`.
@@ -1355,6 +1543,12 @@ declare class Xslt {
1355
1543
  * value. `xsl:variable` and `xsl:with-param` override; `xsl:param` doesn't.
1356
1544
  */
1357
1545
  protected xsltVariable(context: ExprContext, template: XNode, override: boolean): Promise<void>;
1546
+ /**
1547
+ * Register accepted variables from used packages into the context.
1548
+ * Called after processing package use-package declarations.
1549
+ * @param context The expression context.
1550
+ */
1551
+ private registerAcceptedVariables;
1358
1552
  /**
1359
1553
  * Traverses the template node tree. Calls the main processing
1360
1554
  * function with the current input context for every child node of the
@@ -1454,6 +1648,28 @@ declare class Xslt {
1454
1648
  * @param stylesheetElement The stylesheet or transform element.
1455
1649
  */
1456
1650
  private collectAttributeSets;
1651
+ /**
1652
+ * Collect all user-defined function definitions from the stylesheet.
1653
+ * Called at stylesheet initialization time.
1654
+ * @param stylesheetElement The stylesheet or transform element.
1655
+ * @param context The expression context.
1656
+ */
1657
+ private collectUserDefinedFunctions;
1658
+ /**
1659
+ * Register user-defined functions in the expression context.
1660
+ * This makes them available to XPath expressions.
1661
+ * @param context The expression context.
1662
+ */
1663
+ private registerUserDefinedFunctionsInContext;
1664
+ /**
1665
+ * Check if there are any accepted functions in used packages.
1666
+ */
1667
+ private hasAcceptedFunctions;
1668
+ /**
1669
+ * Register accepted functions from used packages.
1670
+ * @param functionsMap The map to register functions into.
1671
+ */
1672
+ private registerAcceptedFunctions;
1457
1673
  /**
1458
1674
  * Apply one or more attribute sets to an element.
1459
1675
  * Parses space-separated attribute set names and applies them.