xml Flashcards
xml
- Extensible markup language
- Designed to store and transport data
- Released in late 90s it was created to provide an easy to store and self describing data
- Xml is designed to carry data not Not to display data
- Xml tags are not predefined All tags are user defined
- xml is platform independent and language independent
what is markup language
- markup language is modern system for highlighting or underlining a document Which is done by tags
Why xml
- Xmls platform independent and language independent: XML can be used to take data from programme like ms sql convert it into xml and then share that xml with other programmes and platforms We can communicate Between two platforms which is generally difficult
- In real world computer systems and database contains data in incompatible forms xml data stored in play in text format this provides software and hardware independent way of storing data
- Xml greatly reduces exchange between incompatible systems since the data can be read by different incompatible applications
4.
Syntax of X M L
<?xml version=”1.0” encoding=”UTF-8”?>
<root>
<child>
<subchild>----</subchild>
</child>
</root>
XML related technologies
1. XHTML
2. XMLDOM
3. XSL
* XSLT
* XSL
* XPATH
4. XQUERY(Used to query xml based data)
5. DTD(data definition language)
6. XSD(xml schema definiton(alt to dtd… Used to describestruc of xml doc )
7. XLink(Creating hyperlinks in xml documents)
8. XPointer(Used to Add hyperlinks to specific parts of xml doc)
9. SOAP(simple object acccess pr)(Protocol that Let’s you to access web services)
10. WSDL
11. RSS
12. RDF
13. SVG
XHTML
- Extensible html
- It is a Clearer adds stricter version of XML
- It belongs to the family of XML Markup languages
- It is introduced to make html more extensible and increase interoperability with other data
Xml Dom
- It is standard DOM That is used to manipulate xml
- It defines xml file it TREE structure
XSL
i) XSLT (xsl transform)
ii) XSL
iii)XPath
i) It transforms XML into other formats, like html.
ii) It is used for formatting XML to screen, paper etc.
iii) It is a language to navigate XML documents.
dtd
1.It is an standard which is used to define the legal elements in an XML document.
2.It is used to defend documents structure with list of legal elements and attributes
valid xml for DTD
- Before proceeding with XMLDTD we need to cheque the validation in xml document is well formed if it contains corrupt syntax
emploee.xml
<?xml version=”1.0”?>
<!DOCTYPE employee SYSTEM “employee.dtd”>
<employee>
<firstname>vimal</firstname>
<lastname>jaiswal</lastname>
<email>vimal@javatpoint.com</email>
</employee>
employee.dtd
<!ELEMENT employee (firstname,lastname,email)>
<!ELEMENT firstname (#PCDATA)>
<!ELEMENT lastname (#PCDATA)>
<!ELEMENT email (#PCDATA)>
Description of DTD
<!DOCTYPE employee : It defines that the root element of the document is employee.
<!ELEMENT employee: It defines that the employee element contains 3 elements “firstname, lastname and email”.
<!ELEMENT firstname: It defines that the firstname element is** #PCDATA typed. (parse-able data type).**
<!ELEMENT lastname: It defines that the lastname element is #PCDATA typed. (parse-able data type).
<!ELEMENT email: It defines that the email element is #PCDATA typed. (parse-able data type).
XML entity declaration
XML declaration can also be defined by special strings that can be used in xml file
1. An ampersand (&)
2. An entity name
3. A semicolon (;)
syn :
<!entity entity-name “entity value”>
author.xml
<?xml version=”1.0” standalone=”yes” ?>
<!DOCTYPE author [
<!ELEMENT author (#PCDATA)>
** <!ENTITY sj “Sonoo Jaiswal”> **
]>
<author>&sj;</author>
- CSS (Cascading Style Sheets) can be used to add style and display information to an XML document. It can format the whole XML document.
syn: <?xml-stylesheet type=”text/css” href=”emp.css”>
cssemployee.css
employee
{
background-color: pink;
}
firstname,lastname,email
{
font-size:25px;
display:block;
color: blue;
margin-left: 50px;
}
employee.dtd
<!ELEMENT employee (firstname,lastname,email)>
<!ELEMENT firstname (#PCDATA)>
<!ELEMENT lastname (#PCDATA)>
<!ELEMENT email (#PCDATA)>
Let’s see the xml file using CSS and DTD.
employee.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@javatpoint.com</email>
</employee>