facebook

I’m getting an error on my tld file when running validation.

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

    rpray
    Member

    I’m getting two errors on my tld file when I run validation. They are as follows:

    cvc-elt.1: Cannot find the declaration of element 'taglib'.    taxesCommon.tld    taxesCommonTagFiles2005/META-INF    line 6    November 4, 2005 8:45:30 AM
    
    SchemaLocation: schemaLocation value = 'http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd' must have even number of URI's.    taxesCommon.tld    taxesCommonTagFiles2005/META-INF    line 6    November 4, 2005 8:45:30 AM

    Here is my tld file.

    
    <?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"> 
      
      <description>Taxes Common Tag Files</description>
      <tlib-version>1.1</tlib-version>
      <short-name>tct</short-name>
      <uri>taxesCommonTagFiles</uri>
      <tag-file>
        <name>getHeader</name>
        <path>/META-INF/tags/getHeader.tag</path>
      </tag-file>
      <tag-file>
        <name>getFooter</name>
        <path>/META-INF/tags/getFooter.tag</path>
      </tag-file>
    
      <tag-file>
        <name>F_Header</name>
        <path>/META-INF/tags/F_Header.tag</path>
      </tag-file>
      <tag-file>
        <name>F_Footer</name>
        <path>/META-INF/tags/F_Footer.tag</path>
      </tag-file>
      <tag-file>
        <name>A_Header</name>
        <path>/META-INF/tags/A_Header.tag</path>
      </tag-file>
      <tag-file>
        <name>A_Footer</name>
        <path>/META-INF/tags/A_Footer.tag</path>
      </tag-file>
      <tag-file>
        <name>E_Header</name>
        <path>/META-INF/tags/E_Header.tag</path>
      </tag-file>
      <tag-file>
        <name>E_Footer</name>
        <path>/META-INF/tags/E_Footer.tag</path>
      </tag-file>
      <tag-file>
        <name>T_Header</name>
        <path>/META-INF/tags/T_Header.tag</path>
      </tag-file>
      <tag-file>
        <name>T_Footer</name>
        <path>/META-INF/tags/T_Footer.tag</path>
      </tag-file>
      <tag-file>
        <name>Z_Header</name>
        <path>/META-INF/tags/Z_Header.tag</path>
      </tag-file>
      <tag-file>
        <name>Z_Footer</name>
        <path>/META-INF/tags/Z_Footer.tag</path>
      </tag-file>
    
      <tag-file>
        <name>f_menu_data</name>
        <path>/META-INF/tags/f_menu_data.tag</path>
      </tag-file>
      <tag-file>
        <name>a_menu_data</name>
        <path>/META-INF/tags/a_menu_data.tag</path>
      </tag-file>
      <tag-file>
        <name>e_menu_data</name>
        <path>/META-INF/tags/e_menu_data.tag</path>
      </tag-file>
      <tag-file>
        <name>t_menu_data</name>
        <path>/META-INF/tags/t_menu_data.tag</path>
      </tag-file>
      <tag-file>
        <name>z_menu_data</name>
        <path>/META-INF/tags/z_menu_data.tag</path>
      </tag-file>
    
    </taglib>
    
    

    I just want to know if this is because the tag file stuff is not supported in the validator or have I done something wrong in my file.

    The tag file works when I deploy it.

    thanks,
    Rick.

    #240861 Reply

    Scott Anderson
    Participant

    Rick,

    The issue is with the schemaLocation. Try the following instead:

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

    It’s more explicit and will remove the validation error.

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: I’m getting an error on my tld file when running validation.

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