DTD Validation

Discussion in 'XML & RSS' started by protocol96, Dec 7, 2008.

  1. #1
    Hi All,

    When I try to validate it against the DTD, it gives me the following error --> The attribute type is required in the declaration of attribute "sub_id" for element "category".

    
    <!ELEMENT category (#PCDATA) >
    <!ATTLIST category id (1| 2| 3) "1">
    <!ATTLIST category name (Captain |Jack |Sparrow ) "Captain">
    <!ATTLIST category sub_id #IMPLIED (11| 22| 33 ) "11" >
    <!ATTLIST category sub_name #IMPLIED (Stupid |Friendly |Moron) "Moron" >
    
    PHP:
    The value in the xml can be
    <category id='1' name='Captain' sub_id='11' sub_name='Moron'/>
    or
    <category id='1' name='Captain' />

    Thanks for your help!
     
    protocol96, Dec 7, 2008 IP