False positive "Missing include" xslt error in eclipse

I have an xslt file in my eclipse project. The xslt is run using a custom processor, which contains some xslt files as an in-jar resource. The xslt linter does not see those resources, and signals an error.

The offending line in the xslt code:

<xsl:include href="xslt/functions.xslt"/>

The error message:

Missing include: xslt/functions.xslt

I guess that the xslt path for the linter is somehow configureable, but cannot find where and how.

Where and how?

Upvotes: 1

Views: 1022

Answers (2)

Markus Blaurock
Markus Blaurock

Reputation: 26

It is possible with the XML-Catalog-function "Rewrite Entry" and the imports having a prefix which identifies the folder you want to take the import from.

Window > Preferences : XML > XML Catalog > Rewrite Entry

You have to provide a URI key type and the prefix of the href-value. Rewrite it with a "file://xxxx" value and the import gets resolved.

Example:

<xsl:include href="imp://xslt/functions.xslt"/>

catalog-rewrite-entry for eclipse

Entry element:      Rewrite
Start string:       imp://
Rewrite prefix: file:///home/xxx/project/importfolder
Key type:           URI

Upvotes: 1

howlger
howlger

Reputation: 34255

If using the Eclipse XSL Editor (there are also other XSLT editors for Eclipse):

Window > Preferences: XML > XSL > Validation

or on project level:

Project > Properties: Validation > XSLT Validation

Upvotes: 2

Related Questions