XML VALIDATION MC1803 XML AND WEB SERVICES LAB Anna University lab manual download fifth semester - Computer Programming

Latest

C C++ Java Python Perl Programs Examples with Output -useful for Schools & College Students

Saturday, January 29, 2011

XML VALIDATION MC1803 XML AND WEB SERVICES LAB Anna University lab manual download fifth semester

XML VALIDATION MC1803 XML AND WEB SERVICES LAB Anna University lab manual download fifth semester


Create an XML Document to store information about books and create the DTD files

<!ELEMENT Catalogue (book)>
<!ELEMENT Book (BookNo, Title, Author, Price)>
<!ELEMENT BookNo (#PCDATA)>
<!ELEMENT Title (#PCDATA)>
<!ELEMENT Author (#PCDATA)>
<!ELEMENT Price (#PCDATA)>
Create a DTD for TV Schedule
<!DOCTYPE TVSCHEDULE [
<!ELEMENT TVSCHEDULE (CHANNEL+)>
<!ELEMENT CHANNEL (BANNER,DAY+)>
<!ELEMENT BANNER (#PCDATA)>
<!ELEMENT DAY (DATE,(HOLIDAY|PROGRAMSLOT+)+)>
<!ELEMENT HOLIDAY (#PCDATA)>
ELEMENT DATE (#PCDATA)>
<!ELEMENT PROGRAMSLOT (TIME,TITLE,DESCRIPTION?)>
<!ELEMENT TIME (#PCDATA)>
<!ELEMENT TITLE (#PCDATA)> 
<!ELEMENT DESCRIPTION (#PCDATA)>
 
<!ATTLIST TVSCHEDULE NAME CDATA #REQUIRED>
<!ATTLIST CHANNEL CHAN CDATA #REQUIRED>
<!ATTLIST PROGRAMSLOT VTR CDATA #IMPLIED>
<!ATTLIST TITLE RATING CDATA #IMPLIED>
<!ATTLIST TITLE LANGUAGE CDATA #IMPLIED>
 
]>
 

 Create a DTD for Newspaper Article

 
<!DOCTYPE NEWSPAPER [ 
<!ELEMENT NEWSPAPER (ARTICLE+)>
<!ELEMENT ARTICLE (HEADLINE,BYLINE,LEAD,BODY,NOTES)>
<!ELEMENT HEADLINE (#PCDATA)>
<!ELEMENT BYLINE (#PCDATA)>
<!ELEMENT LEAD (#PCDATA)>
<!ELEMENT BODY (#PCDATA)>
<!ELEMENT NOTES (#PCDATA)> 
<!ATTLIST ARTICLE AUTHOR CDATA #REQUIRED>
<!ATTLIST ARTICLE EDITOR CDATA #IMPLIED>
<!ATTLIST ARTICLE DATE CDATA #IMPLIED>
<!ATTLIST ARTICLE EDITION CDATA #IMPLIED>
<!ENTITY NEWSPAPER "Vervet Logic Times">
<!ENTITY PUBLISHER "Vervet Logic Press">
<!ENTITY COPYRIGHT "Copyright 1998 Vervet Logic Press">
]>

Create  a DTD for product catalogue

<!DOCTYPE CATALOG [
<!ENTITY AUTHOR "John Doe">
<!ENTITY COMPANY "JD Power Tools, Inc.">
<!ENTITY EMAIL "jd@jd-tools.com">
 
<!ELEMENT CATALOG (PRODUCT+)>
 
<!ELEMENT PRODUCT
(SPECIFICATIONS+,OPTIONS?,PRICE+,NOTES?)>
<!ATTLIST PRODUCT
NAME CDATA #IMPLIED
CATEGORY (HandTool|Table|Shop-Professional) "HandTool"
PARTNUM CDATA #IMPLIED
PLANT (Pittsburgh|Milwaukee|Chicago) "Chicago"
INVENTORY (InStock|Backordered|Discontinued) "InStock">
 
<!ELEMENT SPECIFICATIONS (#PCDATA)>
<!ATTLIST SPECIFICATIONS
WEIGHT CDATA #IMPLIED
POWER CDATA #IMPLIED>
 
<!ELEMENT OPTIONS (#PCDATA)>
<!ATTLIST OPTIONS
FINISH (Metal|Polished|Matte) "Matte" 
ADAPTER (Included|Optional|NotApplicable) "Included"
CASE (HardShell|Soft|NotApplicable) "HardShell">
<!ELEMENT PRICE (#PCDATA)>
<!ATTLIST PRICE
MSRP CDATA #IMPLIED
WHOLESALE CDATA #IMPLIED
STREET CDATA #IMPLIED
SHIPPING CDATA #IMPLIED>
<!ELEMENT NOTES (#PCDATA)>
 
]>

 

EXERCISE 2.5 create a DTD for  Book


<?xml version="1.0"?>
<!DOCTYPE book SYSTEM "z:\labxml\ADDRESSBOOK.DTD">
<library>
<!—as in address book.xml of exercise 1.5 -->
</library>

BOOK.DTD
<!ELEMENT library (book)>
<!ELEMENT book (novel,technical,management,fiction,devotional)>

<!ELEMENT novel (detective)>
<!ELEMENT detective (name,author,price,publication,page,review)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT author (fa,sa)>
<!ELEMENT fa (fname,lname,royalty,qualification,address,specialization)>
<!ELEMENT fname (#PCDATA)>
<!ELEMENT lname (#PCDATA)>
<!ELEMENT royalty (#PCDATA)>
<!ELEMENT qualification (#PCDATA)>
<!ELEMENT address (#PCDATA)>
<!ELEMENT specialization (#PCDATA)>
<!ELEMENT sa (fname,lname,royalty,qualification,address,specialization)>
<!ELEMENT fname (#PCDATA)>
<!ELEMENT lname (#PCDATA)>
<!ELEMENT royalty (#PCDATA)>
<!ELEMENT qualification (#PCDATA)>
<!ELEMENT address (#PCDATA)>
<!ELEMENT specialization (#PCDATA)>
<!ELEMENT price (#PCDATA)>
<!ELEMENT publication (pname,addr)>
<!ELEMENT pname (#PCDATA)>
<!ELEMENT addr (#PCDATA)>
<!ELEMENT page (#PCDATA)>
<!ELEMENT review (date,by,reviewno,comment)>
<!ELEMENT date (#PCDATA)>
<!ELEMENT by (byperson1,byperson2,byperson3,byperson4)>
<!ELEMENT byperson1 (#PCDATA)>
<!ELEMENT byperson2 (#PCDATA)>
<!ELEMENT byperson3 (#PCDATA)>
<!ELEMENT byperson4 (#PCDATA)>
<!ELEMENT reviewno (#PCDATA)>
<!ELEMENT comment (#PCDATA)>

<!ELEMENT romance (name,author,price,publication,page,review)>
   <!--Same Structure as in detective( )-->

<!ELEMENT comic (name,author,price,publication,page,review)>
   <!--Same Structure as in detective( )-->

<!ELEMENT technical (name,author,price,publication,page,review)>
   <!--Same Structure as in detective( )-->

<!ELEMENT technical (name,author,price,publication,page,review)>
   <!--Same Structure as in detective( )-->

<!ELEMENT management (name,author,price,publication,page,review)>
   <!--Same Structure as in detective( )-->

<!ELEMENT fiction (name,author,price,publication,page,review)>
   <!--Same Structure as in detective( )-->

<!ELEMENT devotional (name,author,price,publication,page,review)>
   <!--Same Structure as in detective( )-->

 

EXERCISE 2.6  CREATE  A DTD FOR THE RESUME  XML DOCUMENT

<!ELEMENT Resume (Personal,Education ,Co-Corricular,Extra-Coricullar,Technical-Details,Experiences)>
<!ELEMENT Personal (Name,Dob,Permanent-Address,Present-Address,Contact,Mail,Languages)>
<!ELEMENT Education (Institution,Board,Percentage)>
<!ELEMENT Co-Corricular (Project,Participation)>
<!ELEMENT Extra-Corricular (Activity)>
<!ELEMENT Technical-Details (Programming-Languages,Operating-Systems)>
<!ELEMENT Experiences (#PCDATA)>
<!ELEMENT Name (#PCDATA)>
<!ELEMENT Dob (#PCDATA)>
<!ELEMENT Permanent-Address (#PCDATA)>
<!ELEMENT Present-Address (#PCDATA)>
<!ELEMENT Contact (#PCDATA)>
<!ELEMENT Mail (#PCDATA)>
<!ELEMENT Languages (#PCDATA)>
<!ELEMENT Institution (#PCDATA)>
<!ELEMENT Board (#PCDATA)>
<!ELEMENT Percentage (#PCDATA)>
<!ELEMENT Project (#PCDATA)>
<!ELEMENT Participation (#PCDATA)>
<!ELEMENT Activity (#PCDATA)>
<!ELEMENT Programming-Languages (#PCDATA)>
<!ELEMENT Operating-Systems (#PCDATA)>
<!ATTLIST Education level CDATA #REQUIRED>

RESUME XML DOCUMENT
<?xml version="1.0" ?>
<Resume>
            <Personal>
          <Name>SUNIL LUITEL</Name>
          <Dob>25-09-1982</Dob>
          <Permanent-Address>
                                    6-KATUNJE,BHAKTAPUR
                                        KATHMANDU,NEPAL
          </Permanent-Address>
          <Present-Address>
                                  5/111,2nd STREET,
                                  KARAMBAKKAM,PORUR
                                  CHENNAI,INDIA
          </Present-Address>
          <Contact>9840380852</Contact>
          <Mail>luitelsunil@yahoo.com</Mail>
          <Languages>English,Nepali,Hindi</Languages>
    </Personal>
    <Education level="school">
         <Institution>OM SECONDARY SCHOOL</Institution>
         <Board>HMG SLC Board</Board>
         <Percentage>76</Percentage>
     </Education>
     <Education level="+2">
         <Institution>TRI CHANDRA COLLEGE</Institution>
         <Board>TRIBHUVAN UNIVERSITY</Board>
         <Percentage>59</Percentage>
     </Education>
    <Education level="UG">
         <Institution>PATAN MULTIPLE COLLEGE</Institution>
         <Board>TRIBHUVAN UNIVERSITY</Board>
         <Percentage>68</Percentage>
     </Education>
     <Education level="PG">
         <Institution>RAJALAKSHMI ENGINEERING COLLEGE</Institution>
         <Board>ANNA UNIVERSITY</Board>
         <Percentage>80</Percentage>
     </Education> 
      <Co-Curricular>
  <Project> AUTOMATION OF HOSPITAL MANAGEMENT  SYSTEM</Project>
          <Participation>SYMPOSIUM IN OTHER COLLEGES</Participation>
      </Co-Curricular>
    <Extra-Corricular>
          <Activity>DONATED BLOOD IN COLLEGE </Activity>
            <Activity>ORGANISING MEMBER OF SYMPOSIUM  FOR DEPARTMENT </Activity>
     </Extra-Corricular>
     <Technical-Details>
        <Programming-Languages>C,C++,JAVA,VISUAL BASIC  </Programming-Languages>
        <Operating-Systems>DOS,WINDOWS,LINUX(aware)</Operating-Systems>
     </Technical-Details>
     <Experiences>
                              WORKED AS JFR IN AN EDUCATIONAL PROJECT DONE BY MINISTRY OF EDUCATION NEPAL
      </Experiences>
</Resume> 


Output:

 

Error Code:0

Error Reason:

Error Line:0

No comments:

Post a Comment