facebook

cvc-elt.1: Cannot find the location of element ‘taglib’

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #228047 Reply

    acuretra
    Member

    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&#8221;
    xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance&#8221;
    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&gt;

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

    #228050 Reply

    adcworks
    Member
    #228062 Reply

    acuretra
    Member

    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.

    #228070 Reply

    Riyad Kalla
    Member

    adcworks, thank you for posting you are exactly right, this is the same issue.

    acuretra,
    If you look really closely at this line:

    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.

    #228151 Reply

    acuretra
    Member

    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&#8221;
    xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance&#8221;
    xsi:schemaLocation=”http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd&#8221;
    version=”2.0″>

    <tlib-version>1.0</tlib-version>
    <short-name>t1</short-name>
    <uri>http://transaxiom.com/axswhsweb/jsp-functions.tld</uri&gt;

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

    #228182 Reply

    Riyad Kalla
    Member

    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:

    
    <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).

    #228613 Reply

    acuretra
    Member

    Am I correct in assuming that this is a parser problem in MyEclipse?

    #228615 Reply

    Riyad Kalla
    Member

    No, what I originally gave you was not a valid <taglib> entry, the 2nd one I gave you was valid and does work.

Viewing 8 posts - 1 through 8 (of 8 total)
Reply To: cvc-elt.1: Cannot find the location of element ‘taglib’

You must be logged in to post in the forum log in