False positive "Missing include" xslt error in eclipse - 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?

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

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

Related

Eclipse Language Servers: There is '1' error in 'javaee_7.xsd'

When I try to auto generate the web.xml file while creating a Dynamic Web Project in the Eclipse Enterprise version it shows an error of type "Language Servers". It indicates to this element of the web.xml file as error:
<web-app
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
version="4.0"
>
There is '1' error in 'javaee_7.xsd'.
schema_reference.4: Failed to read schema document 'platform:/plugin/org.eclipse.xsd/cache/www.w3.org/2001/xml.xsd', because 1) could not find the document; 2) the document could not be
read; 3) the root element of the document is not xsd:schema.).
This is a bug in Eclipse which manifested since 2021-03.
It's broken down here: https://github.com/eclipse/lemminx/issues/1042#issuecomment-859778034:
Ok I can reproduce the issue with a fresh Eclipse IDE (the last). I can explain the problem but I don't know how to fix it (for the moment).
When you have "There is '1' error in 'jakartaee_9.xsd'" error, you must open the XSD file (from the cache) and you should see 1 error and 1 warning:
There is a warning:
schema_reference.4: Failed to read schema document 'platform:/plugin/org.eclipse.xsd/cache/www.w3.org/2001/xml.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>. jakartaee_9.xsd /lemminx-cache/https/jakarta.ee/xml/ns/jakartaee line 52 Language Servers
which try to define xml:lang attribute inside xml.xsd file. But here the xml.xsd cannot be retrieved (the warning message) and you have the error:
It tries to download the XSD from platform:/plugin/org.eclipse.xsd/cache/www.w3.org/2001/xml.xsd but platform is specific to Eclipse IDE. In other words when http://www.w3.org/2001/xml.xsd must be resolved, it says that platform:/plugin/org.eclipse.xsd/cache/www.w3.org/2001/xml.xsd is the location of XSD. I don't know who do that?
I have the impression than LemMinx is configured to use XML catalog from WTP:
While waiting for the Eclipse version with the fix (which is indeed not yet released at the time of writing), one work around is disable the LemMinx validation:
#chris21k please note that you can disable LemMinx validation:

Validating issue: Unknown Tag/Undefined attribute name warnings in Eclipe

The following code presents validation issues for me in Eclipse 4.4.2. This is located in a JSP file.
<svg version="1.1" class="..." xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink" x="..." y="..." width="..x" height="..." viewBox="..."
enable-background="..." xml:space="...">
<g>
<polygon fill="#FFFFFF" points="..."></polygon>
<polygon fill="#FFFFFF" points="..."></polygon>
</g>
</svg>
This code produces the following warnings:
"Undefined attribute name (attribute-name)" for every attribute attached to the svg element
"Unknown tag (tag-name)" for the g and polygon tags.
I ran this through an online validator that supports HTML5/SVG1.1, and it told me there were 0 validation issues.
Any ideas why this could be happening? I'm aware that I can choose to ignore the validation issues through Window > Preferences > Validation, but I would prefer to find a way to get Eclipse to actually recognize these tags/attributes because they work just fine.
The namespace http://www.w3.org/2000/svg does not seem to be recognised by your eclipse installation. Try either of:
Adding the namespace to your XML catalog (in Window > Preferences), including the schema for svg, or
Specifying the schema inline, as attributes of the svg element:
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://www.w3.org/TR/2002/WD-SVG11-20020108/SVG.xsd"
(or wherever your local copy of the schema is)

How can I setup compass on netbeans 7.4

There is a feature in netbeans 7.4 that allows scss and less to auto compile on save.
I have managed to set up scss to compile but I am having problems compiling scss files using compass.
Here is an example error:
Syntax error: File to import not found or unreadable: compass/css3.
Load path: /www/site
on line 2 of /www/site/app/View/Themed/Admin/webroot/scss/core.scss
Currently the compass is imported like so:
#import "compass/css3";
Thanks
In NetBeans, click the File > Project Properties menu item.
In the dialog that opens, select the CSS Preprocessors category.
At the bottom of the Sass properties is Compiler options. Enter --compass
That fixed the problem you are asking about for me. However, I then encountered further problems with Compass because it was ignorant of the paths to files. To overcome this I created a config.rb file in the root of my project. This had to define a full project path and directory names. Moreover, working on a Windows machine, it was fussy about the direction of slashes and types of quotes.
project_path = 'c:\path\to\project'
css_dir = "css"
sass_dir = "sass"
images_dir = "images"
javascripts_dir = "js"
Another way that you can add Compass to all SASS projects without adding the argument to each project is by going to Tools > Options > Miscellaneous > CSS Preprocessors and adding " --compass" to the end of the Sass Path.
For example, mine reads "C:\Ruby200-x64\bin\sass.bat --compass".

Linux command line tool validating XSD 1.1?

Is there any command line tool that validates XML against a XSD version 1.1?
Xmllint does not validate version 1.1.
I found a handy wrapper around Xerces-J: https://www.dropbox.com/s/939jv39ihnluem0/xsd11-validator.jar
java -jar xsd11-validator.jar -sf my.xsd -if my.xml
You can update the Xerces-J lib by unzipping the jar, dropping the new Xerces-J in it, then rezipping it to a jar
Reference
Edit: Updated download link
XSD 1.1 is currently supported by Saxon and by Xerces J. Both should run without trouble under Linux.
xmllint unfortunately could not support XML Schema 1.1 but alternatively it supports RelaxNG based Schema (including all the advancements similar to the XML Schema 1.1).
Following is the procedure could be used to overcome xmllint limitations:
implement your validation XML Schema version 1.1 based on Oxygen Editor reverse generator (based on already existing XML files).
it could be downloaded from here with the 1 month license free
resulting XSD 1.1 file will not be accepted by xmllint with the following error messages:
xmllint --schema user.xsd --noout user.xml
user.xsd:565: element element: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}element': Invalid value for maxOccurs (must be 0 or 1).
user.xsd:741: element element: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}element': Invalid value for maxOccurs (must be 0 or 1).
WXS schema user.xsd failed to compile
however the xml schema could be converted into relaxng schema with the help of RNGConv tool which is a part of the Kohsuke Kawaguchi's MSV project by
applying following conversion command:
java -jar rngconv-20060319/rngconv.jar user.xsd > user.rng
resulting relaxng schema file could be used with the xmllint:
xmllint --relaxng user.rng --noout user.xml
user.xml validates
I answered this question over here at AskUbuntu.
It includes working links to the Xerces-J wrapper xsd11-validator.jar and a comfortable bash script for easy usage.

Lint: How to ignore "<key> is not translated in <language>" errors?

I can't compile/debug our Android app, because the localization files are not perfect yet.
My IDE's validation tool Lint create errors saying:
newCardsOrderVals is not translated in ar, bg, ca, cs
Compiling/installing/running with Ant works fine, but I would like to use my IDE to ease debugging.
Is there a way to turn off this particular check, or ideally make it a warning rather than an error?
I understand that before release we will really need to get localisation files right, but for the time being it is not a priority as the screens themselves are being modified very frequently.
Android Studio:
"File" > "Settings" and type "MissingTranslation" into the search box
Eclipse:
Windows/Linux: In "Window" > "Preferences" > "Android" > "Lint Error Checking"
Mac: "Eclipse" > "Preferences" > "Android" > "Lint Error Checking"
Find the MissingTranslation line, and set it to Warning as seen below:
You can set the attribute translatable="false" on the definition like this:
<string name="account_setup_imap" translatable="false">IMAP</string>
For more information: http://tools.android.com/recent/non-translatablestrings
To ignore this in a gradle build add this to the android section of your build file:
lintOptions {
disable 'MissingTranslation'
}
This will cause Lint to ignore the missing translation error for ALL strings in the file, yet other string resource files can be verified if needed.
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools"
tools:ignore="MissingTranslation">
If you want to turn off the warnings about the specific strings, you can use the following:
strings.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!--suppress MissingTranslation -->
<string name="some_string">ignore my translation</string>
...
</resources>
If you want to warn on specific strings instead of an error, you will need to build a custom Lint rule to adjust the severity status for a specific thing.
http://tools.android.com/tips/lint-custom-rules
Insert in the lint.xml file this:
<?xml version="1.0" encoding="UTF-8"?>
<lint>
...
<issue
id="MissingTranslation"
severity="ignore" />
</lint>
For more details: Suppressing Lint Warnings.
add the lines in your /res/values.xml file in resource root tab like this:
<resources
xmlns:tools="http://schemas.android.com/tools"
tools:locale="en" tools:ignore="MissingTranslation">
tools:locale set the local language to English, no need of language translation later on that for all resource strings and tools:ignore let Lint to isnore the missing translations of the resource string values.
Add following to your gradle file in android section
lintOptions {
disable 'MissingTranslation'
}
In addition,
Not project dependent properities, Eclipse Preferences.
In Mac, Eclipse > Preferences
Another approach is to indicate the languages you intend to support and filter out the rest using the 'resConfigs' option with Gradle.
Check out this other answer for details
This is better, I think, because you don't have to completely ignore legitimate translation mistakes for languages you actually want to support
You can also put resources which you do not want to translate to file called donottranslate.xml.
Example and explanation: http://tools.android.com/recent/non-translatablestrings
Many of them has a given a different working answers, and i too got the same lint errors
i make it ignore by doing the following with eclipse.
click on Windows
click on preferences
select android > Lint Error Checking.
click on ignore All > Apply > Ok.
Thats it.
The following worked for me.
Click on Windows
Click on preferences
Select android > Lint Error Checking.
Find and select the relevant Lint checking and
Set the severity to 'Ignore' (on bottom right)