Results 1 to 4 of 4

Thread: XML element declaration

Threaded View

  1. #1

    Thread Starter
    Fanatic Member ubunreal69's Avatar
    Join Date
    Apr 2001
    Location
    Morayfield, Australia
    Posts
    609

    Question XML element declaration

    i have this xml file but it doesnt want to recognise The "school" element that i have created, i defined it in the DTD but when i try and open it with MS-XML Notapad it gives me the following error:

    PHP Code:
    The element 'school' is used but not declared in the DTD/Schema.

          <
    school yr="11" nm="St Collumbans"/>
    ------------------------------------------^ 
    what am i doing wrong ? i have provided a copy of the files with this post. any help is greatly appreciated.

    XML file:

    <?xml version="1.0"?>
    <!DOCTYPE account SYSTEM "x.dtd">
    <account>
    <personal>
    <name>Michael</name>
    <lname>Dawson</lname>
    <age>16</age>
    <school yr="11" nm="St Collumbans"/>
    </personal>
    </account>

    DTD file:

    <!ELEMENT account (personal)>
    <!ELEMENT personal (name,lname,age,school)>
    <!ELEMENT name (#PCDATA)>
    <!ELEMENT lname (#PCDATA)>
    <!ELEMENT age (#PCDATA)>
    <!ATTLIST school yr CDATA #REQUIRED
    nm CDATA #REQUIRED>
    Attached Files Attached Files
    • File Type: zip x.zip (464 Bytes, 53 views)

Posting Permissions

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



Click Here to Expand Forum to Full Width