Skip to content

Commit a50bf3a

Browse files
authored
Merge pull request #1 from imdj360/xsltnschange
Release v1.0.0: XSLT 1.0 Support and Namespace Improvements
2 parents 20db679 + d13af29 commit a50bf3a

60 files changed

Lines changed: 2508 additions & 419 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
out
2+
**/out/
23
dist
34
node_modules
45
.vscode-test/
@@ -13,6 +14,7 @@ obj/
1314
*.log
1415
*.tmp
1516
*.out.xml
17+
**/*.out.xml
1618

1719
# OS generated files
1820
.DS_Store

.vscodeignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,14 @@ src/**
55
.vscodeignore
66
.yarnrc
77
vsc-extension-quickstart.md
8+
package.json.backup
9+
TestData/**
10+
docs/**
811
**/tsconfig.json
912
**/eslint.config.mjs
1013
**/*.map
1114
**/*.ts
15+
**/*.sh
1216
**/.vscode-test.*
1317
.github/**
1418

@@ -69,6 +73,9 @@ logs
6973
npm-debug.log*
7074
yarn-debug.log*
7175
yarn-error.log*
76+
*.out.xml
77+
**/*.out.xml
78+
TestData/**/out/**
7279

7380
# Node modules (should be handled by vsce, but just in case)
7481
node_modules/**
@@ -116,3 +123,6 @@ VARIABLE-PRINT-GUIDE.md
116123
# Packaging scripts
117124
package-darwin.sh
118125
package-win.sh
126+
package-all.sh
127+
test-debug-output.sh
128+
test-namespace-support.sh

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,25 @@
22

33
All notable changes to the XSLT Debugger extension will be documented in this file.
44

5+
## [1.0.0] - 2025
6+
7+
### Added
8+
9+
- Shared XSLT 1.0 instrumentation helper used by both engines so Saxon can now debug XSLT 1.0 stylesheets that do not rely on `msxsl:script`.
10+
- Version-aware Saxon pipeline that switches to the 1.0-safe probes while retaining the existing XSLT 2.0/3.0 instrumentation.
11+
- Integration coverage for the new Saxon 1.0 path (`SaxonEngine_ShouldCaptureVariables_WhenRunningXslt1Stylesheet`) and console smoke tests for both engines.
12+
13+
### Changed
14+
15+
- Reorganised integration samples under `TestData/Integration/xslt/compiled/` and `TestData/Integration/xslt/saxon/` to mirror the engine split.
16+
- XsltCompiledEngine now delegates all 1.0 probe insertion to the shared helper, keeping instrumentation logic in one place.
17+
- Bumped the extension version to `1.0.0` and updated packaging docs to reference the new VSIX build numbers.
18+
- `.gitignore` / `.vscodeignore` now filter generated `out/` folders and `*.out.xml` artifacts across the tree.
19+
20+
### Fixed
21+
22+
- Ensured Saxon 1.0 runs produce the same breakpoint and variable capture behaviour as the compiled engine by reusing the same probe shapes.
23+
524
## [0.6.0] - 2025
625

726
### Added

README.md

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,25 @@ A powerful Visual Studio Code extension that enables debugging support for XSLT
88
- **Variable Inspection**: Automatically materialises XSLT variables and context nodes inside VS Code’s VARIABLES pane
99
- **XPath Evaluation**: Evaluate XPath expressions in the current context
1010
- **Inline C# Scripting**: Debug XSLT stylesheets with embedded C# code using Roslyn
11-
- **Multiple Engines**: Support for compiled XSLT engine (XSLT 1.0) and Saxon engine (XSLT 2.0/3.0)
11+
- **Multiple Engines**: Support for compiled XSLT engine (XSLT 1.0 + inline C#) and Saxon engine (XSLT 1.0 without `msxsl:script`, plus XSLT 2.0/3.0)
1212
- **Cross-Platform**: Works on Windows, macOS, and Linux
1313
- **Probe Tagging**: Instrumented breakpoints and trace messages are tagged with `dbg:probe="1"` so repeated runs stay idempotent
1414

1515
## XSLT Processing Engines
1616

17-
| Feature | Compiled Engine | Saxon .NET Engine |
18-
| ----------------- | -------------------------------- | ------------------------------------ |
19-
| **XSLT Version** | 1.0 | 2.0, 3.0 |
20-
| **XPath Version** | 1.0 | 2.0, 3.0 |
21-
| **Special Features** | Inline C# via `msxsl:script` | Full XSLT 2.0/3.0 features |
22-
| **Best For** | XSLT 1.0 with inline C# | Modern XSLT 2.0/3.0 stylesheets |
17+
| Feature | Compiled Engine | Saxon .NET Engine |
18+
| ----------------- | -------------------------------- | ---------------------------------------------------- |
19+
| **XSLT Version** | 1.0 | 1.0 (no inline C#), 2.0, 3.0 |
20+
| **XPath Version** | 1.0 | 2.0, 3.0 |
21+
| **Special Features** | Inline C# via `msxsl:script` | Full XSLT 2.0/3.0 features, version-aware probes |
22+
| **Best For** | XSLT 1.0 with inline C# | XSLT 1.0 without `msxsl:script`, plus 2.0/3.0 stylesheets |
2323

24-
**Engine Selection**: Auto-detected based on XSLT version, or manually set with `"engine": "compiled"` or `"engine": "saxonnet"` in launch.json
24+
**Engine Selection**: Auto-detected based on XSLT version and inline script usage, or manually set with `"engine": "compiled"` or `"engine": "saxonnet"` in launch.json
2525

2626
### ⚠️ Current Limitations
2727

2828
- Debugging focuses on basic XSLT structures (templates, loops, expressions); complex dynamic calls are not instrumented
29-
- Cannot step into inline C# scripts
29+
- Cannot step into inline C# scripts, though Roslyn instrumentation still logs entry parameters and return values to the console for visibility
3030
- Variable inspection uses "falldown" approach: variables are auto-captured via instrumentation as execution progresses forward (cannot re-run or step back to previous lines)
3131
- No support for: **step back**, goto targets, set variable, conditional breakpoints, or debug console autocomplete
3232
- Variable capture limited to `@select`-based variables; complex variables with content children may not be fully captured
@@ -49,10 +49,10 @@ A powerful Visual Studio Code extension that enables debugging support for XSLT
4949

5050
```bash
5151
# macOS
52-
code --install-extension xsltdebugger-darwin-darwin-arm64-0.6.0.vsix
52+
code --install-extension xsltdebugger-darwin-darwin-arm64-1.0.0.vsix
5353

5454
# Windows
55-
code --install-extension xsltdebugger-windows-win32-x64-0.6.0.vsix
55+
code --install-extension xsltdebugger-windows-win32-x64-1.0.0.vsix
5656
```
5757

5858
2. **Create a debug configuration** in [.vscode/launch.json](#setting-up-a-debug-configuration)
@@ -81,19 +81,19 @@ A powerful Visual Studio Code extension that enables debugging support for XSLT
8181

8282
```bash
8383
./package-all.sh
84-
code --install-extension xsltdebugger-darwin-darwin-arm64-0.6.0.vsix
84+
code --install-extension xsltdebugger-darwin-darwin-arm64-1.0.0.vsix
8585
```
8686

8787
**Platform-specific packaging** (build individually):
8888

8989
```bash
9090
# For macOS only
9191
./package-darwin.sh
92-
code --install-extension xsltdebugger-darwin-darwin-arm64-0.6.0.vsix
92+
code --install-extension xsltdebugger-darwin-darwin-arm64-1.0.0.vsix
9393

9494
# For Windows only
9595
./package-win.sh
96-
code --install-extension xsltdebugger-windows-win32-x64-0.6.0.vsix
96+
code --install-extension xsltdebugger-windows-win32-x64-1.0.0.vsix
9797
```
9898

9999
## Usage
@@ -202,7 +202,8 @@ Create a `.vscode/launch.json` file in your project workspace:
202202
- **Falldown Approach**: Variables appear in the Variables panel as execution flows forward past their declarations (not available before declaration)
203203
- **No Step Back**: Since variables are captured via forward instrumentation, you cannot step backward to re-inspect previous values
204204
- **XSLT 2.0/3.0**: Full support via Saxon engine with `@select`-based variable capture
205-
- **XSLT 1.0**: Limited variable inspection via Compiled engine
205+
- **XSLT 1.0 (no inline C#)**: Saxon engine reuses 1.0-safe probes (value-of/message) for equivalent capture behaviour
206+
- **XSLT 1.0 + inline C#**: Limited variable inspection via Compiled engine only
206207

207208
### Log Levels
208209

@@ -254,7 +255,7 @@ The debugger supports XSLT stylesheets with embedded C# code using `msxsl:script
254255

255256
- **Extension** ([src/extension.ts](src/extension.ts)): Registers debug type, resolves paths
256257
- **Adapter** ([XsltDebugger.DebugAdapter/](XsltDebugger.DebugAdapter/)): DAP server, engine management, breakpoint/stepping logic
257-
- **Engines**: `XsltCompiledEngine` (XSLT 1.0 + C#), `SaxonEngine` (XSLT 2.0/3.0)
258+
- **Engines**: `XsltCompiledEngine` (XSLT 1.0 + C#), `SaxonEngine` (XSLT 1.0 without `msxsl:script`, plus 2.0/3.0)
258259
- **Instrumentation**:
259260
- Breakpoints: Both engines inject `dbg:break()` extension function calls at breakpoint lines
260261
- Variables: Saxon engine injects `<xsl:message>` elements after variable declarations to auto-capture values
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ShipmentConfirmation>
3+
<Reference>REF-12345</Reference>
4+
<Net>1500.50</Net>
5+
<LicensePlate>ABC-123</LicensePlate>
6+
<Orders>
7+
<Number>ORD-001</Number>
8+
<CustomerName>Acme Corporation</CustomerName>
9+
<Date>2025-10-31 14:30:00</Date>
10+
<OrderItems>
11+
<Sequence>1</Sequence>
12+
<OperationCode>SHIP</OperationCode>
13+
</OrderItems>
14+
<OrderItems>
15+
<Sequence>2</Sequence>
16+
<OperationCode>LOAD</OperationCode>
17+
</OrderItems>
18+
</Orders>
19+
</ShipmentConfirmation>
File renamed without changes.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ns0:ShipmentConfirmation xmlns:ns0="http://www.example.com/ShipmentConfv2">
3+
<ns0:TransportTypeCode>TRUCK</ns0:TransportTypeCode>
4+
<ns0:TransportTypeDescription>Truck</ns0:TransportTypeDescription>
5+
<ns0:TransportMode>Road</ns0:TransportMode>
6+
<ns0:Direction>Outbound</ns0:Direction>
7+
<ns0:Reference>REF-REDACTED</ns0:Reference>
8+
<ns0:Arrival>2025-07-15T08:30:00Z</ns0:Arrival>
9+
<ns0:Departure>2025-07-15T10:45:00+02:00</ns0:Departure>
10+
<ns0:LicensePlate>PLATE-REDACTED</ns0:LicensePlate>
11+
<ns0:Net Currency="USD">12500.756</ns0:Net>
12+
<ns0:Status>Approved</ns0:Status>
13+
14+
<ns0:Orders>
15+
<ns0:Number>ORD-XXXX</ns0:Number>
16+
<ns0:Date>2025-07-15T00:00:00</ns0:Date>
17+
<ns0:CustomerCode>CUST-XXXX</ns0:CustomerCode>
18+
<ns0:CustomerName>LogicApps - iPaaS Tool Helper</ns0:CustomerName>
19+
<ns0:OrderItems>
20+
<ns0:Sequence>10</ns0:Sequence>
21+
<ns0:OperationName>Load truck</ns0:OperationName>
22+
<ns0:OperationCode>LD</ns0:OperationCode>
23+
<ns0:OperationReports>
24+
<ns0:ReportInfo>
25+
<ns0:OperationReportDate>2025-07-14T12:00:00</ns0:OperationReportDate>
26+
</ns0:ReportInfo>
27+
<ns0:ReportInfo>
28+
<ns0:OperationReportDate>2025-07-13T09:00:00</ns0:OperationReportDate>
29+
</ns0:ReportInfo>
30+
<ns0:ReportInfo>
31+
<ns0:OperationReportDate>2025-06-15T06:30:00</ns0:OperationReportDate>
32+
</ns0:ReportInfo>
33+
</ns0:OperationReports>
34+
</ns0:OrderItems>
35+
36+
<ns0:OrderItems>
37+
<ns0:Sequence>20</ns0:Sequence>
38+
<ns0:OperationName>Second load</ns0:OperationName>
39+
<ns0:OperationCode>LD2</ns0:OperationCode>
40+
<ns0:OperationReports>
41+
<ns0:ReportInfo>
42+
<ns0:OperationReportDate>2023-07-12</ns0:OperationReportDate>
43+
</ns0:ReportInfo>
44+
<ns0:ReportInfo>
45+
<ns0:OperationReportDate>2025-07-16T00:00:00</ns0:OperationReportDate>
46+
</ns0:ReportInfo>
47+
</ns0:OperationReports>
48+
</ns0:OrderItems>
49+
</ns0:Orders>
50+
</ns0:ShipmentConfirmation>

TestData/Integration/VariableLoggingSampleV1Input.xml renamed to TestData/Integration/xml/VariableLoggingSampleV1Input.xml

File renamed without changes.

0 commit comments

Comments
 (0)