├── .eslintrc.js ├── .gitignore ├── .vscode ├── launch.json └── tasks.json ├── .vscodeignore ├── CHANGELOG.md ├── LICENSE.txt ├── README.md ├── __tests__ ├── README.md ├── data │ ├── as-attributes-to-json-out.json │ ├── xpInAsAttribute-expected.json │ └── xsl-test-files │ │ └── xpInAsAttribute.xsl ├── diagnosticsFromXpInAsAttribute.spec.skip.ts ├── scripts │ └── xslAsAttributesToJson.xsl ├── types.ts ├── utils │ ├── testPaths.ts │ └── xpLexerTestGen.ts ├── xpLexer.spec.ts └── xpLexerAsAttribute.spec.ts ├── bugtest.xsl ├── deltaxigniaLogo.png ├── deltaxigniaLogoSmall.png ├── jest.config.js ├── language-configuration.json ├── notes.md ├── package-lock.json ├── package.json ├── resources ├── data │ ├── saxon10response.txt │ └── saxon9response.txt ├── generateDCPSchemaTS.sh ├── images │ └── run-extension.png ├── tasks │ └── tasks.json ├── xsd │ └── core-dcp-v1_0.xsd └── xslt │ └── xsd-to-typescript.xsl ├── sample ├── .vscode │ └── tasks.json ├── Untitled-1.ipynb ├── Untitled-1.xbook ├── accumulator.xsl ├── again.xml ├── arrow-function.xsl ├── auto-c.xsl ├── basic-support.xsl ├── basic.xpath ├── basic.xsl ├── call-template.xsl ├── demo.xpath ├── demo.xsl ├── empty.xml ├── empty.xsl ├── explore-validation-enhancements.xsl ├── features │ ├── included2.xsl │ └── included4.xsl ├── fnCompletionTest.xsl ├── fntest.xsl ├── for-var-scope.xsl ├── format-demo.xsl ├── format-paras.xsl ├── formatting-bug.xsl ├── formattingTest.xsl ├── function-params.xsl ├── function-var.xsl ├── functionBugImport.xsl ├── funtionBug.xsl ├── globalVarTest.xsl ├── gotoDefitinition.xsl ├── gotoTests.xsl ├── gotoVsBug.xsl ├── grouping.xsl ├── highlight-tvt.xsl ├── highlight.xsl ├── ifelse.xsl ├── import-globalDefintion2.xsl ├── import-gotoDefitinition.xsl ├── import-key.xsl ├── import-mode-test.xsl ├── import-sat.xsl ├── importSat.xsl ├── included │ ├── basic.xsl │ ├── concat.xsl │ ├── included5.xsl │ ├── iterate.xsl │ ├── jf-bug.xsl │ ├── rename1.xsl │ ├── rename2.xsl │ ├── version4-parts.xsl │ ├── version4.xsl │ └── version4run.xsl ├── included1.xsl ├── included3.xsl ├── included6.xsl ├── indent-test.xsl ├── indent.xpath ├── indentTest.xhtml ├── indentXML.xml ├── inputs-sample.json ├── iterate.xsl ├── ixslTest.xsl ├── javaTest.java ├── key.xsl ├── mapVariablesBug.xsl ├── messageTest.xsl ├── min-iterate.xsl ├── mode-test.xsl ├── name-template.xsl ├── new-auto.xsl ├── new-empty.xsl ├── new-package.xsl ├── new.xsl ├── newer.xml ├── newer.xsl ├── noLineFormatting.xml ├── nonIndentedXML.xml ├── odd-indent.xml ├── partial.xsl ├── path-diagnostics.xsl ├── renamTagBug.xsl ├── renameError.xsl ├── renameError2.xml ├── renameError3.xsl ├── renameTest.xml ├── return-bug.xsl ├── root-only.xsl ├── root.xml ├── rootSnippet.xsl ├── sat-context.xsl ├── sat-current.xsl ├── sat-latest-refactored.xsl ├── sat-latest.xsl ├── sat-merge.xsl ├── sat.xsl ├── schematron │ ├── cals-constraints.xsl │ ├── cals-table-functions.xsl │ ├── cals.sch │ └── test.sch ├── simple.xsl ├── simpleXML.xml ├── snippet-demo.xsl ├── src │ └── xsl │ │ ├── basic-support.xsl │ │ └── basic.xsl ├── test-last.xsl ├── test.bpmn ├── test.bpmn2 ├── test.dcp ├── test.js ├── test.xbook ├── test.xpath ├── test.xqy ├── test.xsl ├── test7.xml ├── test8.xsl ├── test88.html ├── testDiagnostics.xsl ├── testMapLookupWithFn.xsl ├── testUnused.xsl ├── testUseAttribute.xsl ├── theme-demo.xsl ├── token-name.xsl ├── tvt-cdata.xsl ├── typed.xsl ├── types.xsl ├── unused-avt-variable.xsl ├── unused-avt-variable2.xsl ├── unused-xpath-variables.xsl ├── unused-xslt-variables.xsl ├── valid-bug.xsl ├── var-error3.xsl ├── variable-error.xsl ├── variable-error2.xsl ├── w3c-xslt.xsl ├── w3functions.xsl ├── xml-stylesheet.xml ├── xpath-comment.xsl ├── xslt-compile-errors │ └── w3c-xslt.xsl └── xslt-out │ └── result1.xml ├── src ├── codeActionDocument.ts ├── codeActionTextLine.ts ├── dcpSchema.ts ├── dcpSnippets.ts ├── dcpSymbolProvider.ts ├── diagnostics.ts ├── documentChangeHandler.ts ├── documentLinkProvider.ts ├── extension.ts ├── fileSelection.ts ├── fullDocumentLinkProvider.ts ├── functionData.ts ├── globalsProvider.ts ├── languageConfigurations.ts ├── saxonJsTaskProvider.ts ├── saxonTaskProvider.ts ├── schSchema.ts ├── schemaQuery.ts ├── xmlDocumentFormattingProvider.ts ├── xmlSnippets.ts ├── xpLexer.ts ├── xpLexerRun.ts ├── xpathDocumentChangeHandler.ts ├── xpathFunctionDetails.ts ├── xslLexer.ts ├── xslLexerLight.ts ├── xslLexerRenameTag.ts ├── xslLexerRun.ts ├── xsltCodeActions.ts ├── xsltDefinitionProvider.ts ├── xsltHoverProvider.ts ├── xsltReferenceProvider.ts ├── xsltSchema.ts ├── xsltSchema4.ts ├── xsltSnippets.ts ├── xsltSymbolProvider.ts ├── xsltTokenCompletions.ts ├── xsltTokenDefintions.ts └── xsltTokenDiagnostics.ts ├── test ├── input.xml ├── issue-144.xsl └── test.xsl ├── tsconfig.json ├── tslint-to-eslint-config.log ├── tslint.json ├── vscode-xslt.png ├── xml-sample.xml ├── xpath-notebook-small.png ├── xpathSnippets.json ├── xsl-language-configuration.json ├── xslt-public-snippets.json ├── xslt-resources ├── deltaxml-saxon-perf-1.0-SAXON10.jar ├── deltaxml-saxon-perf-1.0-SAXON11.jar ├── deltaxml-saxon-perf-1.0-SAXON12.jar ├── deltaxml-saxon-perf-1.0-SAXON99.jar └── xpath-result-serializer │ ├── color-data-empty.xsl │ ├── color-data.xsl │ ├── xpath-result-serializer-color.xsl │ └── xpath-result-serializer.xsl ├── xslt-tasks-file.png ├── xslt-tasks.png ├── xslt-xpath.png └── xsltSnippets.json /.eslintrc.js: -------------------------------------------------------------------------------- 1 | /* 2 | 👋 Hi! This file was autogenerated by tslint-to-eslint-config. 3 | https://github.com/typescript-eslint/tslint-to-eslint-config 4 | 5 | It represents the closest reasonable ESLint configuration to this 6 | project's original TSLint configuration. 7 | 8 | We recommend eventually switching this configuration to extend from 9 | the recommended rulesets in typescript-eslint. 10 | https://github.com/typescript-eslint/tslint-to-eslint-config/blob/master/docs/FAQs.md 11 | 12 | Happy linting! 💖 13 | */ 14 | module.exports = { 15 | "env": { 16 | "browser": true, 17 | "es6": true, 18 | "node": true 19 | }, 20 | "extends": [ 21 | "prettier" 22 | ], 23 | "parser": "@typescript-eslint/parser", 24 | "parserOptions": { 25 | "sourceType": "module" 26 | }, 27 | "plugins": [ 28 | "@typescript-eslint" 29 | ], 30 | "rules": { 31 | "@typescript-eslint/indent": [ 32 | "off", 33 | "tab" 34 | ], 35 | "@typescript-eslint/member-delimiter-style": [ 36 | "error", 37 | { 38 | "multiline": { 39 | "delimiter": "semi", 40 | "requireLast": true 41 | }, 42 | "singleline": { 43 | "delimiter": "semi", 44 | "requireLast": false 45 | } 46 | } 47 | ], 48 | "@typescript-eslint/semi": [ 49 | "error", 50 | "always" 51 | ], 52 | "indent": "off", 53 | "semi": "error" 54 | } 55 | }; 56 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | out 2 | node_modules 3 | .vscode-test/ 4 | *.vsix 5 | npm-debug.log 6 | debug.log 7 | .DS_Store 8 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | // A launch configuration that compiles the extension and then opens it inside a new window 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | { 6 | "version": "0.2.0", 7 | "configurations": [{ 8 | "name": "Run Extension", 9 | "type": "extensionHost", 10 | "request": "launch", 11 | "runtimeExecutable": "${execPath}", 12 | "args": [ 13 | "--extensionDevelopmentPath=${workspaceFolder}" 14 | ], 15 | "outFiles": [ 16 | "${workspaceFolder}/out/**/*.js" 17 | ], 18 | "preLaunchTask": "npm: watch" 19 | }, 20 | { 21 | "type": "node", 22 | "request": "launch", 23 | "name": "Jest: Current File", 24 | "program": "${workspaceFolder}/node_modules/.bin/jest", 25 | "args": [ 26 | "--runInBand", 27 | "--config", 28 | "jest.config.js", 29 | "${file}" 30 | ], 31 | "console": "integratedTerminal", 32 | "internalConsoleOptions": "neverOpen", 33 | "preLaunchTask": "tsc: build - tsconfig.json", 34 | "outFiles": [ 35 | "${workspaceFolder}/out/**/*.js" 36 | ] 37 | }, 38 | { 39 | "name": "Run Extension Tests", 40 | "type": "extensionHost", 41 | "request": "launch", 42 | "runtimeExecutable": "${execPath}", 43 | "args": [ 44 | "--extensionDevelopmentPath=${workspaceFolder}", 45 | "--extensionTestsPath=${workspaceFolder}/out/test" 46 | ], 47 | "outFiles": [ 48 | "${workspaceFolder}/out/test/**/*.js" 49 | ], 50 | "preLaunchTask": "npm: watch" 51 | }, 52 | { 53 | "type": "node", 54 | "request": "launch", 55 | "name": "Add expected tokens to XP Lexer Test", 56 | "skipFiles": [ 57 | "/**" 58 | ], 59 | "program": "${workspaceFolder}/out/__tests__/utils/xpLexerTestGen.js", 60 | "preLaunchTask": "tsc: build - tsconfig.json", 61 | "console": "integratedTerminal", 62 | "outFiles": [ 63 | "${workspaceFolder}/out/test/**/*.js" 64 | ], 65 | "args": [ 66 | "--file", "${workspaceFolder}/__tests__/data/as-attributes-to-json-out.json" 67 | ] 68 | }, 69 | { 70 | "type": "node", 71 | "request": "launch", 72 | "name": "Run XPath Diagnostics", 73 | "skipFiles": [ 74 | "/**" 75 | ], 76 | "program": "${workspaceFolder}/out/xpLexerRun.js", 77 | "preLaunchTask": "tsc: build - tsconfig.json", 78 | "outFiles": [ 79 | "${workspaceFolder}/out/test/**/*.js" 80 | ] 81 | }, 82 | { 83 | "type": "node", 84 | "request": "launch", 85 | "name": "Run XSL Diagnostics", 86 | "skipFiles": [ 87 | "/**" 88 | ], 89 | "program": "${workspaceFolder}/out/xslLexerRun.js", 90 | "preLaunchTask": "tsc: build - tsconfig.json", 91 | "outFiles": [ 92 | "${workspaceFolder}/out/test/**/*.js" 93 | ] 94 | } 95 | ] 96 | } 97 | -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | // See https://go.microsoft.com/fwlink/?LinkId=733558 2 | // for the documentation about the tasks.json format 3 | { 4 | "version": "2.0.0", 5 | "tasks": [ 6 | { 7 | "type": "npm", 8 | "script": "watch", 9 | "problemMatcher": "$tsc-watch", 10 | "isBackground": true, 11 | "presentation": { 12 | "reveal": "never" 13 | }, 14 | "group": "build", 15 | "label": "npm: watch", 16 | "detail": "tsc -watch -p ./" 17 | }, 18 | { 19 | "type": "npm", 20 | "script": "lint", 21 | "problemMatcher": "$eslint-stylish", 22 | "label": "npm: lint", 23 | "detail": "eslint -c .eslintrc.js --ext .ts src" 24 | }, 25 | { 26 | "type": "xslt-js", 27 | "label": "xslt: as-attributes-to-json", 28 | "xsltFile": "${workspaceFolder}/__tests__/scripts/xslAsAttributesToJson.xsl", 29 | "xmlSource": "${workspaceFolder}/__tests__/data/xsl-test-files/xpInAsAttribute.xsl", 30 | "resultPath": "${workspaceFolder}/__tests__/data/as-attributes-to-json-out.json", 31 | "group": { 32 | "kind": "build", 33 | }, 34 | "problemMatcher": [ 35 | "$saxon-xslt-js" 36 | ] 37 | } 38 | ] 39 | } -------------------------------------------------------------------------------- /.vscodeignore: -------------------------------------------------------------------------------- 1 | .vscode/** 2 | .vscode-test/** 3 | __tests__/** 4 | xslt-out/** 5 | out/test/** 6 | out/**/*.map 7 | out/**/*.spec.js 8 | out/xpLexerRun.js 9 | out/xslLexerRun.js 10 | src/** 11 | resources/** 12 | sample/** 13 | test/** 14 | .gitignore 15 | tsconfig.json 16 | jest.config.js 17 | tslint.json -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to the "xslt-xpath for vscode" extension are documented in the project wiki, see: [Release Notes](https://github.com/DeltaXML/vscode-xslt-tokenizer/wiki/Release-Notes). -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2025 DeltaXignia Ltd 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /__tests__/README.md: -------------------------------------------------------------------------------- 1 | # Testing Process for the XSLT/XPath extension 2 | 3 | ## Overview 4 | This process involves testing XML/XSLT functionality through a series of automated steps. 5 | The example set out here is for one of just two automated test suites defined in `.spec.ts` files. 6 | 7 | This example checks `as` attributes found in XSLT instructions to ensure the generated tokens 8 | are correct. In this case, that they have properties matching the expected tokens. 9 | 10 | 11 | ## Steps 12 | 13 | ### 1. Create XSLT Test File 14 | - Create a new XSLT file (like `__tests__/data/xsl-test-files/xpInAsAttribute.xsl`) 15 | - Include XPath expressions you want to test 16 | - Save file in appropriate test directory 17 | 18 | ### 2. XSLT to JSON Conversion 19 | - Convert the XSLT file into a JSON format using the `xslt: as-attributes-to-json` task 20 | - This creates a JSON test specification file 21 | - JSON structure includes a set of tests 22 | - Each test is represented by an array with `name` and `xpath` array items 23 | 24 | ### 3. Generate Expected Tokens 25 | - Run the launch task "`Add expected tokens to XP Lexer Test`" to process the JSON file 26 | - System analyzes XPath expressions 27 | - Automatically adds expected token results to JSON file 28 | 29 | ### 4. Execute Test 30 | - Run the test using `npm test` 31 | - The `__tests__/xpLexerAsAttribute.spec.ts` file loads the JSON created in *Step 3* 32 | - The Jest test framework compares actual vs expected tokens 33 | - Provides confidence that features relying on XSLT/XPath tokens will work as expected 34 | 35 | ## Notes 36 | - Keep XPath expressions clear and focused 37 | - Review generated expected token data in _Step 3_ for accuracy 38 | 39 | ## Test Strategy 40 | The XSLT/XPath extension has evolved organically without any automated tests except those used 41 | at the time of project inception. 42 | 43 | The manual test strategy involves manually opening `*.xsl` files in the `sample` directory, along with other 44 | XSLT resources such as those found in the W3C XSLT tests. The following are the main features tested regularly. 45 | 46 | - Running XSLT using `tasks.json` (Task Providers for SaxonJ and SaxonJS) 47 | - Syntax-highlighting of XSLT and XPath (Lexers for XSLT and XPath) 48 | - Problem reporting for XSLT and XPath syntax (Linter) 49 | - Code formatting of XSLT and XPath (Formatting Provider) 50 | 51 | The tokens created by this extension's lexers are used in all XSLT/XPath language features with just one exception: 52 | when running XSLT tasks. If there's a problem with XPath generated tokens, all these language features are compromised. 53 | 54 | Syntax-highlighting proves to be a very effective way for manually testing the lexer behaviour. If tokens are highlighted 55 | badly then we know we have a problem that will affect other features like the linter or code-formatting provider. 56 | 57 | > The maintainer of this project is primarily an XSLT developer. This extension is therefore used, and thus tested, almost daily 58 | 59 | 60 | 61 | The automated test setup described here should be a useful supplement to this test strategy. 62 | 63 | 64 | ## Conclusion 65 | The tests, with their expected token data, ensure later releases do not 66 | change the token structure inadvertently. -------------------------------------------------------------------------------- /__tests__/data/xsl-test-files/xpInAsAttribute.xsl: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /__tests__/diagnosticsFromXpInAsAttribute.spec.skip.ts: -------------------------------------------------------------------------------- 1 | import * as vscode from 'vscode'; 2 | import * as fs from 'fs'; 3 | import * as path from 'path'; 4 | import { XsltTokenDiagnostics } from '../src/xsltTokenDiagnostics'; 5 | import { DocumentTypes, XslLexer } from '../src/xslLexer'; 6 | import { XSLTConfiguration } from '../src/languageConfigurations'; 7 | import { TestPaths } from './utils/testPaths'; 8 | 9 | describe('XsltTokenDiagnostics on xpInAsAttribute.xsl', () => { 10 | let document: vscode.TextDocument; 11 | let diagnostics: vscode.Diagnostic[]; 12 | 13 | beforeAll(async () => { 14 | const testDataFilePath = path.join(TestPaths.testXslDataDir, 'xpInAsAttribute.xsl'); 15 | const xslText = fs.readFileSync(testDataFilePath).toString(); 16 | document = await vscode.workspace.openTextDocument({ content: xslText, language: 'xml' }); 17 | const xsltConfig = XSLTConfiguration.configuration; 18 | const xslLexer = new XslLexer(xsltConfig); 19 | const allTokens = xslLexer.analyse(document.getText()); 20 | 21 | // Prepare dummy globalInstructionData and importedInstructionData as needed 22 | const globalInstructionData: any[] = []; 23 | const importedInstructionData: any[] = []; 24 | const symbols: vscode.DocumentSymbol[] = []; 25 | 26 | diagnostics = XsltTokenDiagnostics.calculateDiagnostics( 27 | xsltConfig, 28 | DocumentTypes.XSLT, 29 | document, 30 | allTokens, 31 | globalInstructionData, 32 | importedInstructionData, 33 | symbols 34 | ); 35 | }); 36 | 37 | it('should return diagnostics for known errors in xpInAsAttribute.xsl', () => { 38 | // Check that at least some diagnostics are returned 39 | expect(diagnostics.length).toBeGreaterThan(0); 40 | 41 | // Optionally, check for specific error messages or codes 42 | const errorMessages = diagnostics.map(d => d.message); 43 | expect(errorMessages.some(msg => msg.includes('invalid'))).toBe(true); 44 | expect(errorMessages.some(msg => msg.includes('expected'))).toBe(true); 45 | }); 46 | 47 | it('should include diagnostics for invalid types', () => { 48 | const invalidTypeDiagnostic = diagnostics.find(d => d.message.includes('xs:intege')); 49 | expect(invalidTypeDiagnostic).toBeDefined(); 50 | }); 51 | 52 | // Add more specific tests as needed for your error types and cases 53 | }); -------------------------------------------------------------------------------- /__tests__/scripts/xslAsAttributesToJson.xsl: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | ==== Watch Variables ==== 27 | tests: {ext:print($tests,8,' ')} 28 | result: {ext:print($result,8,' ')} 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /__tests__/types.ts: -------------------------------------------------------------------------------- 1 | export interface TestDataType { 2 | suite: string; 3 | description: string; 4 | tests: Array<{ 5 | label: string; 6 | xpath: string; 7 | tokens: Array<[string, string]>; 8 | }>; 9 | } 10 | 11 | export interface RawLexerTestData { 12 | suite: string; 13 | descriptor: string; 14 | testCases: [string, string][]; 15 | } -------------------------------------------------------------------------------- /__tests__/utils/testPaths.ts: -------------------------------------------------------------------------------- 1 | import * as path from 'path'; 2 | 3 | export class TestPaths { 4 | public static testDir = "__tests__"; 5 | public static testDataDir = path.join(this.testDir, "data"); 6 | public static testXslDataDir = path.join(this.testDataDir, "xsl-test-files"); 7 | } -------------------------------------------------------------------------------- /__tests__/utils/xpLexerTestGen.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Test Data Generator for XPath Lexer 3 | * 4 | * This module generates test data for the XPath lexer by processing input test cases 5 | * and producing expected token outputs. It takes a JSON input file containing test cases 6 | * and generates a corresponding JSON output file with lexer analysis results. 7 | * 8 | * @module xpLexerTestGen 9 | * 10 | * Usage: 11 | * ``` 12 | * xpLexerTestGen --file 13 | * ``` 14 | * 15 | * The input JSON file should contain: 16 | * - suite: Test suite name 17 | * - descriptor: Test suite description 18 | * - testCases: Array of [label, xpath] pairs to be analyzed 19 | * 20 | * Output includes: 21 | * - Token analysis results for each test case 22 | * - Metadata about the generator 23 | * - Version information for the extension when this was generated 24 | * 25 | * The generated output file is saved in the test data directory with "-expected.json" suffix 26 | */ 27 | import { XPathLexer, ExitCondition, LexPosition, TokenLevelState } from '../../src/xpLexer'; 28 | import fs = require('fs'); 29 | import path = require('path'); 30 | import { TestPaths } from './testPaths'; 31 | import { RawLexerTestData } from '../types'; 32 | 33 | function generator() { 34 | const args = process.argv.slice(2); 35 | let testDataFile = ""; 36 | if (args.length !== 2) { 37 | console.log("Usage: xpLexerTestGen --file "); 38 | return; 39 | } else { 40 | testDataFile = args[1]; 41 | } 42 | console.log("Test Data File: " + testDataFile); 43 | const rawTestData: RawLexerTestData = JSON.parse(fs.readFileSync(testDataFile, 'utf8')); 44 | const { suite, descriptor, testCases } = rawTestData; 45 | 46 | const metadata = getMetadata(); 47 | 48 | const lexer = new XPathLexer(); 49 | const position: LexPosition = { line: 0, startCharacter: 0, documentOffset: 0 }; 50 | const entries: any[] = []; 51 | 52 | testCases.forEach(([label, xpath]) => { 53 | const isTypeDeclaration = true; 54 | const tokensOut = lexer.analyse(xpath, ExitCondition.None, position, isTypeDeclaration); 55 | const tokens = tokensOut.map(token => [token.value, TokenLevelState[token.tokenType]]); 56 | entries.push({ label, xpath, tokens }); 57 | }); 58 | const outputPath = path.join(TestPaths.testDataDir, suite + "-expected.json"); 59 | fs.writeFileSync(outputPath, JSON.stringify({ suite, description: descriptor, metadata, tests: entries }, null, 2)); 60 | console.log("Generated expected test data saved to: " + outputPath); 61 | }; 62 | generator(); 63 | 64 | function getMetadata() { 65 | const generator = path.basename(__filename); 66 | const packageJsonPath = path.join(__dirname, '../../../package.json'); 67 | const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8')); 68 | const version = packageJson.version; 69 | return { moduleName: generator, version }; 70 | } 71 | -------------------------------------------------------------------------------- /__tests__/xpLexer.spec.ts: -------------------------------------------------------------------------------- 1 | import { XPathLexer, CharLevelState, TokenLevelState, ExitCondition } from '../src/xpLexer'; 2 | 3 | describe('XPathLexer', () => { 4 | let lexer: XPathLexer; 5 | 6 | beforeEach(() => { 7 | lexer = new XPathLexer(); 8 | }); 9 | 10 | describe('analyse()', () => { 11 | it('should handle empty input', () => { 12 | const result = lexer.analyse('', null, {line: 0, startCharacter: 0, documentOffset: 0}); 13 | expect(result).toEqual([]); 14 | }); 15 | 16 | it('should tokenize a simple variable reference', () => { 17 | const result = lexer.analyse('$foo', null, {line: 0, startCharacter: 0, documentOffset: 0}); 18 | 19 | expect(result.length).toBe(1); 20 | expect(result[0].tokenType).toBe(TokenLevelState.variable); 21 | expect(result[0].value).toBe('$foo'); 22 | }); 23 | 24 | it('should tokenize string literals', () => { 25 | const result = lexer.analyse('"test string"', null, {line: 0, startCharacter: 0, documentOffset: 0}); 26 | 27 | expect(result.length).toBe(1); 28 | expect(result[0].tokenType).toBe(TokenLevelState.string); 29 | expect(result[0].value).toBe('"test string"'); 30 | }); 31 | 32 | it('should tokenize numbers', () => { 33 | const result = lexer.analyse('123.45', null, {line: 0, startCharacter: 0, documentOffset: 0}); 34 | 35 | expect(result.length).toBe(1); 36 | expect(result[0].tokenType).toBe(TokenLevelState.number); 37 | expect(result[0].value).toBe('123.45'); 38 | }); 39 | }); 40 | 41 | describe('reset()', () => { 42 | it('should reset lexer state', () => { 43 | lexer.documentText = 'test'; 44 | lexer.documentTokens = [{ 45 | line: 1, 46 | startCharacter: 0, 47 | length: 4, 48 | value: 'test', 49 | tokenType: TokenLevelState.string 50 | }]; 51 | 52 | lexer.reset(); 53 | 54 | expect(lexer.documentText).toBe(''); 55 | expect(lexer.documentTokens).toEqual([]); 56 | }); 57 | }); 58 | }); -------------------------------------------------------------------------------- /__tests__/xpLexerAsAttribute.spec.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Test suite for XPath lexical analysis within attribute contexts 3 | * 4 | * This test suite validates the XPath lexer's ability to correctly tokenize XPath expressions 5 | * when they appear within XML attributes. It uses test cases from a JSON file containing 6 | * expected token patterns. 7 | * 8 | * Each test case verifies: 9 | * 1. The correct number of tokens are generated 10 | * 2. No error tokens are present in the output 11 | * 3. Each token's value matches the expected value 12 | * 4. Each token's type matches the expected token type 13 | * 14 | * @file xpLexerAsAttribute.spec.ts 15 | * @requires XPathLexer - the target of the test 16 | * 17 | * Origin of the data file: @file xpInAsAttribute-expected.json 18 | * 1. @file xpInAsAttribute.xsl - the original XSLT source 19 | * 2. @file as-attributes-to-json-out.json - extracted with @template xslAsAttributesToJson.xsl 20 | * 3. the data file with expected tokens added by @module xpLexerTestGen.ts 21 | * 22 | */ 23 | import { XPathLexer, ExitCondition, LexPosition, TokenLevelState } from '../src/xpLexer'; 24 | import * as fs from 'fs'; 25 | import * as path from 'path'; 26 | import { TestPaths } from './utils/testPaths'; 27 | import { TestDataType } from './types'; 28 | 29 | const testDataFile = 'xpInAsAttribute-expected.json'; 30 | const testData: TestDataType = getDataFromFile(); 31 | 32 | describe(`describe: ${testData.description}`, () => { 33 | const lexer = new XPathLexer(); 34 | // position info for tokens is computed from this start: 35 | const position: LexPosition = { line: 0, startCharacter: 0, documentOffset: 0 }; 36 | 37 | testData.tests.forEach((test) => { 38 | const { label, xpath, tokens } = test; 39 | it(`${label} : ${xpath}`, () => { 40 | // the call to the xpLexer.analyse function - the subject of the tests: 41 | const tokensOut = lexer.analyse(xpath, ExitCondition.None, position, true); 42 | expect(tokensOut.length).toBe(tokens.length); 43 | const errorTokens = tokensOut.filter(t => t.error); 44 | expect(errorTokens.length).toBe(0); 45 | 46 | tokensOut.forEach((token, idx) => { 47 | const [expectedValue, expectedType] = tokens[idx]; 48 | expect(token.value).toBe(expectedValue); 49 | expect(TokenLevelState[token.tokenType]).toBe(expectedType); 50 | }); 51 | }); 52 | }); 53 | }); 54 | 55 | function getDataFromFile() { 56 | const testDataFilePath = path.join(TestPaths.testDataDir, testDataFile); 57 | const testData: TestDataType = JSON.parse(fs.readFileSync(testDataFilePath, 'utf8')); 58 | return testData; 59 | } 60 | -------------------------------------------------------------------------------- /bugtest.xsl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeltaXML/vscode-xslt-tokenizer/bab18c3e75639a1dcb50affca97dd15d0158ab36/bugtest.xsl -------------------------------------------------------------------------------- /deltaxigniaLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeltaXML/vscode-xslt-tokenizer/bab18c3e75639a1dcb50affca97dd15d0158ab36/deltaxigniaLogo.png -------------------------------------------------------------------------------- /deltaxigniaLogoSmall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeltaXML/vscode-xslt-tokenizer/bab18c3e75639a1dcb50affca97dd15d0158ab36/deltaxigniaLogoSmall.png -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- 1 | export const testMatch = ['**\\__tests__\\*.spec.ts']; 2 | export const transform = { 3 | '^.+\\.ts$': ['ts-jest', { tsconfig: 'tsconfig.json' }], 4 | }; -------------------------------------------------------------------------------- /language-configuration.json: -------------------------------------------------------------------------------- 1 | { 2 | "comments": { 3 | "blockComment": [ "(:", ":)" ] 4 | }, 5 | "brackets": [ 6 | ["{", "}"], 7 | ["[", "]"], 8 | ["(", ")"] 9 | ], 10 | "autoClosingPairs": [ 11 | { "open": "{", "close": "}" }, 12 | { "open": "[", "close": "]" }, 13 | { "open": "(", "close": ")" }, 14 | { "open": "'", "close": "'", "notIn": ["string", "comment"] }, 15 | { "open": "\"", "close": "\"", "notIn": ["string"] }, 16 | { "open": "(:", "close": ":", "notIn": ["string"] } // close not :) due to conflict with '(', ')' pair 17 | ], 18 | "autoCloseBefore": ";:.,=}])>` \n\t", 19 | "surroundingPairs": [ 20 | ["{", "}"], 21 | ["[", "]"], 22 | ["(", ")"], 23 | ["'", "'"], 24 | ["\"", "\""] 25 | ], 26 | "folding": { 27 | "markers": { 28 | "start": "^\\s*//\\s*#?region\\b", 29 | "end": "^\\s*//\\s*#?endregion\\b" 30 | } 31 | }, 32 | "wordPattern": "(-?\\d*\\.\\d\\w*)|([^\\`\\~\\!\\#\\%\\^\\&\\*\\(\\)\\-\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\<\\>\\/\\?\\s]+)" 33 | } -------------------------------------------------------------------------------- /notes.md: -------------------------------------------------------------------------------- 1 | # calculateDiagnostics references: 2 | 3 | - XSLTTokenDiagnostics.calculateDiagnostics 4 | - XSLTSymbolProvider.getDocumentSymbols 5 | 6 | # processTopLevelImports references 7 | 8 | XsltDefinitionProvider implements vscode.DefinitionProvider, vscode.CompletionItemProvider 9 | 10 | - XSLTSymbolProvider.processTopLevelImports 11 | - XSLTDefinitionProvider.getImportedGlobals 12 | - XSLTSymbolProvider.getDocumentSymbols 13 | 14 | 15 | let refDocTokens = XSLTReferenceProvider.calculateReferences(instruction, langConfig, langConfig.docType, hrefDoc, eid.allTokens, eid.globalInstructionData, eid.allImportedGlobals); 16 | "file:///Users/philipf/Documents/github/vscode-xslt-tokenizer/sample/included6.xsl" 17 | ----------- 18 | XsltDefinitionProvider 19 | async provideDefinition 20 | XsltTokenDefinitions.findDefinition 21 | XsltTokenDefinitions.findMatchingDefintion 22 | async seekDefinition - used by xsltReferenceProvider.ts 23 | ---------- 24 | # What works 25 | Find all references from 26 | Rename Symbol from 27 | # What doesn't work 28 | Goto Definition from anywhere 29 | Rename Symbol for anywhere other than 30 | 31 | Open VS Code with no user-settings 32 | 33 | ``` 34 | vscode-xslt-tokenizer % code --user-data-dir $(mktemp -d) 35 | ``` -------------------------------------------------------------------------------- /resources/data/saxon10response.txt: -------------------------------------------------------------------------------- 1 | > Executing task: java -jar /usr/local/opt/SaxonHE10-0J/saxon-he-10.0.jar -xsl:/Users/philipf/Documents/github/vscode-xslt-tokenizer/sample/w3c-xslt.xsl -s:/Users/philipf/Documents/github/vscode-xslt-tokenizer/sample/w3c-xslt.xsl -o:/Users/philipf/Documents/github/vscode-xslt-tokenizer/sample/xslt-out/result1.xml 2>&1 < 2 | 3 | Warning at xsl:mode on line 30 column 78 of w3c-xslt.xsl: 4 | SXST0068 Request for streaming ignored: this Saxon configuration does not support streaming 5 | Warning at xsl:mode on line 31 column 81 of w3c-xslt.xsl: 6 | SXST0068 Request for streaming ignored: this Saxon configuration does not support streaming 7 | Error near {... 'use-last:' function($} at char 139 in xsl:sequence/@select on line 215 column 29 of w3c-xslt.xsl: 8 | XPST0003 expected ":", found "()" 9 | Error near {...t $in := descendant::axr:bs...} at char 43 in xsl:sequence/@select on line 231 column 29 of w3c-xslt.xsl: 10 | XPST0081 Namespace prefix 'axr' has not been declared 11 | Error at xsl:package on line 21 column 82 of w3c-xslt.xsl: 12 | XTSE3085 The default mode j:xml-to-json has not been declared in an xsl:mode declaration 13 | Errors were reported during stylesheet compilation 14 | The terminal process terminated with exit code: 2 -------------------------------------------------------------------------------- /resources/data/saxon9response.txt: -------------------------------------------------------------------------------- 1 | > Executing task: java -jar /usr/local/java/SaxonPE9-9-1-3J/saxon9pe.jar -xsl:/Users/philipf/Documents/github/vscode-xslt-tokenizer/sample/w3c-xslt.xsl -s:/Users/philipf/Documents/github/vscode-xslt-tokenizer/sample/w3c-xslt.xsl -o:/Users/philipf/Documents/github/vscode-xslt-tokenizer/sample/xslt-out/result1.xml 2>&1 < 2 | 3 | Warning at xsl:mode on line 30 column 78 of w3c-xslt.xsl: 4 | SXST0068: Request for streaming ignored: this Saxon configuration does not support streaming 5 | Warning at xsl:mode on line 31 column 81 of w3c-xslt.xsl: 6 | SXST0068: Request for streaming ignored: this Saxon configuration does not support streaming 7 | Syntax error near {... 'use-last:' function($} at char 139 in expression in xsl:sequence/@select on line 215 column 29 of w3c-xslt.xsl: 8 | XPST0003: expected ":", found "()" 9 | Static error near {...t $in := descendant::axr:bs...} at char 43 in expression in xsl:sequence/@select on line 231 column 29 of w3c-xslt.xsl: 10 | XPST0081: Namespace prefix 'axr' has not been declared 11 | Static error at xsl:package on line 21 column 82 of w3c-xslt.xsl: 12 | XTSE3085: The default mode j:xml-to-json has not been declared in an xsl:mode declaration 13 | Errors were reported during stylesheet compilation 14 | The terminal process terminated with exit code: 2 15 | 16 | Type error at char 0 in expression in xsl:sequence/@select on line 10 column 47 of basic-support.xsl: 17 | XTTE0780 The required item type of the result of a call to ext:test#0 is xs:string. The 18 | supplied value is of type xs:integer 19 | Errors were reported during stylesheet compilation -------------------------------------------------------------------------------- /resources/generateDCPSchemaTS.sh: -------------------------------------------------------------------------------- 1 | java -jar /usr/local/java/SaxonPE9-8-0-12J/saxon9pe.jar -xsl:resources/xslt/xsd-to-typescript.xsl -s:resources/xsd/core-dcp-v1_0.xsd -o:src/dcpSchema.ts -------------------------------------------------------------------------------- /resources/images/run-extension.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeltaXML/vscode-xslt-tokenizer/bab18c3e75639a1dcb50affca97dd15d0158ab36/resources/images/run-extension.png -------------------------------------------------------------------------------- /resources/tasks/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | // See https://go.microsoft.com/fwlink/?LinkId=733558 3 | // for the documentation about the tasks.json format 4 | "version": "2.0.0", 5 | "tasks": [ 6 | { 7 | "label": "saxon-xslt", 8 | "type": "shell", 9 | "command": "java", 10 | "args": [ 11 | "-jar", 12 | "/Users/philipf/Documents/github/SaxonHE10-0J/saxon-he-10.0.jar", 13 | "-xsl:${file}", 14 | "-s:${file}", 15 | "-o:${workspaceFolder}/saxon.xslt.result.xml" 16 | ], 17 | "problemMatcher": { 18 | "owner": "xslt", 19 | "fileLocation": ["relative", "${file}/.."], 20 | "pattern": [ 21 | { 22 | "regexp": "^(Error|Warning|Info)\\s+(?:on|at|near\\s+.*.*)(?:\\s+)?([^\\s]*)(?:\\s+on)?\\s+line\\s+(\\d+)\\s+column\\s+(\\d+)\\s+of\\s+([^:]*)", 23 | "line": 3, 24 | "column": 4, 25 | "severity": 1, 26 | "file": 5 27 | }, 28 | { 29 | "regexp": "^\\s+(\\w{4}\\d{4})\\s+(.*)", 30 | "code": 1, 31 | "message": 2 32 | } 33 | ] 34 | }, 35 | "group": { 36 | "kind": "build", 37 | "isDefault": true 38 | }, 39 | "presentation": { 40 | "echo": true, 41 | "reveal": "always", 42 | "focus": false, 43 | "panel": "dedicated", 44 | "showReuseMessage": true, 45 | "clear": true 46 | } 47 | } 48 | ] 49 | } -------------------------------------------------------------------------------- /sample/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "type": "xslt", 6 | "label": "Basic Transform", 7 | "saxonJar": "${config:XSLT.tasks.saxonJar}", 8 | "xsltFile": "${workspaceFolder}/src/xsl/basic.xsl", 9 | "xmlSource": "${workspaceFolder}/src/xsl/basic.xsl", 10 | "resultPath": "${workspaceFolder}/out/${fileBasenameNoExtension}.xml", 11 | "parameters": [ 12 | { 13 | "name": "p1", 14 | "value": "p1value" 15 | }, 16 | { 17 | "name": "p2", 18 | "value": "p2value" 19 | } 20 | ], 21 | "presentation": { 22 | "echo": true, 23 | "reveal": "always", 24 | "focus": false, 25 | "panel": "shared", 26 | "showReuseMessage": true, 27 | "clear": false 28 | }, 29 | "classPathEntries": [ 30 | "/xrc/utilitiy.class1", 31 | "/xrc/utility.class2" 32 | ], 33 | "group": { 34 | "kind": "build" 35 | }, 36 | "problemMatcher": "$saxon-xslt.workspace.src.xsl" 37 | }, 38 | { 39 | "type": "xslt", 40 | "label": "Compile Active XSLT File", 41 | "saxonJar": "${config:XSLT.tasks.saxonJar}", 42 | "xsltFile": "${file}", 43 | "xmlSource": "${file}", 44 | "resultPath": "${workspaceFolder}/out/${fileBasenameNoExtension}.xml", 45 | "group": { 46 | "kind": "build" 47 | }, 48 | "problemMatcher": "$saxon-xslt" 49 | }, 50 | { 51 | "type": "xslt", 52 | "label": "XSLT 4 Experimental", 53 | "saxonJar": "${config:XSLT.tasks.saxonJar}", 54 | "xsltFile": "${file}", 55 | "xmlSource": "${file}", 56 | "resultPath": "${workspaceFolder}/xslt-out/result1.xml", 57 | "allowSyntaxExtensions40": "on", 58 | "group": { 59 | "kind": "build" 60 | }, 61 | "problemMatcher": [ 62 | "$saxon-xslt" 63 | ] 64 | }, 65 | { 66 | "type": "xslt", 67 | "label": "xslt3", 68 | "saxonJar": "${config:XSLT.tasks.saxonJar}", 69 | "xsltFile": "${file}", 70 | "xmlSource": "${file}", 71 | "resultPath": "${workspaceFolder}/xslt-out/result1.xml", 72 | "allowSyntaxExtensions40": "off", 73 | "group": { 74 | "kind": "build" 75 | }, 76 | "problemMatcher": [ 77 | "$saxon-xslt" 78 | ] 79 | }, 80 | { 81 | "type": "xslt", 82 | "label": "xslt: Saxon Transform (New)", 83 | "saxonJar": "${config:XSLT.tasks.saxonJar}", 84 | "xsltFile": "${command:xslt-xpath.pickXsltFile}", 85 | "xmlSource": "${file}", 86 | "resultPath": "${command:xslt-xpath.pickResultFile}", 87 | "allowSyntaxExtensions40": "off", 88 | "group": { 89 | "kind": "build" 90 | }, 91 | "problemMatcher": [ 92 | "$saxon-xslt" 93 | ] 94 | } 95 | ] 96 | } -------------------------------------------------------------------------------- /sample/Untitled-1.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 1, 6 | "metadata": {}, 7 | "outputs": [ 8 | { 9 | "data": { 10 | "text/html": [ 11 | "

4

" 12 | ], 13 | "text/x-json": [ 14 | "4" 15 | ] 16 | }, 17 | "metadata": {}, 18 | "output_type": "display_data" 19 | } 20 | ], 21 | "source": [ 22 | "2+2" 23 | ] 24 | } 25 | ], 26 | "metadata": { 27 | "language_info": { 28 | "name": "python" 29 | }, 30 | "orig_nbformat": 4 31 | }, 32 | "nbformat": 4, 33 | "nbformat_minor": 2 34 | } 35 | -------------------------------------------------------------------------------- /sample/Untitled-1.xbook: -------------------------------------------------------------------------------- 1 | [{"kind":1,"language":"markdown","value":"# XPath Notebook\nDate: 2022-05-07     Time: 16:18:31"},{"kind":2,"language":"xpath","value":""}] -------------------------------------------------------------------------------- /sample/accumulator.xsl: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /sample/again.xml: -------------------------------------------------------------------------------- 1 | the quick brown -------------------------------------------------------------------------------- /sample/arrow-function.xsl: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /sample/auto-c.xsl: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | abc 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /sample/basic-support.xsl: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /sample/basic.xpath: -------------------------------------------------------------------------------- 1 | count(@author), 2 | map{abc: 'new'}, 3 | "double quote", 4 | parent::basic/@any, 5 | $a instance of xs:integer and /basic/need/is/good, 6 | 'string', 7 | Q{brackets}, 8 | (@author), 9 | parent::basic/@any, 10 | $a instance of xs:integer and /basic/need/is/good, 11 | 'string', 12 | Q{brackets}, 13 | (@author), 14 | parent::basic/@any, 15 | $a instance of xs:integer and /basic/need/is/good, 16 | this, 'string' 25.8 + 92e-1 (:com(:m 17 | e:)nt:) 18 | 'st 19 | ring', 20 | Q{brackets}, 21 | (@author), 22 | parent::basic/@any, 23 | $a instance of xs:integer and /basic/need/is/good, 24 | 'string', 25 | Q{brackets}, 26 | (@author), 27 | parent::basic/@any, 28 | $a instance of xs:integer and /basic/need/is/good, 29 | 'string', 30 | Q{brackets}, 31 | (@author), 32 | parent::basic/@any, 33 | $a instance of xs:integer and /basic/need/is/good, 34 | 'string', 35 | Q{brackets}, -------------------------------------------------------------------------------- /sample/basic.xsl: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 12 | test 13 | 14 | 15 | -------------------------------------------------------------------------------- /sample/call-template.xsl: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /sample/demo.xpath: -------------------------------------------------------------------------------- 1 | (: attribute :) element/@attribute[. eq 'test'], 2 | (: number :) 125.87e-5, 3 | (: operator :) a div b, 4 | (: variable :) $ms:var.start, 5 | (: string-1 :) 'a ''single "quoted" string'' here', 6 | (: string-2 :) "a ""double 'quoted' string"" here", 7 | (: uriLiteral :) Q{http://www.w3.org/1999/xhtml}div, 8 | (: nodeType :) node(), 9 | (: simpleType:) $a castable as xs:integer, 10 | (: axis :) parent::book, 11 | (: name :) dxl:simple-book.name, 12 | (: declaration:) let $a := book, $b := magazine return ($a,$b), 13 | (: function :) count($a), 14 | (: map :) map {'a': 'b'}, 15 | (: array :) array [1, 2], 16 | if ($a) then $b else $c, 17 | every $a in union/elements[node()] satisfies $a eq 5, 18 | some $b in $test satisfies $b eq books/@id!xs:integer(), 19 | $a union $b = $c, 20 | let $val := count($bst), $num := $spt return $val * $num, 21 | $c instance of xs:string, union,div,5 div 10 22 | (: comment (:nested:) :) -------------------------------------------------------------------------------- /sample/demo.xsl: -------------------------------------------------------------------------------- 1 | 4 | 5 | 9 | 10 | 14 | 15 | the quick 16 | 17 | 18 | 19 | 20 | 21 | 22 |

{for $a in 1 to 20 return 23 | descendant::NAME[@id eq 'tqs'] || $a}

24 |
25 | 26 | 27 | {substring-before(., ',')}: {substring-after(., ',')} 28 | some test here < and again 29 | 30 | 31 |
-------------------------------------------------------------------------------- /sample/empty.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | this 7 | 8 | -------------------------------------------------------------------------------- /sample/empty.xsl: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 23 | 24 | -------------------------------------------------------------------------------- /sample/explore-validation-enhancements.xsl: -------------------------------------------------------------------------------- 1 | 2 | 12 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /sample/features/included2.xsl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /sample/features/included4.xsl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /sample/fnCompletionTest.xsl: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | the {$mp1} 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /sample/fntest.xsl: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /sample/for-var-scope.xsl: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /sample/format-demo.xsl: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /sample/format-paras.xsl: -------------------------------------------------------------------------------- 1 | 2 | this is goind 3 | to be difficult 4 | and so is this 5 | 6 | this is quite 7 | new to this also 8 | 10 | and again 11 | difficult 12 | 13 | 14 | keep indents 15 | inside 16 | xsl:text 17 | because this is the convention 18 | 19 | 20 | keep 21 | this 22 | indent 23 | 24 | and observe 25 | preserv-space 26 | 27 | 28 | -------------------------------------------------------------------------------- /sample/formatting-bug.xsl: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 14 | 15 | 16 | All prefixes '{$list}' <included. 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /sample/formattingTest.xsl: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | test 15 | 16 | 17 | also 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /sample/function-params.xsl: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /sample/function-var.xsl: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /sample/functionBugImport.xsl: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /sample/funtionBug.xsl: -------------------------------------------------------------------------------- 1 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /sample/globalVarTest.xsl: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 11 | 15 | 16 | -------------------------------------------------------------------------------- /sample/gotoDefitinition.xsl: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /sample/gotoTests.xsl: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | test 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /sample/gotoVsBug.xsl: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /sample/grouping.xsl: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | {$regex-group(1)}{$regex-group2(2)} 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | {$fn(1)} 28 | 29 | 30 | -------------------------------------------------------------------------------- /sample/highlight-tvt.xsl: -------------------------------------------------------------------------------- 1 | 2 | this {if (book) then $abc + count(289) else 289} 3 | common {$var} variable use 4 | -------------------------------------------------------------------------------- /sample/highlight.xsl: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 20 | 21 | 22 | All prefixes '{$list}' <included. 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /sample/ifelse.xsl: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 18 | 19 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 37 | 38 | 45 | 46 | -------------------------------------------------------------------------------- /sample/import-globalDefintion2.xsl: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /sample/import-gotoDefitinition.xsl: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /sample/import-key.xsl: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | test 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /sample/import-mode-test.xsl: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /sample/import-sat.xsl: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /sample/importSat.xsl: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /sample/included/basic.xsl: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /sample/included/concat.xsl: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |

23 |
24 | 25 | 26 | 27 | 28 |

29 |
30 |
31 | 32 |
-------------------------------------------------------------------------------- /sample/included/included5.xsl: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /sample/included/iterate.xsl: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /sample/included/jf-bug.xsl: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 22 | 23 | 24 | 30 | 31 | 34 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /sample/included/rename1.xsl: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 9 | 10 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /sample/included/rename2.xsl: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /sample/included/version4-parts.xsl: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /sample/included/version4.xsl: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /sample/included/version4run.xsl: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /sample/included1.xsl: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /sample/included3.xsl: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /sample/included6.xsl: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /sample/indent-test.xsl: -------------------------------------------------------------------------------- 1 | 5 | 6 | 14 | 15 | 28 | 29 | 30 | 46 | 47 | 66 | 67 | 75 | 76 | 88 | 89 | 105 | 106 | 126 | 127 | 128 | 129 | 138 | 139 | 148 | 149 | 151 | 152 | 157 | 158 | 166 | 167 | 173 | 174 | 182 | 183 | 192 | 193 | 194 | 202 | 203 | -------------------------------------------------------------------------------- /sample/indent.xpath: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeltaXML/vscode-xslt-tokenizer/bab18c3e75639a1dcb50affca97dd15d0158ab36/sample/indent.xpath -------------------------------------------------------------------------------- /sample/indentTest.xhtml: -------------------------------------------------------------------------------- 1 |

test

-------------------------------------------------------------------------------- /sample/indentXML.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | this is going 5 | this is going 6 | ok but how will this continue when mixed content happens 7 | 8 | 9 | -------------------------------------------------------------------------------- /sample/inputs-sample.json: -------------------------------------------------------------------------------- 1 | { 2 | "inputs": [ 3 | { 4 | "id": "xmlFile", 5 | "type": "command", 6 | "command": "xslt-xpath.pickFile", 7 | "args": {"label": "Select XML File", "extensions": ["xml", "docbook"] } 8 | }, 9 | { 10 | "id": "xsltFile", 11 | "type": "command", 12 | "command": "xslt-xpath.pickFile", 13 | "args": {"label": "Select XSLT Stylesheet", "extensions": ["xsl"] } 14 | } 15 | ] 16 | } -------------------------------------------------------------------------------- /sample/iterate.xsl: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 23 | 24 | 25 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /sample/ixslTest.xsl: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /sample/javaTest.java: -------------------------------------------------------------------------------- 1 | class TEST { 2 | 3 | } -------------------------------------------------------------------------------- /sample/key.xsl: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 11 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | test 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /sample/mapVariablesBug.xsl: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /sample/messageTest.xsl: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /sample/min-iterate.xsl: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /sample/mode-test.xsl: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /sample/name-template.xsl: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /sample/new-auto.xsl: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /sample/new-empty.xsl: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 9 | 10 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /sample/new-package.xsl: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /sample/new.xsl: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | ]> 9 | 19 | 20 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | ---- scope variables ---- 45 | document: {$document} 46 | net: {$net} 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | -------------------------------------------------------------------------------- /sample/newer.xml: -------------------------------------------------------------------------------- 1 | the quick brown -------------------------------------------------------------------------------- /sample/newer.xsl: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /sample/noLineFormatting.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /sample/nonIndentedXML.xml: -------------------------------------------------------------------------------- 1 | this is going ok but how will this continue when mixed content happens -------------------------------------------------------------------------------- /sample/odd-indent.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /sample/partial.xsl: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 13 | 14 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /sample/path-diagnostics.xsl: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /sample/renamTagBug.xsl: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | new 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | new 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /sample/renameError.xsl: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | ]> 9 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /sample/renameError2.xml: -------------------------------------------------------------------------------- 1 |
3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 1 13 | 14 | 15 | 16 |
17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 1 28 | 29 | 30 | 31 |
32 |
33 | 34 |
35 |
-------------------------------------------------------------------------------- /sample/renameError3.xsl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 13 | 14 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /sample/renameTest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | test this 6 | 7 | -------------------------------------------------------------------------------- /sample/return-bug.xsl: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 25 | 26 | 30 | 31 | 35 | 36 | 43 | 44 | -------------------------------------------------------------------------------- /sample/root-only.xsl: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 21 | 22 | -------------------------------------------------------------------------------- /sample/rootSnippet.xsl: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /sample/sat-context.xsl: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 22 | 23 | 24 | 25 | 26 | 27 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | {$depth} of {last()} on {name()} 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /sample/sat-current.xsl: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /sample/sat-latest-refactored.xsl: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | {$depth} of {$c.l} on {name($c.x)} 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /sample/sat-latest.xsl: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | {$depth} of {last()} on {name()} 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /sample/sat-merge.xsl: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 21 | 22 | 23 | 26 | 27 | 28 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | Error: update is present with no matching master record! 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | Conflict: multiple updates for the same master record! 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /sample/sat.xsl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 22 | 23 | 24 | 26 | 30 | 36 | 37 | 38 | 39 | text {$abc} 40 | 41 | something 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /sample/schematron/cals-constraints.xsl: -------------------------------------------------------------------------------- 1 | 2 | 15 | 16 | 24 | 25 | 26 | 27 | Created on: Sep 23, 2011 28 | Author: tristanm 29 | 30 | 31 | 32 | 33 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | -------------------------------------------------------------------------------- /sample/schematron/test.sch: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Use of the spanname attribute in a thead () is not allowed when local colspec elements are defined CALS-T5R1 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /sample/simple.xsl: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /sample/simpleXML.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /sample/src/xsl/basic-support.xsl: -------------------------------------------------------------------------------- 1 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /sample/src/xsl/basic.xsl: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /sample/test-last.xsl: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | "/> 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /sample/test.bpmn2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeltaXML/vscode-xslt-tokenizer/bab18c3e75639a1dcb50affca97dd15d0158ab36/sample/test.bpmn2 -------------------------------------------------------------------------------- /sample/test.dcp: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /sample/test.js: -------------------------------------------------------------------------------- 1 | const city = 'london' -------------------------------------------------------------------------------- /sample/test.xbook: -------------------------------------------------------------------------------- 1 | [{"kind":1,"language":"markdown","value":"# XPath Notebook\nDate: 2022-10-30     Time: 13:31:49"},{"kind":2,"language":"xpath","value":"/((element))"},{"kind":2,"language":"xpath","value":"/element/*!array {position(), ., string() => normalize-space() => substring(1, 10)}"}] -------------------------------------------------------------------------------- /sample/test.xpath: -------------------------------------------------------------------------------- 1 | for $a in 2 + 3 return -------------------------------------------------------------------------------- /sample/test.xqy: -------------------------------------------------------------------------------- 1 | (: attribute :) element/@attribute, 2 | (: number :) 125.87e-5, 3 | (: operator :) a div b, 4 | (: variable :) let $variable := 2 return $variable, 5 | (: string-1 :) 'a ''single "quoted" string'' here', 6 | (: string-2 :) "a ""double 'quoted' string"" here", 7 | (: uriLiteral Q{http://example.com.test} :) 8 | (: nodeType :) node(), 9 | (: simmpleType:) let $a := 1 return $a castable as xs:integer, 10 | (: axis :) parent::book, 11 | (: name :) dxl:simple-book, 12 | (: declaration:) let $a := book return 13 | (: function :) count($a), 14 | (: map map {'a': 'b'} :) 15 | (: array array {1, 2} :) 16 | (: comment (:nested:) :) 17 | 5 < 2 -------------------------------------------------------------------------------- /sample/test.xsl: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /sample/test7.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /sample/test8.xsl: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /sample/test88.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

This is a test

5 | 6 | -------------------------------------------------------------------------------- /sample/testDiagnostics.xsl: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /sample/testMapLookupWithFn.xsl: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /sample/testUnused.xsl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 11 | 12 | 16 | 17 | 22 | 23 | -------------------------------------------------------------------------------- /sample/testUseAttribute.xsl: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /sample/theme-demo.xsl: -------------------------------------------------------------------------------- 1 | 2 | 4 | ]> 5 | 6 | 9 | 10 | 11 | 28 ?> 12 | 13 | 23 | 24 | 25 | 26 | 27 | 28 |

{$result}

29 | text value templates {count($result)} need special attention {$cities?uk} 30 | 31 | cdata ' || $q < 58.7} ]]> 32 | 33 |
34 | text nodes cdata tags]]> 35 | entity references <need> special care 36 |
37 | 38 | 39 |
40 | 41 |
42 | 43 | -------------------------------------------------------------------------------- /sample/token-name.xsl: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /sample/tvt-cdata.xsl: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | before the CDATA 14 | {for $n in 1 to $max return $nx || ','} 16 | {225 + $max} 17 | ]]> this is not wihin CDATA 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /sample/typed.xsl: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /sample/types.xsl: -------------------------------------------------------------------------------- 1 | 2 | " 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /sample/unused-avt-variable.xsl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /sample/unused-avt-variable2.xsl: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /sample/unused-xpath-variables.xsl: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 20 | 21 | 22 | this {$var1} is going ok {$var1} 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /sample/unused-xslt-variables.xsl: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 20 | 21 | this is better 22 | 23 | 24 | 25 | 26 | abcd 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /sample/valid-bug.xsl: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /sample/var-error3.xsl: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /sample/variable-error.xsl: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /sample/variable-error2.xsl: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /sample/w3functions.xsl: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /sample/xml-stylesheet.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /sample/xpath-comment.xsl: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /sample/xslt-out/result1.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/codeActionDocument.ts: -------------------------------------------------------------------------------- 1 | import { TLSSocket } from 'tls'; 2 | import * as vscode from 'vscode'; 3 | import { CodeActionTextLine } from './codeActionTextLine'; 4 | 5 | export class CodeActionDocument implements vscode.TextDocument { 6 | uri: vscode.Uri; 7 | fileName: string; 8 | isUntitled: boolean = true; 9 | languageId: string = "xslt"; 10 | version: number = 1; 11 | isDirty: boolean = false; 12 | isClosed: boolean = false; 13 | private static wsRegex = new RegExp(/(^\s+)/); 14 | docText: string; 15 | private textLines: string[]; 16 | 17 | constructor(uri: vscode.Uri, text: string) { 18 | this.docText = text; 19 | this.uri = uri; 20 | this.fileName = uri.fsPath; 21 | this.textLines = text.split('\n'); 22 | } 23 | 24 | save(): Thenable { 25 | throw new Error('Method not implemented.'); 26 | } 27 | eol: vscode.EndOfLine = vscode.EndOfLine.LF; 28 | lineCount: number = 1; 29 | lineAt(line: number): vscode.TextLine; 30 | lineAt(position: vscode.Position): vscode.TextLine; 31 | lineAt(line: any): vscode.TextLine { 32 | if (line.line) { 33 | throw new Error('Method not implemented.'); 34 | } else { 35 | const lineNum = line; 36 | return this.getLineData(lineNum); 37 | } 38 | } 39 | offsetAt(position: vscode.Position): number { 40 | throw new Error('Method not implemented.'); 41 | } 42 | positionAt(offset: number): vscode.Position { 43 | throw new Error('Method not implemented.'); 44 | } 45 | getText(range?: vscode.Range | undefined): string { 46 | if (range) { 47 | const lineText = this.textLines[range.start.line]; 48 | return lineText.substring(range.start.character, range.end.character); 49 | } else { 50 | return this.docText; 51 | } 52 | } 53 | getWordRangeAtPosition(position: vscode.Position, regex?: RegExp | undefined): vscode.Range | undefined { 54 | throw new Error('Method not implemented.'); 55 | } 56 | validateRange(range: vscode.Range): vscode.Range { 57 | throw new Error('Method not implemented.'); 58 | } 59 | validatePosition(position: vscode.Position): vscode.Position { 60 | throw new Error('Method not implemented.'); 61 | } 62 | 63 | private getLineData(findLine: number) { 64 | const lineText = this.textLines[findLine]; 65 | const wsLeadMatches = lineText.match(CodeActionDocument.wsRegex); 66 | let nonSpaceNum = 0; 67 | if (wsLeadMatches) { 68 | nonSpaceNum = wsLeadMatches[0].length; 69 | } 70 | return new CodeActionTextLine(lineText, nonSpaceNum); 71 | } 72 | 73 | } -------------------------------------------------------------------------------- /src/codeActionTextLine.ts: -------------------------------------------------------------------------------- 1 | import * as vscode from 'vscode'; 2 | 3 | export class CodeActionTextLine implements vscode.TextLine { 4 | lineNumber: number = 1; 5 | text: string; 6 | range: vscode.Range; 7 | rangeIncludingLineBreak: vscode.Range; 8 | firstNonWhitespaceCharacterIndex: number = 1; 9 | isEmptyOrWhitespace: boolean = false; 10 | 11 | constructor(text: string, leadingSpaces: number) { 12 | this.text = text; 13 | let startPos = new vscode.Position(0,0); 14 | let endPos = new vscode.Position(0,0); 15 | let lineRange = new vscode.Range(startPos, endPos); 16 | this.range = lineRange; 17 | this.rangeIncludingLineBreak = lineRange; 18 | this.firstNonWhitespaceCharacterIndex = leadingSpaces; 19 | } 20 | 21 | } -------------------------------------------------------------------------------- /src/dcpSnippets.ts: -------------------------------------------------------------------------------- 1 | import { Snippet} from './xsltSnippets'; 2 | 3 | export class DCPSnippets { 4 | static xsltRootTags: Snippet[] = [{ 5 | name: 'Side-by-side diff report', 6 | description: 'DCP to generate a side-by-side diffreport', 7 | body: 8 | `?xml version="1.0" encoding="UTF-8"?> 9 | 12 | 13 | \t 14 | \t\t\$0 15 | \t\t 16 | \t\t 17 | \t 18 | 19 | \t 20 | \t\t 21 | \t\t\t 22 | \t\t\t\t 23 | \t\t\t\t 24 | \t\t\t\t 25 | \t\t\t 26 | \t\t\t 27 | \t\t\t\t 28 | \t\t\t\t\t 29 | \t\t\t\t\t\t 30 | \t\t\t\t\t 31 | \t\t\t\t 32 | \t\t\t 33 | \t\t 34 | \t\t 35 | \t\t\t 36 | \t\t 37 | \t\t 38 | \t\t\t 39 | \t\t\t 40 | \t\t 41 | \t 42 | 43 | \t 44 | \t\t 45 | \t\t\t 47 | \t\t 48 | \t 49 | 50 | \t 51 | \t\t 52 | \t\t\t 53 | \t\t\t\t 54 | \t\t\t\t 55 | \t\t\t 56 | \t\t 57 | 58 | \t\t 59 | \t\t\t 60 | \t\t\t\t 61 | \t\t\t\t\t 62 | \t\t\t\t\t 63 | \t\t\t\t 64 | \t\t\t 65 | \t\t\t 66 | \t\t\t\t 67 | \t\t\t\t\t 68 | \t\t\t\t 69 | \t\t\t 70 | \t\t 71 | \t 72 | ` 73 | }, 74 | { 75 | name: 'Standard Configuration DCP', 76 | description: 'DCP structure with basic configuration', 77 | body: 78 | `?xml version="1.0" encoding="UTF-8"?> 79 | 82 | 83 | \t 84 | 85 | \t\t 86 | \t\t\t 87 | \t\t\t\t 88 | \t\t\t 89 | \t\t\t 90 | \t\t\t\t 91 | \t\t\t\t\t 92 | \t\t\t\t\t\t 93 | \t\t\t\t\t 94 | \t\t\t\t 95 | \t\t\t 96 | \t\t 97 | 98 | \t\t 99 | \t\t\t 100 | \t\t\t 101 | \t\t 102 | 103 | \t 104 | 105 | \t$0 106 | 107 | ` 108 | } 109 | ]; 110 | } -------------------------------------------------------------------------------- /src/dcpSymbolProvider.ts: -------------------------------------------------------------------------------- 1 | import * as vscode from 'vscode'; 2 | import { XslLexer, LanguageConfiguration, DocumentTypes, GlobalInstructionType, GlobalInstructionData } from './xslLexer'; 3 | import { XsltTokenDiagnostics } from './xsltTokenDiagnostics'; 4 | import { GlobalsProvider} from './globalsProvider'; 5 | import * as path from 'path'; 6 | 7 | export class DCPSymbolProvider implements vscode.DocumentSymbolProvider { 8 | 9 | private readonly xslLexer: XslLexer; 10 | private readonly collection: vscode.DiagnosticCollection; 11 | private docType: DocumentTypes; 12 | private readonly languageConfig: LanguageConfiguration; 13 | 14 | 15 | public constructor(xsltConfiguration: LanguageConfiguration, collection: vscode.DiagnosticCollection) { 16 | this.xslLexer = new XslLexer(xsltConfiguration); 17 | this.xslLexer.provideCharLevelState = true; 18 | this.collection = collection; 19 | this.languageConfig = xsltConfiguration; 20 | this.docType = xsltConfiguration.docType; 21 | } 22 | 23 | public async provideDocumentSymbols(document: vscode.TextDocument, token: vscode.CancellationToken): Promise { 24 | const allTokens = this.xslLexer.analyse(document.getText()); 25 | let globals = this.xslLexer.globalInstructionData; 26 | 27 | async function returnBadFileLinks(item: GlobalInstructionData): Promise { 28 | const basePath = path.dirname(document.fileName); 29 | const resolvedPath = path.resolve(basePath, item.name); 30 | let fileExists = await GlobalsProvider.fileExists(resolvedPath); 31 | if (fileExists) { 32 | return undefined; 33 | } else { 34 | return item; 35 | } 36 | } 37 | 38 | let fileChecks: Promise[] = []; 39 | globals.forEach((item) => { 40 | if (item.type === GlobalInstructionType.Import || item.type === GlobalInstructionType.Include) { 41 | fileChecks.push(returnBadFileLinks(item)); 42 | } 43 | }); 44 | let errorFileRefs = await Promise.all(fileChecks); 45 | 46 | return new Promise((resolve, reject) => { 47 | let symbols: vscode.DocumentSymbol[] = []; 48 | let diagnostics = XsltTokenDiagnostics.calculateDiagnostics(this.languageConfig, this.docType, document, allTokens, [], [], symbols); 49 | let importDiagnostics: vscode.Diagnostic[] = []; 50 | errorFileRefs.forEach((fileRef) => { 51 | if (fileRef) { 52 | importDiagnostics.push(XsltTokenDiagnostics.createImportDiagnostic(fileRef)); 53 | } 54 | }); 55 | let allDiagnostics = importDiagnostics.concat(diagnostics); 56 | if (allDiagnostics.length > 0) { 57 | this.collection.set(document.uri, allDiagnostics); 58 | } else { 59 | this.collection.clear(); 60 | } 61 | resolve(symbols); 62 | }); 63 | 64 | } 65 | 66 | } -------------------------------------------------------------------------------- /src/documentLinkProvider.ts: -------------------------------------------------------------------------------- 1 | // tslint:disable 2 | import { XslLexerLight } from "./xslLexerLight"; 3 | import { GlobalInstructionData, GlobalInstructionType } from "./xslLexer"; 4 | import * as vscode from "vscode"; 5 | import { LanguageConfiguration } from "./xslLexer"; 6 | import * as path from 'path'; 7 | import { XsltPackage, XsltSymbolProvider } from './xsltSymbolProvider'; 8 | import * as url from 'url'; 9 | 10 | 11 | export class DocumentLinkProvider implements vscode.DocumentLinkProvider { 12 | 13 | private lexer: XslLexerLight; 14 | 15 | constructor(languageConfig: LanguageConfiguration) { 16 | this.lexer = new XslLexerLight(languageConfig); 17 | } 18 | 19 | provideDocumentLinks(document: vscode.TextDocument, token: vscode.CancellationToken): vscode.DocumentLink[] { 20 | let data: GlobalInstructionData[] = this.lexer.analyseLight(document.getText()); 21 | let result: vscode.DocumentLink[] = []; 22 | const xsltPackages: XsltPackage[] = vscode.workspace.getConfiguration('XSLT.resources').get('xsltPackages'); 23 | const rootPath = vscode.workspace.rootPath; 24 | 25 | 26 | data.forEach((instruction) => { 27 | if (instruction.type === GlobalInstructionType.Import || instruction.type === GlobalInstructionType.Include) { 28 | const resolvedPath = XsltSymbolProvider.resolvePath(instruction.name, document.fileName); 29 | const pathForUri = resolvedPath.startsWith('file:/') ? resolvedPath : url.pathToFileURL(resolvedPath).toString(); 30 | const uri = vscode.Uri.parse(pathForUri); 31 | const startPos = new vscode.Position(instruction.token.line, instruction.token.startCharacter); 32 | const endPos = new vscode.Position(instruction.token.line, instruction.token.startCharacter + (instruction.token.length + 2)); 33 | const link = new vscode.DocumentLink(new vscode.Range(startPos, endPos), uri); 34 | result.push(link); 35 | } else if (instruction.type === GlobalInstructionType.UsePackage) { 36 | let packageLookup = xsltPackages.find((pkg) => { 37 | return pkg.name === instruction.name; 38 | }); 39 | if (packageLookup && rootPath) { 40 | let resolvedName = XsltSymbolProvider.resolvePathInSettings(packageLookup.path, rootPath); 41 | const pathForUri = resolvedName.startsWith('file:/') ? resolvedName : url.pathToFileURL(resolvedName).toString(); 42 | 43 | const uri = vscode.Uri.parse(pathForUri); 44 | const startPos = new vscode.Position(instruction.token.line, instruction.token.startCharacter); 45 | const endPos = new vscode.Position(instruction.token.line, instruction.token.startCharacter + (instruction.token.length + 2)); 46 | const link = new vscode.DocumentLink(new vscode.Range(startPos, endPos), uri); 47 | result.push(link); 48 | } 49 | } 50 | }); 51 | return result; 52 | } 53 | 54 | } 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /src/fullDocumentLinkProvider.ts: -------------------------------------------------------------------------------- 1 | // tslint:disable 2 | import { GlobalInstructionData, GlobalInstructionType } from "./xslLexer"; 3 | import * as vscode from "vscode"; 4 | import { LanguageConfiguration, XslLexer} from "./xslLexer"; 5 | import * as path from 'path'; 6 | 7 | export class FullDocumentLinkProvider implements vscode.DocumentLinkProvider { 8 | 9 | private lexer: XslLexer; 10 | 11 | constructor(languageConfig: LanguageConfiguration) { 12 | this.lexer = new XslLexer(languageConfig); 13 | } 14 | 15 | provideDocumentLinks(document: vscode.TextDocument, token: vscode.CancellationToken): vscode.DocumentLink[] { 16 | this.lexer.analyse(document.getText()); 17 | this.lexer.globalInstructionData; 18 | let data: GlobalInstructionData[] = this.lexer.globalInstructionData; 19 | 20 | let result: vscode.DocumentLink[] = []; 21 | data.forEach((instruction) => { 22 | if (instruction.type === GlobalInstructionType.Import || instruction.type === GlobalInstructionType.Include) { 23 | const basePath = path.dirname(document.fileName); 24 | const resolvedPath = path.resolve(basePath, instruction.name); 25 | const uri = vscode.Uri.parse(resolvedPath); 26 | const startPos = new vscode.Position(instruction.token.line, instruction.token.startCharacter); 27 | const endPos = new vscode.Position(instruction.token.line, instruction.token.startCharacter + (instruction.token.length + 2)); 28 | const link = new vscode.DocumentLink(new vscode.Range(startPos, endPos), uri); 29 | result.push(link); 30 | } 31 | }); 32 | return result; 33 | } 34 | 35 | } 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /src/globalsProvider.ts: -------------------------------------------------------------------------------- 1 | // tslint:disable 2 | import { XslLexerLight } from "./xslLexerLight"; 3 | import * as vscode from 'vscode'; 4 | import {XSLTLightConfiguration} from './languageConfigurations'; 5 | import { GlobalInstructionData } from "./xslLexer"; 6 | import * as fs from 'fs'; 7 | 8 | export interface GlobalImportData { 9 | data: GlobalInstructionData[]; 10 | error: boolean; 11 | } 12 | 13 | export class GlobalsProvider { 14 | 15 | public static async provideGlobals(href: string): Promise { 16 | let lexer = new XslLexerLight(XSLTLightConfiguration.configuration); 17 | let data: GlobalInstructionData[] = []; 18 | 19 | if (href.length === 0) { 20 | return {data: data, error: true}; 21 | } 22 | 23 | try { 24 | // TODO: USE VSCODE API (but it needs a URI not a filepath) e.g. 25 | //const t = vscode.workspace.fs.readFile 26 | const text = fs.readFileSync(href).toString('utf-8'); 27 | data = lexer.analyseLight(text); 28 | return {data: data, error: false}; 29 | } catch (e) { 30 | return {data: data, error: true}; 31 | } 32 | } 33 | 34 | public static fileExists(file: string): Promise { 35 | return new Promise((resolve, _reject) => { 36 | fs.exists(file, (exists) => { 37 | if (exists) { 38 | fs.stat(file, (err, stats) => { 39 | resolve(stats.isFile()); 40 | }); 41 | } else { 42 | resolve(exists); 43 | } 44 | }); 45 | }); 46 | } 47 | } -------------------------------------------------------------------------------- /src/xmlSnippets.ts: -------------------------------------------------------------------------------- 1 | import { Snippet} from './xsltSnippets'; 2 | 3 | export class XMLSnippets { 4 | static xsltRootTags: Snippet[] = [ 5 | { 6 | name: 'XML Root Element Snippet', 7 | description: 'Basic XML Template', 8 | body: 9 | `?xml version="1.0" encoding="UTF-8"?> 10 | <\${1:element} \${2:attribute}="\${3:value}"> 11 | 12 | \t<\${4:childElement}> 13 | \t\t$0 14 | \t 15 | 16 | ` 17 | } 18 | ]; 19 | static generalTags: Snippet[] = [ 20 | { 21 | name: 'block-start-end-tag-with', 22 | description: 'with attribute', 23 | body: 24 | `\${1:element} \${2:attribute}="\${3:value}"> 25 | \t\$0 26 | ` 27 | }, 28 | { 29 | name: 'inline-start-end-tag-with', 30 | description: 'with attribute', 31 | body: 32 | `\${1:element} \${2:attribute}="\${3:value}">\${4:text}$0` 33 | }, 34 | { 35 | name: 'self-closed-tag-with', 36 | description: 'with attribute', 37 | body: 38 | `\${1:element} \${2:attribute}="\${3:value}"\$0/>` 39 | }, 40 | { 41 | name: 'block-start-end-tag', 42 | description: 'no attribute', 43 | body: 44 | `\${1:element}> 45 | \t\$0 46 | ` 47 | }, 48 | { 49 | name: 'inline-start-end-tag', 50 | description: 'no attribute', 51 | body: 52 | `\${1:element}>\${2:text}$0` 53 | }, 54 | { 55 | name: 'self-closed-tag', 56 | description: 'no attribute', 57 | body: 58 | `\${1:element}$0/>` 59 | } 60 | ]; 61 | static generalAttributes: Snippet[] = [ 62 | { 63 | name: 'attribute', 64 | description: 'attribute name="value"', 65 | body: `\${1:name}="\${2:value}"$0` 66 | } 67 | ]; 68 | } -------------------------------------------------------------------------------- /src/xpLexerRun.ts: -------------------------------------------------------------------------------- 1 | // tslint:disable 2 | import { XPathLexer, Token, TokenLevelState, ExitCondition, LexPosition } from "./xpLexer"; 3 | import { Debug } from "./diagnostics"; 4 | 5 | // ------------- 6 | let testXpath: string = 7 | `let $ac := function($a) as function(*) {function($b) {$b + 1}} return $a`; 8 | let testTitle = `declaration`; 9 | let generateTest = true; 10 | let timerOnly = false; 11 | // ============= 12 | 13 | generateTest = timerOnly? false: generateTest; 14 | let debugOn; 15 | if (timerOnly) { 16 | debugOn = false; 17 | testXpath = testXpath.repeat(5000); 18 | } else { 19 | debugOn = !generateTest; 20 | } 21 | 22 | let lexer: XPathLexer = new XPathLexer(); 23 | lexer.debug = debugOn; 24 | lexer.timerOn = timerOnly; 25 | let pos: LexPosition = {line: 0, startCharacter: 0, documentOffset: 0}; 26 | let tokens: Token[] = lexer.analyse(testXpath, ExitCondition.CurlyBrace, pos); 27 | 28 | 29 | if (generateTest) { 30 | Debug.printMinSerializedTokens(testTitle, testXpath, tokens); 31 | } else if (timerOnly) { 32 | console.log("XPath length: " + testXpath.length); 33 | console.log("Token Count:" + tokens.length); 34 | } else { 35 | console.log('---------------'); 36 | console.log(testXpath); 37 | console.log('---------------'); 38 | Debug.printResultTokens(tokens); 39 | console.log('==============='); 40 | Debug.printTokenValues(testXpath, tokens); 41 | } 42 | 43 | -------------------------------------------------------------------------------- /src/xpathDocumentChangeHandler.ts: -------------------------------------------------------------------------------- 1 | import * as vscode from 'vscode'; 2 | import { Data } from './xpLexer'; 3 | 4 | export class XPathDocumentChangeHandler { 5 | public async onDocumentChange(e: vscode.TextDocumentChangeEvent) { 6 | let activeChange = e.contentChanges[0]; 7 | if (!activeChange) { 8 | return; 9 | } 10 | let doTrigger = false; 11 | const docText = e.document.getText(); 12 | 13 | let precededByWS = false; 14 | let followsSeparator = false; 15 | const pos = activeChange.rangeOffset - 1; 16 | let wsEndPos = -1; 17 | let keywordPos = -1; 18 | let keyword: string | undefined; 19 | let separatorChar: string|undefined; 20 | 21 | const char = activeChange.text; 22 | let charIsWs = (char === ' ' || char === '\t' || char === '\n'); 23 | 24 | for (let x = pos; x > -1; x--) { 25 | const char = docText.charAt(x); 26 | if (char === ' ' || char === '\t' || char === '\n') { 27 | precededByWS = true; 28 | if (keywordPos !== -1) { 29 | break; 30 | } 31 | } else if (Data.anySeps.indexOf(char) !== -1) { 32 | followsSeparator = true; 33 | separatorChar = char; 34 | break; 35 | } else if (charIsWs) { 36 | if (wsEndPos === -1) { 37 | wsEndPos = x + 1; 38 | } 39 | keywordPos = x; 40 | } else { 41 | break; 42 | } 43 | } 44 | keyword = keywordPos !== -1 ? docText.substring(keywordPos, (wsEndPos)) : undefined; 45 | 46 | if (charIsWs) { 47 | doTrigger = followsSeparator || (keyword !== undefined && Data.triggerWords.indexOf(keyword) !== -1); 48 | } else if (char === '$' || char === '/' || char === '[' || char === '?' || char === '@') { 49 | doTrigger = true; 50 | } else if (followsSeparator && (char === ':' && separatorChar === ':')) { 51 | doTrigger = true; 52 | } else { 53 | doTrigger = precededByWS && followsSeparator; 54 | } 55 | 56 | //console.log('doTrigger', doTrigger); 57 | 58 | if (doTrigger) { 59 | setTimeout(() => { 60 | vscode.commands.executeCommand('editor.action.triggerSuggest'); 61 | }, 10); 62 | return; 63 | } 64 | } 65 | } -------------------------------------------------------------------------------- /src/xslLexerRun.ts: -------------------------------------------------------------------------------- 1 | // tslint:disable 2 | import { BaseToken } from "./xpLexer"; 3 | import { XslLexer } from "./xslLexer"; 4 | import { Debug } from "./diagnostics"; 5 | import {XSLTConfiguration} from './languageConfigurations'; 6 | 7 | 8 | // ------------- 9 | let testXslt: string = 10 | ``; 11 | let testTitle = `declaration`; 12 | let generateTest = false; 13 | let timerOnly = false; 14 | // ============= 15 | 16 | generateTest = timerOnly? false: generateTest; 17 | let debugOn; 18 | if (timerOnly) { 19 | debugOn = false; 20 | testXslt = testXslt.repeat(5000); 21 | } else { 22 | debugOn = !generateTest; 23 | } 24 | 25 | let lexer = new XslLexer(XSLTConfiguration.configuration); 26 | 27 | lexer.debug = debugOn; 28 | lexer.timerOn = timerOnly; 29 | 30 | let tokens: BaseToken[] = lexer.analyse(testXslt); 31 | Debug.printTokenValues(testXslt, tokens); 32 | 33 | -------------------------------------------------------------------------------- /src/xsltHoverProvider.ts: -------------------------------------------------------------------------------- 1 | import { CancellationToken, Hover, HoverProvider, MarkdownString, Position, ProviderResult, TextDocument } from "vscode"; 2 | import { XPathFunctionDetails } from "./xpathFunctionDetails"; 3 | 4 | enum CharType { 5 | none, 6 | alphaNumeric, 7 | whitespace, 8 | openBracket, 9 | colon, 10 | other 11 | } 12 | 13 | export class XSLTHoverProvider implements HoverProvider { 14 | 15 | private functionData = XPathFunctionDetails.dataPlusIxslPlus40; 16 | 17 | provideHover(document: TextDocument, position: Position, token: CancellationToken): ProviderResult { 18 | const line = document.lineAt(position.line); 19 | let fnName = this.getFunctionName(line.text, position.character); 20 | 21 | if (fnName) { 22 | fnName = fnName.startsWith('fn:')? fnName.substring(3) : fnName; 23 | const trimmedFnName = fnName.trimRight(); 24 | const matchingData = this.functionData.find((item) => { 25 | return item.name === trimmedFnName; 26 | }); 27 | 28 | if (matchingData) { 29 | return this.createHover(matchingData.signature, matchingData.description); 30 | } 31 | } 32 | 33 | //return this.createHover('analyze\u2011string( input as xs:string?, pattern as xs:string, flags as xs:string ) as element(fn:analyze-string-result)', '*Something* is going to happen now'); 34 | } 35 | 36 | private createHover(signature: string, description: string) { 37 | return new Hover(new MarkdownString().appendCodeblock(signature, 'ts').appendMarkdown('\n' + description)); 38 | } 39 | 40 | private getFunctionName(line: string, char: number) { 41 | // track forwards to get end of potential function name 42 | let endChar = char; 43 | let findFirstEndSpace = true; 44 | let charType = CharType.none; 45 | 46 | while (endChar < line.length) { 47 | charType = this.classifyCharAtPos(line, endChar); 48 | if (charType !== CharType.alphaNumeric) { 49 | if (charType === CharType.colon) { 50 | // 51 | } else if (findFirstEndSpace) { 52 | if (charType === CharType.whitespace) { 53 | findFirstEndSpace = false; 54 | } else { 55 | break; 56 | } 57 | } else { 58 | if (charType !== CharType.whitespace) { 59 | break; 60 | } 61 | } 62 | } else { 63 | // is alphaNumeric 64 | if (!findFirstEndSpace) { 65 | break; 66 | } 67 | } 68 | endChar++; 69 | } 70 | 71 | if (charType !== CharType.openBracket) { 72 | return null; 73 | } 74 | 75 | let startChar = char -1; 76 | let findFirstStartColon = true; 77 | 78 | while (startChar > -1) { 79 | charType = this.classifyCharAtPos(line, startChar); 80 | if (charType !== CharType.alphaNumeric) { 81 | if (findFirstStartColon) { 82 | if (charType === CharType.colon) { 83 | findFirstStartColon = false; 84 | } else { 85 | break; 86 | } 87 | } else { 88 | break; 89 | } 90 | } 91 | startChar--; 92 | } 93 | 94 | startChar++; 95 | 96 | const result = line.substring(startChar, endChar); 97 | return result; 98 | 99 | } 100 | 101 | 102 | 103 | classifyCharAtPos(line: string, charPos: number) { 104 | const CHAR_CODE_A = 65; 105 | const CHAR_CODE_Z = 90; 106 | const CHAR_CODE_AS = 97; 107 | const CHAR_CODE_ZS = 122; 108 | const CHAR_CODE_0 = 48; 109 | const CHAR_CODE_9 = 57; 110 | const CHAR_CODE_DASH = 45; 111 | const CHAR_CODE_UNDERSCORE = 95; 112 | 113 | let code = line.charCodeAt(charPos); 114 | 115 | if (code === 9 || code === 10 || code === 12 || code === 32 ) { 116 | return CharType.whitespace; 117 | } else if (code === 35 || code === 40) { 118 | // the '#' char or '(' char 119 | return CharType.openBracket; 120 | } else if (code === 58) { 121 | return CharType.colon; 122 | } else { 123 | const isAlphaNumeric = ( 124 | (code >= CHAR_CODE_A && code <= CHAR_CODE_Z) || 125 | (code >= CHAR_CODE_AS && code <= CHAR_CODE_ZS) || 126 | (code >= CHAR_CODE_0 && code <= CHAR_CODE_9) || 127 | (code === CHAR_CODE_DASH || code === CHAR_CODE_UNDERSCORE ) 128 | ); 129 | const result = isAlphaNumeric? CharType.alphaNumeric : CharType.other; 130 | return result; 131 | } 132 | 133 | 134 | 135 | 136 | } 137 | 138 | } -------------------------------------------------------------------------------- /test/input.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /test/test.xsl: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "es6", 5 | "outDir": "out", 6 | "sourceMap": true, 7 | "rootDir": ".", 8 | "strict": true 9 | }, 10 | "include": ["src", "__tests__"], 11 | "exclude": ["node_modules", ".vscode-test"] 12 | } 13 | -------------------------------------------------------------------------------- /tslint-to-eslint-config.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeltaXML/vscode-xslt-tokenizer/bab18c3e75639a1dcb50affca97dd15d0158ab36/tslint-to-eslint-config.log -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "indent": [false, "tabs"], 4 | "semicolon": [true, "always"] 5 | } 6 | } -------------------------------------------------------------------------------- /vscode-xslt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeltaXML/vscode-xslt-tokenizer/bab18c3e75639a1dcb50affca97dd15d0158ab36/vscode-xslt.png -------------------------------------------------------------------------------- /xml-sample.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /xpath-notebook-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeltaXML/vscode-xslt-tokenizer/bab18c3e75639a1dcb50affca97dd15d0158ab36/xpath-notebook-small.png -------------------------------------------------------------------------------- /xpathSnippets.json: -------------------------------------------------------------------------------- 1 | { 2 | "xsl:variable": { 3 | "prefix": ["xp-for-range"], 4 | "body": [ 5 | "for \\$${1:name} in ${2:foo/bar} return ${3:\\$$1}" 6 | ], 7 | "description": "xpath for $var" 8 | } 9 | } -------------------------------------------------------------------------------- /xsl-language-configuration.json: -------------------------------------------------------------------------------- 1 | { 2 | "comments": { 3 | "blockComment": [ "" ] 4 | }, 5 | "brackets": [ 6 | ["{", "}"], 7 | ["[", "]"], 8 | ["(", ")"] 9 | ], 10 | "autoClosingPairs": [ 11 | { "open": "{", "close": "}" }, 12 | { "open": "[", "close": "]" }, 13 | { "open": "(", "close": ")" }, 14 | { "open": "'", "close": "'", "notIn": ["string", "comment"] }, 15 | { "open": "\"", "close": "\"", "notIn": ["string"] }, 16 | { "open": "&", "close": ";"}, 17 | { "open": "(:", "close": ":", "notIn": ["string"] } // close not :) due to conflict with '(', ')' pair 18 | ], 19 | "autoCloseBefore": "\";:.,=}])>` \n\t", 20 | "surroundingPairs": [ 21 | ["{", "}"], 22 | ["[", "]"], 23 | ["(", ")"], 24 | ["'", "'"], 25 | ["&", ";"], 26 | ["\"", "\""] 27 | ], 28 | "folding": { 29 | "markers": { 30 | "start": "^\\s*<\\?region\\s*.*\\?>", 31 | "end": "^\\s*<\\?endregion\\s*.*\\?>" 32 | } 33 | }, 34 | "wordPattern": "(-?\\d*\\.\\d\\w*)(:_?\\d*\\.\\d\\w*)?|([^\\[\\!\\(\\/\\`\\~\\#\\%\\^\\&\\*\\:\\)\\-\\=\\+\\{\\]\\}\\\\\\|\\;\\'\\\"\\,\\<\\>\\?\\s]+)" 35 | } -------------------------------------------------------------------------------- /xslt-public-snippets.json: -------------------------------------------------------------------------------- 1 | { 2 | "xsl:if": { 3 | "prefix": "xsl:if", 4 | "body": [ 5 | "\t\t", 6 | "$TM_SELECTED_TEXT", 7 | "\t\t", 8 | "$0" 9 | ], 10 | "description": "Surround with xsl:if" 11 | }, 12 | "xsl:for-each": { 13 | "prefix": "xsl:for-each", 14 | "body": [ 15 | "\t\t", 16 | "$TM_SELECTED_TEXT", 17 | "\t\t", 18 | "$0" 19 | ], 20 | "description": "Surround with xsl:for-each" 21 | }, 22 | "xsl:choose": { 23 | "prefix": "xsl:choose", 24 | "body": [ 25 | "\t\t", 26 | "\t\t\t", 27 | "\t$TM_SELECTED_TEXT", 28 | "\t\t\t", 29 | "\t\t\t", 30 | "$2", 31 | "\t\t\t", 32 | "\t\t", 33 | "$0" 34 | ], 35 | "description": "Surround with xsl:choose" 36 | } 37 | } -------------------------------------------------------------------------------- /xslt-resources/deltaxml-saxon-perf-1.0-SAXON10.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeltaXML/vscode-xslt-tokenizer/bab18c3e75639a1dcb50affca97dd15d0158ab36/xslt-resources/deltaxml-saxon-perf-1.0-SAXON10.jar -------------------------------------------------------------------------------- /xslt-resources/deltaxml-saxon-perf-1.0-SAXON11.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeltaXML/vscode-xslt-tokenizer/bab18c3e75639a1dcb50affca97dd15d0158ab36/xslt-resources/deltaxml-saxon-perf-1.0-SAXON11.jar -------------------------------------------------------------------------------- /xslt-resources/deltaxml-saxon-perf-1.0-SAXON12.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeltaXML/vscode-xslt-tokenizer/bab18c3e75639a1dcb50affca97dd15d0158ab36/xslt-resources/deltaxml-saxon-perf-1.0-SAXON12.jar -------------------------------------------------------------------------------- /xslt-resources/deltaxml-saxon-perf-1.0-SAXON99.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeltaXML/vscode-xslt-tokenizer/bab18c3e75639a1dcb50affca97dd15d0158ab36/xslt-resources/deltaxml-saxon-perf-1.0-SAXON99.jar -------------------------------------------------------------------------------- /xslt-resources/xpath-result-serializer/color-data-empty.xsl: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 85 | 86 | -------------------------------------------------------------------------------- /xslt-resources/xpath-result-serializer/xpath-result-serializer-color.xsl: -------------------------------------------------------------------------------- 1 | 2 | 5 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /xslt-tasks-file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeltaXML/vscode-xslt-tokenizer/bab18c3e75639a1dcb50affca97dd15d0158ab36/xslt-tasks-file.png -------------------------------------------------------------------------------- /xslt-tasks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeltaXML/vscode-xslt-tokenizer/bab18c3e75639a1dcb50affca97dd15d0158ab36/xslt-tasks.png -------------------------------------------------------------------------------- /xslt-xpath.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DeltaXML/vscode-xslt-tokenizer/bab18c3e75639a1dcb50affca97dd15d0158ab36/xslt-xpath.png --------------------------------------------------------------------------------