Wednesday, April 13, 2011

XML: Simple internal DTD definition example

Best way to validate is using any browser. Open the XML file in any browser.
Also, if you open in Eclipse, you can right click on the .xml file and select "validate".

 <?xml version="1.0"?>  
 <!DOCTYPE notes [  
  <!ELEMENT notes  (note*)>  
  <!ELEMENT note  (to,from,heading,body*)>  
  <!ELEMENT to   (#PCDATA)>  
  <!ELEMENT from  (#PCDATA)>  
  <!ELEMENT heading (#PCDATA)>  
  <!ELEMENT body  (#PCDATA)>  
           <body>this is msg</body>  

No comments:

Post a Comment