Presentation is loading. Please wait.

Presentation is loading. Please wait.

X M L Extensible Markup Language It is a cross platform tool or a language to achieve data transfer between the cross platform. Note  1.XML is not a replacement.

Similar presentations


Presentation on theme: "X M L Extensible Markup Language It is a cross platform tool or a language to achieve data transfer between the cross platform. Note  1.XML is not a replacement."— Presentation transcript:

1 X M L Extensible Markup Language It is a cross platform tool or a language to achieve data transfer between the cross platform. Note  1.XML is not a replacement for HTML. 2. It is used to present the data in a formatted matter. 3.XML is used to represent the data. 4.XML is used to represent the data and it is not having any capability to perform any tasks on its own.Always an application is required in order to work with the XML documents.

2 For eg  10 Sai 9500 The above XML document might give an illusion stating the information belongs to an employee but still the XML doc. Cant do any thing on its own for the system it is considered as a same information wrapped in the user defined things.

3 Well formed XML doc  it is used for representing the data only. Valid XML doc  it is used for representing the data along with its definitions. Where the definitions of the XML document can be provided using either the Data Type Definitions (DTD) or XML Schema Definitions(XSD) file XML Valid XML doc Well Formed XML doc

4 Rules for writing a Well Formed XML doc The extension for the file should be XML. XML documents are case sensitive files and hence the tags and the attribute values of the documents should be maintained in proper case. XML document should have atleast one root element which can have one or more Child elements. Structure of a Well Formed XML doc -----

5 Rules for writing a Well Formed XML doc There are no predefined tags provided for the XMl documents and hence the XML doc will be defined based on the user defined tags only. Where a tag is a string which will be enclosed within an angular basis. What ever the tags that are opened in an XML document it is mandatory to close those tags. When ever the XML document is defined using a hierarchy of elements then it is mandatory to close the elements in the same hierarchy.

6 Valid XML document When ever the XML document is designed based on the DTD file then it is said to be valid XML document.

7 It is used to provide the definitions for the data to be used or to be provided in the XML document. Where the definitions includes  The no of times the elements to be used in the document.  if any additional information has to be provided for the elements used in the documents.  It can also be used to provide the definitions for the named entities to be used in the document. Data Type Definitions

8 In order to define a DTD file it is been defined with support of 3 Tags  1] ELEMENT  it is used to specify the element to be used in the XML document and their occurrences in that document. Syntax  where wild card is an optional value which is used to specify the no of occurrences of the element within the document. Wild cardMin Occurrences Max Occurrences ?01 +1Any *0any

9 For eg: Based on the above defintions an XML file has to be designed. 101 Kamala 10000 ----- -----

10 ATTLIST  It is used for providing additional information for the elements placed on the XML document. Syntax  for e.g.:- XML doc  ---- ----

11 Note  there is no specification which specifies to use an attribute or an element within the XML document. For eg  XML Documents using elements 1001 Sudhir 1000 XML doc using Attribute Information -----------------------------

12 Points to remember where attribute Method should not be used When ever an element has to support multiple values then attributes can’t be used,since a single attribute can accept only a single value at a time. Whenever the information on the data for an element should be nested then attribute information cant be used..net provides rich class libraries in order to integrate XML documents defined using elements and hence it reduces the burden of the programmer to integrate XML documents within.net Note  dot net provides class libraries to work with XML documents defined using attributes but still the programming will become complex.

13 Entity  It is used to define a user specific named entities which can be used in the XML document. Note  when ever a named entity is used within a XML document then the value of the named entity will be substituted as a macro substitution within the XML document. for e.g  note  when ever in a XML document &SL; is used then in that position the value “sudhironline” will be substituted Entity

14 Note  by default XML document will support the following main entities  &lt  it stands for less than &gt  it stands for greater than &amp  it stands for ampersand &apos  it stands for apostaphe &quot  it stands for quotation. Entity

15 A DTD file definition can be binded to the XML Document in 2 ways  Internal DTD Binding  when ever the data type definitions are defined with the data within a XML document it is said to be internal DTD for e.g  ------------------ ------------------

16 External DTD Binding  when ever the data type definitions are specified in a DTD file and if it has been explicitly binded to the XML document then it is said to be external DTD binding. Syntax  to bind a DTD file to the XML Document note  if the data type definition file is present in the local drives of a system then If the DTD file is present on a web then http://localhost/emp.dtd

17 It acts like a compiler which is used for parsing the XML document such that its data can be represented on to the application. PARSERS XML Document Application XMLPARSERXMLPARSER

18 XML Parser is of 2 types 1] DOM [ Document Object Model] Parser if used for parsing the XML document then it compiles the entire XML document and the result of it will be maintained temporarily as a cache,information such that the data can be projected or used within the application DOM parsers is of 2 types  1.Non Validating DOM Parser 2.Validating DOM parser Non Validating DOM Parser  it is used for parsing the well formed XML Document by verifying only the rules of the XML Document. Note  if an non validating DOM Parser is used for parsing a valid XML document then if the document violates the definitions binded to the XML document still the data will be parsed and it will be loaded on to the memory such that the applications can use the data.

19 Validating DOM Parser  it is used for parsing a valid XML document. Note  if the document violates the definitions binded to it then the data will not be parsed and the system will raise an compilation error. Note  by default all the latest browsers are provided with non-violating DOM parsers.

20 SAX Parser [ simple API for XML parser ] It is an event based parser which parses only the data which has been requested by the user and hence it is also called as event based parser.

21 System.Data Data Set Write XML Write XML Schema Read XML Read XML Schema

22 Write XML  it is used to write the data present in the data member of dataset as a data for the XML document. Syntax  writexml(filename[,mode]) Where mode can be  IgnoreSchema(default mode) if used then only the data present in the dataset will be written into the XML document.  WriteSchema if used then the data present in the data members of dataset will be written on to the XML document,with its schema definitions  Diffgram if used then if any manipulations are performed then it will maintain the new data along with the older.

23 WriteXMLSchema  it is used to write only the schema definitions for the data present in the datamembers of dataset. ReadXML  it is used to read the data present in the XML document and it will store that data on to the dataset with the support of data members. Note  the parentElement present in the XML doc will be considered as a datamember in dataset. ReadXMLSchema  it is used to read only the schema definitions of the data present in the XML doc.


Download ppt "X M L Extensible Markup Language It is a cross platform tool or a language to achieve data transfer between the cross platform. Note  1.XML is not a replacement."

Similar presentations


Ads by Google