Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for XSLT 3.0 xsl:package #21

Open
sergey-s-betke opened this issue Jul 15, 2020 · 10 comments
Open

Add support for XSLT 3.0 xsl:package #21

sergey-s-betke opened this issue Jul 15, 2020 · 10 comments
Assignees

Comments

@sergey-s-betke
Copy link

Example:

	<xsl:use-package name="http://github.com/test-st-petersburg/DocTemplates/tools/xslt/formatter/OO.xslt" package-version="1.5">
		<xsl:accept component="mode" names="f:outline f:inline" visibility="private"/>
	</xsl:use-package>

but using <xsl:apply-templates mode="f:outline" ... /> generate error: "templates for mode not found".

@sergey-s-betke
Copy link
Author

How I can set local path to package for linter? May be, in comment?

@pgfearo pgfearo self-assigned this Jul 15, 2020
@pgfearo
Copy link
Member

pgfearo commented Jul 15, 2020

I believe this error message is coming from the Saxon Processor invoked from an XSLT task, not the linter. The Saxon documentation explains how package names are resolved using a configuration file ‘xsltpackages’ element here.

The location of this Saxon configuration file can be specified in an XSLT task using the ‘configFilename’ property.

@pgfearo
Copy link
Member

pgfearo commented Jul 15, 2020

Looking at the details more closely I realise that it is the linter causing the error message for f:outline. I need to read up on the xsl:use-package instruction more fully to see what is the best way to remedy this issue.

@sergey-s-betke
Copy link
Author

xsl:use-package used @name - is not uri. For Saxon I must previously compile my packages, load, and then compile my xslt.

I think, we need set in config for this extension (in .vscode/settings.json) packages names and file paths.

@pgfearo
Copy link
Member

pgfearo commented Jul 28, 2020

I will add what you suggest as a first option. Longer term I think I may need to add an extension setting that identifies the Saxon configuration file that I believe is used by Saxon to resolve the package names.

@pgfearo
Copy link
Member

pgfearo commented Aug 6, 2020

There is now a VSCode extension setting XSLT.resources.xsltPackages for this purpose.

@sergey-s-betke
Copy link
Author

sergey-s-betke commented Nov 12, 2020

@sergey-s-betke
Copy link
Author

sergey-s-betke commented Nov 12, 2020

And one more suggestion: please add one new setting for specifying directories, where your package will automatically search for XSLT packages, determine their names and versions by root node attributes

@pgfearo
Copy link
Member

pgfearo commented Aug 23, 2022

Apologies, I had missed the last two comments! I will reopen this issue.

@pgfearo pgfearo reopened this Aug 23, 2022
@pgfearo
Copy link
Member

pgfearo commented Aug 24, 2022

But "Go to definition" does not work in XSLT:

Initially, the main goal was to prevent the linter reporting 'undefined' errors for functions, variables etc. defined in another package.

I will look to add 'Goto Definition' (and possibly 'Rename Symbol') support for symbols referenced in the names attribute of 'xsl:acceptandxsl:expose`.

The xsl:override instruction is most likely not fully supported by the VS Code linter so I will need to investigate that also.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants