XML - SPLessons
SPLessons 5 Steps, 3 Clicks
5 Steps - 3 Clicks

XML CSS

XML CSS

shape Description

CSS, affectionately alluded to as CSS, is a straightforward plan dialect proposed to improve the way toward making site pages respectable. CSS handles the look and feels part of a site page. Utilizing CSS, you can control the shade of the content, the style of text styles, the separating between sections, how segments are estimated and laid out, what foundation pictures or hues are utilized, format designs,variations in the show for various gadgets and screen sizes and additionally an assortment of different impacts.

Advantages Of CSS

shape Description

The following are the different advantages of CSS.

XML With CSS

shape Description

The following is the syntax needs to be written to give link an XML with CSS. [xml]<?xml-stylesheet type="text/css" href="cssemployee.css"?> [/xml] The following is an example. cssemployee.css [xml]employee { background-color: pink; } firstname,lastname,email { font-size:25px; display:block; color: blue; margin-left: 50px; } [/xml] The Document Type Definition, known better by the acronym DTD, is not the same as the document type declaration, which is just the markup construct that contains markup declarations that include, among other things, the declarations of the DTD. Whereas, the DTD is the XML specification’s way to define a document model. It has an arcane syntax that is inherited from SGML. employee.dtd [xml]<!ELEMENT employee (firstname,lastname,email)> <!ELEMENT firstname (#PCDATA)> <!ELEMENT lastname (#PCDATA)> <!ELEMENT email (#PCDATA)> [/xml] A CDATA(Unparsed character Data) section is a markup construct whose contents are assumed not to have any markup i.e. the writers advises not to treat CDATA as information and so CDATA sections are not reflected in the set of properties of an XML document because using a CDATA section engages escaping for all of its unescaped content, thus not needing to escape individual characters. In short, CDATA can be defined as the text data that should not be parsed by the XML parser. If the application is being used for some reason is mandating the use of CDATA, then it is likely not a conforming XML processor or conforming to XML syntax conventions. A CDATA section begins with characters as the end delimiter. [java]<![CDATA[ characters with markup ]]>[/java] But, that end delimiter is the only way to end a CDATA section and so the XML processor knows to recognize the ]]> sequence of characters as a formal CDATA section end delimiter at all times. Therefore, it is very important in the text never to allow an end delimiter without a matching start delimiter already having been used. There is a need to escape something in the three characters if these three characters are present in the user data that is wrapped with XML. Using this construct, marking up markup content can be simplified. employee.xml [xml]<?xml version="1.0"?> <?xml-stylesheet type="text/css" href="cssemployee.css"?> <!DOCTYPE employee SYSTEM "employee.dtd"> <employee> <firstname>vimal</firstname> <lastname>jaiswal</lastname> <email>vimal@splessons.com</email> </employee> [/xml]

Summary

shape Key Points

  • CSS handles the look and feel part of a web page.
  • CDATA contains the text which is not parsed further in an XML document.
  • Now HTML attributes are being deprecated and it is being recommended to use CSS.