| Author |
Message |
|
|
Post subject: cvc-elt.1: Cannot find the location of element 'taglib'
Posted: Apr 14, 2005 - 08:07 AM
|
|
Registered Member


Joined: Feb 07, 2005
Posts: 25
|
|
I have a problem with the following jsp-functions.tld file, which MyEclipse tags with an error.
<?xml version="1.0" encoding="UTF-8" ?>
<taglib xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee web-jsptaglibrary_2_0.xsd"
version="2.0">
<tlib-version>1.0</tlib-version>
<short-name>t1</short-name>
<uri>http://transaxiom.com/axswhsweb/jsp-functions.tld</uri>
<function>
<name>formatNumber</name>
<function-class>
com.transaxiom.axsWHSweb.util.JspFunctions
</function-class>
<function-signature>
java.lang.String formatNumber(java.lang.Double, int, char, int)
</function-signature>
</function>
</taglib>
The error is on "version="2.0*> line
Resin and Tomcat accepts this. The URI is in the known schemas to MyEclipse (from the prefrences).
MyEclipse is version 3.8.4.
If I cannot fix this, how can I make the error go away? |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Apr 14, 2005 - 09:46 AM
|
|
Veteran Member


Joined: Apr 12, 2005
Posts: 8
|
|
|
|
|
 |
|
|
Post subject:
Posted: Apr 14, 2005 - 01:30 PM
|
|
Registered Member


Joined: Feb 07, 2005
Posts: 25
|
|
That thread says that the schema should be publicly accessible, but as far as I can tell it is (see the http etc). Regard elss it seems to me that the error hinted in the thread is that MyEclipse has problems with locally stored TLD's.
This is a rather fresh reinstall of Eclipse+MyEclipse so I am pretty sure that I did not turn knobs. |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Apr 14, 2005 - 02:50 PM
|
|
Registered Member

Joined: Jan 06, 2004
Posts: 23824
|
|
adcworks, thank you for posting you are exactly right, this is the same issue.
acuretra,
If you look really closely at this line:
| Quote: |
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee web-jsptaglibrary_2_0.xsd
|
You see the space between the URL and then the web-jsptaglibrary_2_0.xsd file? The first part of this line is some special XML magic, the 2nd part of this line is the ACTUAL XSD file that is used to validate your TLD file, in this case since you have given no path, the parser is looking in the same dir as your TLD file.
Guys check out this page:
http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JSPTags6.html
Note how the schema location just gives the full public path to the XSD? That's what you should do. |
_________________ Riyad
MyEclipse Support
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Apr 15, 2005 - 09:53 AM
|
|
Registered Member


Joined: Feb 07, 2005
Posts: 25
|
|
I have tried fiddling with the schemaLocation and quite a bit of research indicated to me that the version I presented to you was correct. I recognize the authority of the link given, but still after copy/pasting the declaration in the link (and fixing the broken line), I get the same error.
My file now looks like
<?xml version="1.0" encoding="UTF-8" ?>
<taglib xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"
version="2.0">
<tlib-version>1.0</tlib-version>
<short-name>t1</short-name>
<uri>http://transaxiom.com/axswhsweb/jsp-functions.tld</uri>
<function>
<name>formatNumber</name>
<function-class>
com.transaxiom.axsWHSweb.util.JspFunctions
</function-class>
<function-signature>
java.lang.String formatNumber(java.lang.Double, int, char, int)
</function-signature>
</function>
</taglib>
Could I ask you to put it in a "jsp-functions.tld" file and see what happens? |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Apr 15, 2005 - 08:01 PM
|
|
Registered Member

Joined: Jan 06, 2004
Posts: 23824
|
|
Argg, I typed out the correct answer in my head, then didn't post it. You need two URIs, this is cut-pasted directly from JSTL, this is what it should be:
| Code: |
<taglib xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"
version="2.0">
|
Sorry for the confusion (note the URI first in the location field THEN the actual physical location of the file). |
_________________ Riyad
MyEclipse Support
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Apr 22, 2005 - 08:36 PM
|
|
Registered Member


Joined: Feb 07, 2005
Posts: 25
|
|
Am I correct in assuming that this is a parser problem in MyEclipse? |
|
|
| |
|
|
|
 |
|
|
Post subject:
Posted: Apr 22, 2005 - 08:39 PM
|
|
Registered Member

Joined: Jan 06, 2004
Posts: 23824
|
|
No, what I originally gave you was not a valid <taglib> entry, the 2nd one I gave you was valid and does work. |
_________________ Riyad
MyEclipse Support
|
| |
|
|
|
 |
|
|