www.webdeveloper.com
Results 1 to 2 of 2

Thread: XML file will not load in Internet Explorer

  1. #1
    Join Date
    Apr 2008
    Posts
    136

    XML file will not load in Internet Explorer

    When trying to view an XML file in Internet Explorer, I get the following error: "Required white space was missing. Error processing resource 'file:///C:/My Documents/XMLWeek3.xml'. Line 10, Position 105"

    Here's the code:

    Code:
    <?xml version="1.0"?>
    <!DOCTYPE library [
      <!ELEMENT library (book+)>
      <!ELEMENT book (title,author,publisher)>
      <!ELEMENT title      (#PCDATA)>
      <!ELEMENT author     (#PCDATA)>
      <!ELEMENT publisher  (#PCDATA)>
    
     <!ATTLIST book id CDATA #REQUIRED>
     <!ATTLIST book type (Mystery | History | Fiction | Children | Religion | Self_Help | Biography | Other)>
    ]>
    
    <library>
    
     <book id="A01" type="History"> 
       <title>Battleground</title>
       <author>Griffin, WEB</author>
       <publisher>Berkley Publishing Group</publisher>
     </book>
    
     <book type="Mystery" id="B01>
       <title>4th of July</title>
       <author>Patterson, James</author>
       <publisher>Grand Central Publishing</publisher>
     </book>
    
     <book type="Fiction" id="C01">
       <title>The Sun Also Rises</title>
       <author>Hemingway, Ernest</author>
       <publisher>Scribner</publisher>
     </book>
    
     <book type="Mystery" id="B02">
       <title>Double Deuce</title>
       <author>Parker, Robert</author>
       <publisher>Berkley Publishing Group</publisher>
     </book>
    
     <book type="Religion" id="D01">
       <title>Treasures of the Transformed Life</title>
       <author>Mathison, John Ed</author>
       <publisher>Abingdon Press</publisher>
     </book>
    
    <book type="History" id="A02">
       <title>Baa Baa Black Sheep</title>
       <author>Boyington, Gregory</author>
       <publisher>Bantam Books</publisher>
    </book>
    
    <book type="Religion" id="D02">
       <title>Growing Through Life's Challenges</title>
       <author>Reapsome, James and Martha</author>
       <publisher>Waterbrook Press</publisher>
    </book>
    
    
    </library>
    It's referring to this piece of code:

    Code:
    <!ATTLIST book type (Mystery | History | Fiction | Children | Religion | Self_Help | Biography | Other)>
    I'm not seeing the error in that piece of code.

  2. #2
    Join Date
    Oct 2009
    Posts
    6
    You should replace this code with the following:

    <!ATTLIST book type (Mystery | History | Fiction | Children | Religion | Self_Help | Biography | Other) #IMPLIED>

    (You have missed out the #IMPLIED)

    Also, change <book type="Mystery" id="B01> with <book type="Mystery" id="B01"> as closing quotes is missing otherwise you will get the error.

Thread Information

Users Browsing this Thread

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

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