Embed presentation
Downloaded 151 times





















![4 <rollno>123</rollno>5 <name>Rams</name>6 <mobileno>9949139899</mobileno>7 <mobileno>8887776663</mobileno>8 <address country = “india”>9 <hno>2/202</hno>10 <colony>nawabpet</colony>11 <city>bond</city>12 </address>13 </student>14 </institute>Procedure to create a XML document containing internal DTD rules:Click on file menuSelect new itemSelect XML (Extensible Markup Language)Click on OKClick on cancel<! DOCTYPE institute [<! ELEMENT institute (student +)>...{same as previous rules}..<! ATTLIST address country cDATA #FIXED “india”>]><institute><student course = “html” Type = “inspector”>...{same as previous rules}.Page | 22](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2fhtmlxmlandjavascript-130509022225-phpapp01%2f75%2fHtml-xml-and-java-script-22-2048.jpg&f=jpg&w=240)



![3. Restrictions on series of values:<xs: element name = “xxx”><xs: simpleType><xs: restriction base = “yyy”><xs: pattern value = “([a-z]+)”/></xs: restriction></xs: simpleType></xs: element>The above pattern allow the user to enter the data of lengththreecharacters, where every character lowercase alphabet.Note: Every pair of [] represents one character.<xs: pattern value = “[abcd]/>The above syntax allow to enter a data of length one character where that charactercan be either ‘a’ or ‘b’ or ‘c’ and ‘d’.<xs: pattern value = “[0-9][0-9][0-9][0-9]”/>The above pattern will allow the user to enter a data of length of data 4 characterwhere each character should be a digit.<xs: pattern value = “([a-z])*”/>The above syntax will allow the user to enter a data of any length but everycharacter should be a lower case alphabet.<xs: pattern value = “([a-z][A-Z])+”/>The above pattern will allow the user to enter a data containing one or more pairs oflower case and the upper case alphabets respectively.<xs: pattern value =”[0-9]{10}”/>The above pattern will allow the user to enter a data of length exactly 10 characterwhere every should be a digit.Page | 26](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2fhtmlxmlandjavascript-130509022225-phpapp01%2f75%2fHtml-xml-and-java-script-26-2048.jpg&f=jpg&w=240)
![4. Restrictions on length of the data:<xs: pattern value =” ([a-zA-Z0-9@#$ %])*/><xs: minLength value=”6”/>The restriction will allow the user to enter a data whoseminimum length should be ‘6’ characters.<xs: pattern value = “([a-z A-Z @ # % $])*”/><xs: maxLength value = “20”>This restriction will allow the user to enter a data whose maximum length can be upto ‘20’ characters.<xs: length value = “10”/>This restriction will allow the user to enter data whose length is exactly ‘10’characters.Procedure Create a Document Containing Schema Based Rules:Click on file menu select new select xsd (w3c XML SCHEMA) click on OK.1. <xs: schema xmlns: xs=”http://www.w3.org/2001/XML Schema”>2. <xs: element name = “institute”>3. <xs: complexType>4. <xs: sequence>5. <xs: element name=“student” minoccurs = “1” maxoccurs = “60”>6. <xs: complexType>7. <xs: sequence>8. <xs: element name=“rollno” maxoccurs=“1” minoccurs=”1”>9. <xs: simpleType>10.<xs: restriction base = “xs: integer”>11.<xs: pattern value = “[0-9][0-9][0-9]”>12.</xs: restriction>13.</xs: simpleType>14.</xs: element>15.<xs: element name = “name” maxoccurs = “1” minoccurs = “1”>16.<xs: simpleType>17.<xs: restriction base = “xs: string”/>Page | 27](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2fhtmlxmlandjavascript-130509022225-phpapp01%2f75%2fHtml-xml-and-java-script-27-2048.jpg&f=jpg&w=240)
![18.<xs: pattern value = “([a-zA-Z])*”/>19.<xs: minLength value = “4”/>20.<xs: maxlength value = “10”/>21.</xs: restriction>22.</xs: simpleType>23.</xs: element>24.<xs: element name = “mobileno” minoccurs = “2” maxoccurs = “5”>25.<xs: simpleType>26.<xs: restriction base = “xs:integer”>27.<xs: pattern value = “[789][0-9]{9}”/>28.</xs: restriction>29.</xs: simpleType>30.</xs: element>31.<xs: element name = “address”>32.<xs: complexType>33.<xs: all>34.<xs: element name = “hno” type = “xs: string”/>35.<xs: element name = “colony” type = “xs: string”/>36.<xs: element name = “city” type = “xs: string”/>37.</xs: all>38.<xs: attribute name = “country” fixed = “india”/>39.</xs: complexType>40.</xs: element>41.</xs: sequence>42.<xs: attribute name =”course” use = “required”>43.<xs: simpleType>44.<xs: restriction base = “xs: string”>45.<xs: enumeration value = “html”/>46.<xs: enumeration value = “xml”/>47.<xs: enumeration value = “java”/>48.<xs: enumeration value = “oracle”/>49.</xs: restriction>50.</xs: simpleType>51.</xs: attribute>Page | 28](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2fhtmlxmlandjavascript-130509022225-phpapp01%2f75%2fHtml-xml-and-java-script-28-2048.jpg&f=jpg&w=240)














![4. Array object:This object is used to value store multiple values into a single variable.Ex:<html><head><title>Array Object</title></head><body><script type = “text/javascript”>var names = new Array();names[0] = “john”;names[1] = “Khan”;names[2] = “Zhan”;names[3] = “Mallikarjuna”;names[4]= “Suneel”;document.write(names + “<br/>”);for(i=0; i<names.length;i++);{Document.write(names[i] +”<br/>”);}document.write(names.reverse() +”<br/>”);document.write(names.sort() +”<br/>”);</script></body></html>5. Math object: This object is used to perform mathematical operations.Ex:<html><head><title>Math Object</title></head><body><script type = “text/javascript”>document.write(Math.min(4,6) + “<br/>”);Page | 43](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2fhtmlxmlandjavascript-130509022225-phpapp01%2f75%2fHtml-xml-and-java-script-43-2048.jpg&f=jpg&w=240)










HTML documents consist of HTML tags and text that are used to structure and markup web page content. HTML tags come in pairs with opening and closing tags, are case insensitive, and always surround element content. The basic structure of an HTML document includes a <head> section for metadata and a <body> section for visible page content.





















![4 <rollno>123</rollno>5 <name>Rams</name>6 <mobileno>9949139899</mobileno>7 <mobileno>8887776663</mobileno>8 <address country = “india”>9 <hno>2/202</hno>10 <colony>nawabpet</colony>11 <city>bond</city>12 </address>13 </student>14 </institute>Procedure to create a XML document containing internal DTD rules:Click on file menuSelect new itemSelect XML (Extensible Markup Language)Click on OKClick on cancel<! DOCTYPE institute [<! ELEMENT institute (student +)>...{same as previous rules}..<! ATTLIST address country cDATA #FIXED “india”>]><institute><student course = “html” Type = “inspector”>...{same as previous rules}.Page | 22](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2fhtmlxmlandjavascript-130509022225-phpapp01%2f75%2fHtml-xml-and-java-script-22-2048.jpg&f=jpg&w=240)



![3. Restrictions on series of values:<xs: element name = “xxx”><xs: simpleType><xs: restriction base = “yyy”><xs: pattern value = “([a-z]+)”/></xs: restriction></xs: simpleType></xs: element>The above pattern allow the user to enter the data of lengththreecharacters, where every character lowercase alphabet.Note: Every pair of [] represents one character.<xs: pattern value = “[abcd]/>The above syntax allow to enter a data of length one character where that charactercan be either ‘a’ or ‘b’ or ‘c’ and ‘d’.<xs: pattern value = “[0-9][0-9][0-9][0-9]”/>The above pattern will allow the user to enter a data of length of data 4 characterwhere each character should be a digit.<xs: pattern value = “([a-z])*”/>The above syntax will allow the user to enter a data of any length but everycharacter should be a lower case alphabet.<xs: pattern value = “([a-z][A-Z])+”/>The above pattern will allow the user to enter a data containing one or more pairs oflower case and the upper case alphabets respectively.<xs: pattern value =”[0-9]{10}”/>The above pattern will allow the user to enter a data of length exactly 10 characterwhere every should be a digit.Page | 26](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2fhtmlxmlandjavascript-130509022225-phpapp01%2f75%2fHtml-xml-and-java-script-26-2048.jpg&f=jpg&w=240)
![4. Restrictions on length of the data:<xs: pattern value =” ([a-zA-Z0-9@#$ %])*/><xs: minLength value=”6”/>The restriction will allow the user to enter a data whoseminimum length should be ‘6’ characters.<xs: pattern value = “([a-z A-Z @ # % $])*”/><xs: maxLength value = “20”>This restriction will allow the user to enter a data whose maximum length can be upto ‘20’ characters.<xs: length value = “10”/>This restriction will allow the user to enter data whose length is exactly ‘10’characters.Procedure Create a Document Containing Schema Based Rules:Click on file menu select new select xsd (w3c XML SCHEMA) click on OK.1. <xs: schema xmlns: xs=”http://www.w3.org/2001/XML Schema”>2. <xs: element name = “institute”>3. <xs: complexType>4. <xs: sequence>5. <xs: element name=“student” minoccurs = “1” maxoccurs = “60”>6. <xs: complexType>7. <xs: sequence>8. <xs: element name=“rollno” maxoccurs=“1” minoccurs=”1”>9. <xs: simpleType>10.<xs: restriction base = “xs: integer”>11.<xs: pattern value = “[0-9][0-9][0-9]”>12.</xs: restriction>13.</xs: simpleType>14.</xs: element>15.<xs: element name = “name” maxoccurs = “1” minoccurs = “1”>16.<xs: simpleType>17.<xs: restriction base = “xs: string”/>Page | 27](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2fhtmlxmlandjavascript-130509022225-phpapp01%2f75%2fHtml-xml-and-java-script-27-2048.jpg&f=jpg&w=240)
![18.<xs: pattern value = “([a-zA-Z])*”/>19.<xs: minLength value = “4”/>20.<xs: maxlength value = “10”/>21.</xs: restriction>22.</xs: simpleType>23.</xs: element>24.<xs: element name = “mobileno” minoccurs = “2” maxoccurs = “5”>25.<xs: simpleType>26.<xs: restriction base = “xs:integer”>27.<xs: pattern value = “[789][0-9]{9}”/>28.</xs: restriction>29.</xs: simpleType>30.</xs: element>31.<xs: element name = “address”>32.<xs: complexType>33.<xs: all>34.<xs: element name = “hno” type = “xs: string”/>35.<xs: element name = “colony” type = “xs: string”/>36.<xs: element name = “city” type = “xs: string”/>37.</xs: all>38.<xs: attribute name = “country” fixed = “india”/>39.</xs: complexType>40.</xs: element>41.</xs: sequence>42.<xs: attribute name =”course” use = “required”>43.<xs: simpleType>44.<xs: restriction base = “xs: string”>45.<xs: enumeration value = “html”/>46.<xs: enumeration value = “xml”/>47.<xs: enumeration value = “java”/>48.<xs: enumeration value = “oracle”/>49.</xs: restriction>50.</xs: simpleType>51.</xs: attribute>Page | 28](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2fhtmlxmlandjavascript-130509022225-phpapp01%2f75%2fHtml-xml-and-java-script-28-2048.jpg&f=jpg&w=240)














![4. Array object:This object is used to value store multiple values into a single variable.Ex:<html><head><title>Array Object</title></head><body><script type = “text/javascript”>var names = new Array();names[0] = “john”;names[1] = “Khan”;names[2] = “Zhan”;names[3] = “Mallikarjuna”;names[4]= “Suneel”;document.write(names + “<br/>”);for(i=0; i<names.length;i++);{Document.write(names[i] +”<br/>”);}document.write(names.reverse() +”<br/>”);document.write(names.sort() +”<br/>”);</script></body></html>5. Math object: This object is used to perform mathematical operations.Ex:<html><head><title>Math Object</title></head><body><script type = “text/javascript”>document.write(Math.min(4,6) + “<br/>”);Page | 43](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2fhtmlxmlandjavascript-130509022225-phpapp01%2f75%2fHtml-xml-and-java-script-43-2048.jpg&f=jpg&w=240)








