www.webdeveloper.com
Results 1 to 2 of 2

Thread: Validating my XML using DTD

  1. #1
    Join Date
    Feb 2010
    Posts
    31

    Validating my XML using DTD

    I need some serious help validating my XML using DTD. Can someone look at this and lead me in the right direction? I am completely new to XML and cannot figure out what I am doing wrong. When I put the code in the validator, I keep getting the error: element content is invalid according to dtd schema. I have know idea what's going on.

    Code:
    <?xml version="1.0" ?> 
    <!DOCTYPE document[
    <!ELEMENT document (tableofcontents,content)>
    <!ELEMENT tableofcontents (part|pagenumber|subpart)+> 
    <!ELEMENT part (#PCDATA)>
    <!ELEMENT pagenumber (#PCDATA)>
    <!ELEMENT subpart (#PCDATA)>
    <!ELEMENT content (title|subtitle|pageone|pagetwo|pagethree|pagefour|pagefive|pagesix|pageseven)+>
    <!ELEMENT title (#PCDATA)>
    <!ELEMENT subtitle (#PCDATA)>
    <!ELEMENT pageone (#PCDATA)>
    <!ELEMENT pagetwo (#PCDATA)>
    <!ELEMENT pagethree (#PCDATA)>
    <!ELEMENT pagefour (#PCDATA)>
    <!ELEMENT pagefive (#PCDATA)>
    <!ELEMENT pagesix (#PCDATA)>
    <!ELEMENT pageseven (#PCDATA)>
    <!ELEMENT references (#PCDATA)>
    <!ATTLIST document type CDATA #IMPLIED>
    <!ENTITY cr "Copyright (C) 2011 XXXXXXX">
    ]>

  2. #2
    Join Date
    Feb 2010
    Posts
    31
    Here's the rest of the code. I couldn't fit it in the same post.


    Code:
    <document>
      <tableofcontents>
    	<part>INTRODUCTION</part>
        <pagenumber>1</pagenumber>
    	<part>A BRIEF HISTORY OF SOCIAL MEDIA</part>
        <pagenumber>1</pagenumber>
    	<part>THE ROLE OF SOCIAL MEDIA IN BUSINESS</part>
        <pagenumber>2</pagenumber>
    	   <subpart>Social Networking Functions</subpart>
    	<pagenumber>3</pagenumber>
        <part>IMPLEMENTING A SOCIAL MEDIA BUSINESS STRATEGY</part>
        <pagenumber>4</pagenumber>
    	  <subpart>Determining Our Objective</subpart>
    	<pagenumber>4</pagenumber>
    	  <subpart>Department That Runs Social Media</subpart>
    	<pagenumber>4</pagenumber>
    	  <subpart>Consider Employees</subpart>
    	<pagenumber>4</pagenumber>
    	  <subpart>Check Technology</subpart>
    	<pagenumber>4</pagenumber>
    	  <subpart>Listen First</subpart>
    	<pagenumber>5</pagenumber>
    	<part>DISCUSSION:  REVENUES AND BENEFITS</part>
        <pagenumber>5</pagenumber>
    	<subpart>Revenues</subpart>
    	<pagenumber>5</pagenumber>
    	<subpart>Projections</subpart>
    	<pagenumber>6</pagenumber>
    	<subpart>Trends</subpart>
    	<pagenumber>6</pagenumber>
    	<part>CONCLUSION AND RECOMMENDATIONS</part>
        <pagenumber>7</pagenumber>
    	<part>REFERENCES</part>
        <pagenumber>8</pagenumber>
    </tableofcontents>
    <content>
     <title>INTRODUCTION</title><pageone></pageone>
     
    
    <pagetwo><title>THE ROLE OF SOCIAL MEDIA IN BUSINESS</title>
    
    <pagethree><title>Social Networking Functions</title> 
    .</pagethree> 
    
    
    <pagefour><title>IMPLEMENTING A SOCIAL MEDIA BUSINESS STRATEGY</title>
    
     <subtitle>Department That Runs Social Media</subtitle>
    
    <pagefive><title>DISCUSSION:  REVENUES AND TRENDS</title>
     
    <subtitle>Revenues</subtitle>
    
    </pagefive>
    <pagesix><subtitle>Projections</subtitle>
    
    <subtitle>Trends</subtitle>
     </pagesix>
    
    <pageseven><title>CONCLUSIONS AND RECOMMENDATIONS</title>
    </pageseven> 
    </content>
    <references>
    <title>REFERENCES</title>
    
    </references>
    </document>

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