Results 1 to 6 of 6

Thread: Not well-formed error

  1. #1
    Administrator
    UK diades's Avatar
    Join Date
    Feb 2001
    Location
    Glasgow, Scotland
    Posts
    15,664
    Blog Entries
    6

    Not well-formed error

    Hi Guys

    Could you run your eye over this dtd? I am getting an error and cannot see why for the life of me!
    HTML Code:
    <?xml version="1.0" encoding="UTF-8"?>
    
    <!ENTITY % uri "CDATA">
    <!ENTITY % script "CDATA">
    <!ENTITY % stylesheet "CDATA">
    <!ENTITY % text "CDATA">
    <!ENTITY % languagecode "NAME" >
    <!ENTITY % coreattrs
             "id ID #IMPLIED
              class CDATA #IMPLIED
              style %stylesheet; #IMPLIED
              title %text; #IMPLIED" >
    <!ENTITY % i18n
             "lang %languagecode; #IMPLIED
              dir (ltr|rtl) #IMPLIED" >
    <!ENTITY % events
             "onclick     %script; #IMPLIED
              ondblclick  %script; #IMPLIED
              onmousedown %script; #IMPLIED
              onmouseup   %script; #IMPLIED
              onmouseover %script; #IMPLIED
              onmousemove %script; #IMPLIED
              onmouseout  %script; #IMPLIED
              onkeypress  %script; #IMPLIED
              onkeydown   %script; #IMPLIED
              onkeyup     %script; #IMPLIED" >
    <!ENTITY % attrs "%coreattrs; %i18n; %events;">
    <!ENTITY % contenttype "CDATA" >
    <!ENTITY % contenttypes "CDATA" >
    <!ENTITY % charset "CDATA" >
    <!ENTITY % charsets "CDATA" >
    <!ENTITY % methodtype '(get|post)'>
    
    <!ELEMENT script (%script;)>
    <!ATTLIST script
                      charset %charset; #IMPLIED
                      type %contenttype; #REQUIRED
                      src %uri; #IMPLIED
                      defer (defer) #IMPLIED
                      event CDATA #IMPLIED
                      for %uri; #IMPLIED >
    <!ELEMENT forumhome (header)>
    <!-- 
    ===============
    Start header group 
    ===============
    -->
    <!ELEMENT header (logo_section,navigation_section)>
    <!-- ========================== -->
    <!ELEMENT logo_section (logo,logo_right)>
    <!-- ************************************** -->
    <!ELEMENT logo EMPTY>
    <!ELEMENT logo_right (#PCDATA)>
    <!-- ========================== -->
    <!ELEMENT navigation_section (forum_location_section,form)>
    <!ELEMENT forum_location_section (location_link)*>
    <!ELEMENT location_link (#PCDATA)>
    <!ATTLIST location_link  href CDATA #REQUIRED
                      show (new | replace | embed ) 'new'
                      actuate (user | auto ) 'user'
                      xlink CDATA #FIXED 'simple'
                      e-dtype NMTOKEN #FIXED 'string'
                      a-dtype NMTOKENS 'href uri' >
    
    <!ELEMENT form (script)*>
    <!ATTLIST form %attrs; %coreattrs; %i18n; %events;
                      action %uri; #REQUIRED
                      enctype %contenttype; "application/x-www-form-urlencoded"
                      method  %methodtype; 'get' #REQUIRED
                      accept %contenttypes; #IMPLIED
                      name CDATA #IMPLIED
                      onsubmit %script; #IMPLIED
                      onreset %script; #IMPLIED
                      accept-charset %charsets; #IMPLIED>
    
    <!ELEMENT loginform (label,button)>
    <!ATTLIST loginform action CDATA #REQUIRED
                      target CDATA #IMPLIED>
    <!-- 
    ===============
    End header group 
    ===============
    -->
    The error is:
    "entity substitution failed - Well-formedness failed: expecting %"
    at <!ATTLIST form

  2. #2
    Hi,

    I cant see the error , but then I'm not really a DTD expert.

    But if you goto:

    http://xmlvalidation.com/

    And in the validation text box add something like:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE test SYSTEM "test.dtd">

    and hit validate it will ask you for your DTD file and will validate it, it may shed some light.

    Regards
    Gav

  3. #3
    Administrator
    UK diades's Avatar
    Join Date
    Feb 2001
    Location
    Glasgow, Scotland
    Posts
    15,664
    Blog Entries
    6
    Thanks Gav

    I tried it but no good, it just keeps going in circles asking me to upload or copy the files without doing anything else

  4. #4
    Hi,

    I will test it out, I know in the past it has been a little catchy, something to do with having to hit refresh on each new document, else it maintains the old one. Also I paste the contents in rather than use the file upload.

    For the first document I entered :

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE test SYSTEM "test.dtd">
    It asks me for the DTD referenced in the xml, so I paste your code into the box and click validate.

    I get back the following report:

    Code:
    Errors in file test.dtd: 
     66: 23 The attribute type is required in the declaration of attribute "lang" for element "form". 
    
    test.dtd
    1 <?xml version="1.0" encoding="UTF-8"?> 
    2  
    3 <!ENTITY % uri "CDATA"> 
    4 <!ENTITY % script "CDATA"> 
    5 <!ENTITY % stylesheet "CDATA"> 
    6 <!ENTITY % text "CDATA"> 
    7 <!ENTITY % languagecode "NAME" > 
    8 <!ENTITY % coreattrs 
    9          "id ID #IMPLIED 
    10           class CDATA #IMPLIED 
    11           style %stylesheet; #IMPLIED 
    12           title %text; #IMPLIED" > 
    13 <!ENTITY % i18n 
    14          "lang %languagecode; #IMPLIED 
    15           dir (ltr|rtl) #IMPLIED" > 
    16 <!ENTITY % events 
    17          "onclick     %script; #IMPLIED 
    18           ondblclick  %script; #IMPLIED 
    19           onmousedown %script; #IMPLIED 
    20           onmouseup   %script; #IMPLIED 
    21           onmouseover %script; #IMPLIED 
    22           onmousemove %script; #IMPLIED 
    23           onmouseout  %script; #IMPLIED 
    24           onkeypress  %script; #IMPLIED 
    25           onkeydown   %script; #IMPLIED 
    26           onkeyup     %script; #IMPLIED" > 
    27 <!ENTITY % attrs "%coreattrs; %i18n; %events;"> 
    28 <!ENTITY % contenttype "CDATA" > 
    29 <!ENTITY % contenttypes "CDATA" > 
    30 <!ENTITY % charset "CDATA" > 
    31 <!ENTITY % charsets "CDATA" > 
    32 <!ENTITY % methodtype '(get|post)'> 
    33  
    34 <!ELEMENT script (%script;)> 
    35 <!ATTLIST script 
    36                   charset %charset; #IMPLIED 
    37                   type %contenttype; #REQUIRED 
    38                   src %uri; #IMPLIED 
    39                   defer (defer) #IMPLIED 
    40                   event CDATA #IMPLIED 
    41                   for %uri; #IMPLIED > 
    42 <!ELEMENT forumhome (header)> 
    43 <!--  
    44 =============== 
    45 Start header group  
    46 =============== 
    47 --> 
    48 <!ELEMENT header (logo_section,navigation_section)> 
    49 <!-- ========================== --> 
    50 <!ELEMENT logo_section (logo,logo_right)> 
    51 <!-- ************************************** --> 
    52 <!ELEMENT logo EMPTY> 
    53 <!ELEMENT logo_right (#PCDATA)> 
    54 <!-- ========================== --> 
    55 <!ELEMENT navigation_section (forum_location_section,form)> 
    56 <!ELEMENT forum_location_section (location_link)*> 
    57 <!ELEMENT location_link (#PCDATA)> 
    58 <!ATTLIST location_link  href CDATA #REQUIRED 
    59                   show (new | replace | embed ) 'new' 
    60                   actuate (user | auto ) 'user' 
    61                   xlink CDATA #FIXED 'simple' 
    62                   e-dtype NMTOKEN #FIXED 'string' 
    63                   a-dtype NMTOKENS 'href uri' > 
    64  
    65 <!ELEMENT form (script)*> 
    66 <!ATTLIST form %attrs; %coreattrs; %i18n; %events; 
    67                   action %uri; #REQUIRED 
    68                   enctype %contenttype; "application/x-www-form-urlencoded" 
    69                   method  %methodtype; 'get' #REQUIRED 
    70                   accept %contenttypes; #IMPLIED 
    71                   name CDATA #IMPLIED 
    72                   onsubmit %script; #IMPLIED 
    73                   onreset %script; #IMPLIED 
    74                   accept-charset %charsets; #IMPLIED> 
    75  
    76 <!ELEMENT loginform (label,button)> 
    77 <!ATTLIST loginform action CDATA #REQUIRED 
    78                   target CDATA #IMPLIED> 
    79 <!--  
    80 =============== 
    81 End header group  
    82 =============== 
    83 -->
    indicating the error : 66: 23 The attribute type is required in the declaration of attribute "lang" for element "form".

    Which would indicate line 66 char 23 in DTD file.

    Hope that helps.

    I wonder if it is a browser thing with xmlvalidation.com, I used IE6 sp2 to get that result.

    Regards
    Gav

  5. #5
    Administrator caislander's Avatar
    Join Date
    May 2000
    Location
    Just a bit too far north of the guy with the cleaning chamois
    Posts
    8,317
    Keith,

    That error may be refering to this section
    Code:
    <!ENTITY % i18n
             "lang %languagecode; #IMPLIED
              xml:lang    %LanguageCode; #IMPLIED
              dir (ltr|rtl) #IMPLIED" >
    as I posted in the other thread my notes said that was a required, so see if maybe it helps

    From The Land Of SunShine, Surf & Code

  6. #6
    Administrator
    UK diades's Avatar
    Join Date
    Feb 2001
    Location
    Glasgow, Scotland
    Posts
    15,664
    Blog Entries
    6
    Hi Guys

    It is referring to this section: "lang %languagecode; #IMPLIED
    and %languagecode; is:
    <!ENTITY % language_code "NAME" >
    Lord knows where that came from, it should be:
    <!ENTITY % language_code "NMTOKEN" > That did it folks, thanks for the time

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. php install error, when i use post i get 404 error
    By akravemaster in forum Server-side Forum
    Replies: 2
    Last Post: 6th January 2007, 02:27
  2. error handling versus IIS directed custom error
    By AngelaFrench in forum Server-side Forum
    Replies: 5
    Last Post: 14th December 2006, 21:14
  3. how can i fix up this error?
    By lgmqy2000 in forum Client-side forum
    Replies: 1
    Last Post: 23rd May 2002, 12:13
  4. I have a PHP error I can't fix.
    By rage in forum Server-side Forum
    Replies: 2
    Last Post: 5th December 2001, 13:40
  5. Where, where, where is the error!!..oh wheres the error!
    By Baggio in forum Server-side Forum
    Replies: 12
    Last Post: 20th July 2001, 00:35

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •