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

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)

Related

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?
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

Gwt project is creating cache.js instead of cache.html.Where this configurations are made

In GWT , I have created two different projects,after compilationone is creating *.cache.html where else other one creating *.cache.js .Please assist why it is happening and where to config thess things.
In your *.gwt.xml file you can add a linker.
The standard linker is the xsiframe, which generates a *.cache.js file.
The std linker generates *.cache.html file.
Change it by editing the value of name in your *gwt.xml file:
<add-linker name="xsiframe" />

The sample of Google Maps Android API v2 com.example.mapdemo can not find file "R.java"

Today I have read the document of Google Maps Android API v2, it said the project of android-sdk\extras\google\google_play_services\samples\maps can run,
but after I imported into eclipse and set the libraries of android-support-v4.jar and google-play-services.jar correctly, import com.example.mapdemo.R; in FeatureView.java (at line 24) can not find the file R.java.
almost all the java file in com.example.mapdemo need class "R", for example, the file BasicMapActivity.java need R in line 41 "setContentView(R.layout.basic_demo);" and line 71 mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)).getMap();"
can someone tell me how to find the class "R"?
R
.java can not create automatically because the file multimap_demo.xml have some errors in
<br><br> <fragment
<br> android:id="#+id/map3"
<br> android:layout_width="match_parent"
<br> android:layout_height="match_parent"
<br> android:layout_weight="0.5"
<br> class="com.google.android.gms.maps.SupportMapFragment"
<br> map:cameraTargetLat="48.85"
<br> map:cameraTargetLng="2.35"
<br> map:cameraZoom="8"/>
<br><br>
eclipse said "cameraTargetLat", "cameraTargetLng" and "cameraZoom" can not recognized.
The error information:
Multiple annotations found at this line:
- error: No resource identifier found for attribute 'cameraTargetLat' in package 'com.example.mapdemo'
- error: No resource identifier found for attribute 'cameraTargetLng' in package 'com.example.mapdemo'
- error: No resource identifier found for attribute 'cameraZoom' in package 'com.example.mapdemo'
I do not know why.
If I change the code like this:
<br><br> <fragment
<br> android:id="#+id/map3"
<br> android:layout_width="match_parent"
<br> android:layout_height="match_parent"
<br> android:layout_weight="0.5"
<br> class="com.google.android.gms.maps.SupportMapFragment"/>
<br><br>
the errors disappeared, but i do not know if it can run.
Copy the maps_attr.xml file from the library project into your project's values folder.
You should also import google-play-services_lib project (/extras/google/google_play_services/libproject/google-play-services_lib) - after that cameraTargetLat and other ones are recognized and R.java is generated.
you should import /extras/google/google_play_services/libproject/google-play-services_lib as a library in your project.
Import an existing android project at /extras/google/google_play_services/libproject/google-play-services_lib, but remember COPYING IT TO WORKSPACE(important, maybe the path of its original place occurs error)
See your project's properties->Android settings and add library "google-play-services"
Remember to add android-support-v4.jar & google-play-services.jar to your External JARs
1, include both external jar to project
2, copy \extras\google\google_play_services\libproject\google-play-services_lib\res\values\maps_attrs.xml to project value folder
3, copy google-play-services_lib to workspace looks no necessary in my test.
Update:
java.lang.NoClassDefFoundError: com.google.android.gms.R$styleable in android
I solved it just adding the following meta-data to the AndroidManifest.xml
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
may be this answer can help someone.
this is due to a silly mistake, both the projects ie. Sample project of Map and Google play service project must reside on the same directory otherwise it will not referenced properly
you need do copy projects into workplace for both the projects or if you don't want to copy, so don't do it for both this is the glitch. if you do it properly then you will find this
you have to include xmlns:map="http://schemas.android.com/apk/res-auto" to your layout xml for using map element.
The R file is autogenerate by Eclipse, and you can find it in gen directory. Don't edit this file ever! In some case, you will find there more than one R file, for example when you add a library to your project, like google-play-services_lib. You always can refere to this file at code like this...
mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(com.your.package.R.id.map)).getMap();
If you want to configure your map, is posible to make it by XML Attributes or Programmatically.

GWT-Youtube-API no source code available for YouTubeEmbeddedPlayer

I tried to embed a Video in my GWT Project but I get the following error in my console when I open the panel containing the video:
No source code is available for type com.google.youtube.client.YouTubeEmbeddedPlayer; did you forget to inherit a required module?
My Build Path for the Project
And this is the example code
YouTubeEmbeddedPlayer youTubeEmbeddedPlayer = new YouTubeEmbeddedPlayer("hqXUKxJiDls");
youTubeEmbeddedPlayer.setWidth("427px");
youTubeEmbeddedPlayer.setHeight("320px");
absolutePanel.add(youTubeEmbeddedPlayer, 200, 30);
project.gwt.xml:
<inherits name="com.google.gdata.YouTubeAPI" />
<inherits name="com.google.youtube.Player" />
I followed the GettingStarted wiki entry but I don't know where to put the settings.xml (it's not explained).
Thank's in advance.
Try adding gwt-youtube-api-1.0.3-sources.jar to your classpath as a standard library instead of adding it as a source attachment for gwt-youtube-api-1.0.3.jar.

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)