@tradik/xslt-processor 1.0.1 → 1.0.2

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tradik/xslt-processor",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "JavaScript implementation of XSLTProcessor for browser environments and CLI",
5
5
  "type": "module",
6
6
  "main": "dist/xslt-processor.cjs",
@@ -588,10 +588,11 @@ export class XsltEngine {
588
588
  throw new Error("No output document available");
589
589
  }
590
590
 
591
- // Create context
591
+ // Create context - use document node as initial context for "/" template matching
592
+ // XPath paths like "RootElement/child" expect to start from document node
592
593
  const context = new XsltContext({
593
- currentNode: sourceNode.documentElement || sourceNode,
594
- currentNodeList: [sourceNode.documentElement || sourceNode],
594
+ currentNode: sourceNode,
595
+ currentNodeList: [sourceNode],
595
596
  position: 1,
596
597
  outputDocument: doc,
597
598
  stylesheet: this.stylesheetDoc,