www.webdeveloper.com
Results 1 to 2 of 2

Thread: Why won't this validate?!!

Hybrid View

  1. #1
    Join Date
    Jun 2006
    Location
    Doncaster
    Posts
    78

    Why won't this validate?!!

    Seems straightforward enough. But it won't display in Firefox saying:
    XML Parsing Error: junk after document element
    Location: file:///C:/Users/Main/Documents/desko/src/appt.xml
    Line Number 10, Column 2: <apptDetails>
    --------^
    ...and nor will it validate at XML Validome.

    What is wrong? Is it whitespace?
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    	<nameDetails>
    		<firstName>
    			Ali
    		</firstName>
    		<secondName>
    			Hurworth
    		</secondName>
    	</nameDetails>
    	<apptDetails>
    		<apptDate>
    			01052009
    		</apptDate>
    		<apptTime>
    			1735
    		</apptTime>
    	</apptDetails>
    	<nSession>
    		<session>
    			Bentley Pavilion
    		</session>
    		<sessionPostcode>
    			DN5 9AA
    		</sessionPostcode>
    		<postCode>
    			DN5
    		</postCode>
    	</nSession>
    </xml>

  2. #2
    Join Date
    Jun 2006
    Location
    Doncaster
    Posts
    78

    I've cracked it...

    It needed an overall wrapper and the closing </xml> tag is not required .

    Code:
    <?xml version="1.0" encoding="utf-8"?>
    	<donorDetails>
    		<nameDetails>
    			<firstName>
    				Ali
    			</firstName>
    			<secondName>
    				Hurworth
    			</secondName>
    		</nameDetails>
    		<apptDetails>
    			<apptDate>
    				01052009
    			</apptDate>
    			<apptTime>
    				1735
    			</apptTime>
    		</apptDetails>
    		<nSession>
    			<session>
    				Bentley Pavilion
    			</session>
    			<sessionPostcode>
    				DN5 9AA
    			</sessionPostcode>
    			<postCode>
    				DN5
    			</postCode>
    		</nSession>
    	</donorDetails>

Thread Information

Users Browsing this Thread

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

Tags for this Thread

Posting Permissions

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



Recent Articles