www.webdeveloper.com
Results 1 to 3 of 3

Thread: Not Validating

  1. #1
    Join Date
    Oct 2008
    Posts
    24

    Not Validating

    Here is what The Erro reads i dont know how to fix it Can someone please help me Thanks
    {The content of element type "product_name" must match "(codeID|categoryID)".}
    This is my DTD code
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    
    <!ELEMENT products (product+)>
    <!ELEMENT product (product_name, model_number, price, vendor)> 
    
    <!ELEMENT product_name (codeID|categoryID)>
    <!ATTLIST product_name 
    	codeID ID #REQUIRED
     	categoryID IDREF #REQUIRED>
    
    <!ELEMENT model_number (#PCDATA)>
    <!ELEMENT price (#PCDATA)>
    <!ELEMENT vendor (#PCDATA)>
    And here is my XML code
    Code:
    <products>
    <product>
    		<product_name codeID="p001" categoryID="electronics">Toshiba DVD Player</product_name>
    	<model_number>SD-5000</model_number>
    	<price>75.00</price>
    	<vendor>Samsons Electronics,Toshiba NY,Toshiba NJ</vendor>
    </product>
    <product>	
    	<product_name codeID="p002" categoryID="electronics"> Pioneer DVD Player</product_name>
    	<model_number>DV-400V</model_number>
    	<price>100.00</price>
    	<vendor>James Electronics,Samsons Electronics</vendor>
    </product>
    <product>
    	<product_name codeID="p003" categoryID="household">Kenmore Microwave Oven</product_name>
    	<model_number></model_number>
    	<price>110.00</price>
    	<vendor>Sears NY,Sears MA,Sears NJ</vendor>
    </product>
    <product>
    	<product_name codeID="p004" categoryID="furniture">Ektorp Sofa</product_name>
    	<model_number></model_number>
    	<price>399.00</price>
    	<vendor>IKEA NY</vendor>
    </product>
    <product>
    	<product_name codeID="p005" categoryID="furniture">Sephora Table and Chair set</product_name>
    	<model_number></model_number>
    	<price>499.00</price>
    	<vendor>Country Squire Furniture,Sanders Cove Furniture,Royal Manor Furniture,Sedona Furniture</vendor>
    </product>
    <product>
    	<product_name codeID="p006" categoryID="electronics">Samsung MP3 Players</product_name>
    	<model_number>YP-U2JOB</model_number>
    	<price>85.00</price>
    	<vendor>James Electronics,Samsons Electronics,Samsung NY</vendor>
    </product>
    <product>
    	<product_name codeID="p007" categoryID="household" >Kenmore Range</product_name>
    	<model_number></model_number>
    	<price>750.00</price>
    	<vendor>Sears NY,Sears MA,Sears NJ,Sears CT</vendor>
    </product>
    <product>
    	<product_name codeID="p008" categoryID="household">GE Range</product_name>
    	<model_number>JBP81SL</model_number>
    	<price>1100.00</price>
    	<vendor>GE NY,GE NJ</vendor>
    </product>
    <product>
    	<product_name codeID="p009" categoryID="furniture">Linden Street Sofa</product_name>
    	<model_number></model_number>
    	<price>799.00</price>
    	<vendor>Country Squire Furniture,Sanders Cove Furniture</vendor>
    </product>
    <product>
    	<product_name codeID="p010" categoryID="electronics" >RCA 32 inch TV</product_name>
    	<model_number>L32WD22</model_number>
    	<price>650.00</price>
    	<vendor>James Electronics</vendor>
    </product>
    </products>

  2. #2
    Join Date
    Nov 2002
    Location
    Baltimore, Maryland
    Posts
    12,279
    Code:
    <!ELEMENT product_name (#PCDATA)>
    <!ATTLIST product_name 
    	codeID ID #REQUIRED
     	categoryID IDREF #REQUIRED>
    “The power of the Web is in its universality. Access by everyone regardless of disability is an essential aspect.”
    —Tim Berners-Lee, W3C Director and inventor of the World Wide Web

  3. #3
    Join Date
    Oct 2008
    Posts
    24
    Thanks so much

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