80 likes | 206 Views
Introduction to XML. MIS3502: Application Integration and Evaluation Paul Weinberg weinberg@temple.edu Presentation by David Schuff. A brief look at XML. Extensible Markup Language Considered to be a future standard for sending structured data over the web
E N D
Introduction to XML MIS3502: Application Integration and Evaluation Paul Weinberg weinberg@temple.edu Presentation by David Schuff
A brief look at XML • Extensible Markup Language • Considered to be a future standard for sending structured data over the web • From browser to person (business to consumer) • From application to application (business to business) • “Cousin” of HTML
Where XML fits in SGML • Standard Generalized Markup Language (SGML) • Specification for some kind of text and tags • Hypertext Markup Language (HTML) • Definition of specific tags for formatting web pages • Extensible Markup Language (XML) • Specification for defining your own tags for formatting data HTML XML
Simple XML Example • If this table were an XML document, it would look like this: <BEATLE> <NAME>John</NAME> <SSN>123456789</SSN> < BIRTHDATE >9/16/45</ BIRTHDATE ></BEATLE><BEATLE> <NAME>Ringo</NAME> <SSN>159487263</SSN> <BIRTHDATE>11/11/72</BIRTHDATE></BEATLE><BEATLE> <NAME>Paul</NAME> <SSN>321654987</SSN> <BIRTHDATE>2/20/50</BIRTHDATE></BEATLE> and so on…
The XML tags mean nothing on their own Something needs to define what tags are relevant for a particular document XML Schemas are the metadata for XML XML Schemas XML Schema for a Beatle <xsd:complexType name="Beatle" > <xsd:sequence> <xsd:element name="name" type="xsd:string"/> <xsd:element name="ssn" type="xsd:long"/> <xsd:element name="birthdate" type="xsd:date"/> </xsd:sequence> </xsd:complexType>
How does this help? • XML facilitates standards • XML is self-describing • XML is flexible • Industries can decide on a standard Schema • All messages can follow that standard • Makes sending data between companies easier • Order processing • Airline reservations
Example: Fixed Length Records Versus XML Using Fixed Length Records: David Schuff 123456789Fox School 01234567890123456789012345678901234567890 First Name, Characters 0-9 Last Name, Characters 10-19 SSN, Characters 20-28 School Name, Characters 29-40 You have to hard code where the fields start and their length, so the application knows which characters belong to which fields. What if I have a 15 character last name? What if the last name is provided before the first name?
Example: Fixed Length Records Versus XML Using XML: <PERSON> <NAME> <FIRST>David</FIRST> <LAST>Schuff</LAST> </NAME> <SSN>123456789</SSN> <SCHOOL>Fox School</SCHOOL> </PERSON> Because I have the DTD and use tags to match characters with data fields: I don’t care how long each piece of data is. I don’t care what order it arrives in. Extra fields can be included – I just retrieve a modified DTD.