Lecture 2 - Using XML for Many Purposes

15
XML FOR DUMMIES XML FOR DUMMIES Book author: Lucinda Dykes and Ed Tittle Part 1 : XML Basics Chapter 2: Using XML for Many Purposes http://it-slideshares. blogspot.com

description

XML Basic - XML FOR DUMMIES

Transcript of Lecture 2 - Using XML for Many Purposes

Page 1: Lecture 2 - Using XML for Many Purposes

XML FOR DUMMIESXML FOR DUMMIES

Book author: Lucinda Dykes and Ed TittlePart 1 : XML BasicsChapter 2: Using XML for Many Purposes

http://it-slideshares.blogspot.com

Page 2: Lecture 2 - Using XML for Many Purposes

ContentsContents

1

The Many Faces of XML2

Alphabet Soup: Even More XML3

Moving Legacy Data to XML

http://it-slideshares.blogspot.com

Page 3: Lecture 2 - Using XML for Many Purposes

1. Moving Legacy Data to XML 1. Moving Legacy Data to XML

You may be able to import, export, and otherwise shape-shift your current data into an XML format. Here’s glimpse of what’s possible:

♦ Is your data in spreadsheets? ○ You can transform this data into XML format by creating an

XML schema for the data and then using that schema in Excel 2003 to create a map that connects the spreadsheet cell data and th schema. ○ You can then export the spreadsheet file as an XML

document. ♦ Is your data in database tables? ○ In access 2003, you can export data in XML format from one

or more tables. ○ Access can create and export an XML document

○ You can also use XMLSpy to import and convert database information various databases(including Microsoft SQL Server, Ocracle, MySQL,..) into XML format.

♦ Is your data in CSV(comma –separeted values) text files? ○ You can use XMLSpy to import and convert these text file into

XML format.

Page 4: Lecture 2 - Using XML for Many Purposes

2. The Many Faces of XML2. The Many Faces of XMLCreate XML-enabled Web pages. ♦ All this XML versatility does require just

a little extra tweaking. ♦ When it comes to actually adding

formatting information, you hava a couple of options.

♦ You can link an XML document to a CSS stylesheet. Which would make the

information easier to read as well as visually interesting. Figure2-1a. An unformatted XML file in a Web browser.

Page 5: Lecture 2 - Using XML for Many Purposes

♦ If you use an XSLT stylesheet with your XML document. You can generate an HTML page with a formatted display; with almost no effort. As figure 2-1b, the information is now in a much more usable form for the Web.

♦ This XML file and XSLT stylesheet were both generated from a database table in Access 2003.

Page 6: Lecture 2 - Using XML for Many Purposes

The Many Faces of XML(cont..)The Many Faces of XML(cont..)

Print publishing with XML. ♦ All versions of Word 2003 and Excel 2003 can

save documents in XML format. ♦ XML is now even easier to use with print

documents. ♦ XML files are text files=>you can open, modify,

or create them in any text editor. ♦ Word 2003 uses a built-in schema document

called WordML for XML documents. ♦ When you open an XML document in Word, you

can display the document in one of two ways: ○ As XML markup with visible XML tags, as

shown in figure 2-2. ○ As content without tags, as shown in figure

2-3.

Page 7: Lecture 2 - Using XML for Many Purposes
Page 8: Lecture 2 - Using XML for Many Purposes

The Many Faces of XML(cont..).The Many Faces of XML(cont..).Print publishing with XML.

♦ If you have an XSLT stylesheet for your XML document, you can open the “transformed” XML document in Word by using the drop-down menu from th Open button(File-> Open,as shown in figure 2-4).

♦You can also sava an XML file as a Word template and use it to create new XML file in the same format.

1. Save the XML file in Word, using the .dot extension

2. Atteach a schema to th tamplate you just saved(Tools-> Templates and ADD-Ins->XML Schema.)

Page 9: Lecture 2 - Using XML for Many Purposes

The Many Faces of XML(cont..).The Many Faces of XML(cont..).

Using XML for business forms. ♦ Forms are a very useful way to collect data and

can be used in text document or on a Web page.

♦ You can create XML documents that include HTML forms by adding an XSLT stylesheet to generate the HTML form markup.

♦ You can also use InforPath for create form base on an XML document or XML schema,or design your own form.(InfoPath : part of Office 2003.).Figure 2-5 shows preview of an InfoPath form that was automatically created from an XML schema and then poppulated with data from an XML file.

Page 10: Lecture 2 - Using XML for Many Purposes
Page 11: Lecture 2 - Using XML for Many Purposes

The Many Faces of The Many Faces of XML(cont..).XML(cont..).

Incorporating XML into business processes. ♦ Multiple uses of the same set of data. ♦ Getting stared in Excel. When you open an XML file in Excel, an Open XML dialog

box displays, and you can choose among the following three options for opening the XML file:

○ As an XML list ○ As a read-only workbook. ○ As a display in the XML Source task pane. ♦ The drap-and-drop task-pane method is easy to use and

offers a distinct advantage. Figure 2-6, for example,shows an Excel worksheet with only three columns if our book data: Tittle, Author. And ISBN.

Page 12: Lecture 2 - Using XML for Many Purposes

The Many Faces of XML(cont..).The Many Faces of XML(cont..).

Serving up XML from a database. ♦ It should come as surprise to

you that you can import or export database information in XML format to create XML files from database tables or database tables form XML files.

♦ If you are new to database or exist database, you can import and export XML data by using a program such as Access 2003 or XMLSpy.

Page 13: Lecture 2 - Using XML for Many Purposes

3. Alphabet Soup: Even More XML.3. Alphabet Soup: Even More XML.

List introduce the major members of the XML group: ♦ XLink and XPointer : are XML languages for hyperlinks and for

document components with ID attributes. ♦ XSLT, XPath, and XSL-FO: All three of these XML technologies

are parts of XSL: ○XSLT is designed to transform raw XML into complex display

formats such a tables and indexes. ○ XPath is an XML language used to navigate an XML

document. XPath is used with both XSLT and XPointer. ○ XSL-FO(XSL-Formatting Objects) is used for completely

formatting the layout, style, and pagination of documents that are rendered in print format.

♦ XForms: XForms is an XML language reated to collect and submit form information as XML data. XForm uses both XPath and XML schemas.

♦ XML Encyption and XML Signature: XML Encyption is an XML language developed for secure exchange of XML data. XML Signature is also used for secure data exhchange. If provides syntax and processing rules for digital signature.

Page 14: Lecture 2 - Using XML for Many Purposes

Alphabet Soup: Even More XML.(conti..)Alphabet Soup: Even More XML.(conti..) List introduce the major members of the XML group(conti..):

♦ XML Query: XML Query is an XML language designed to query, request information from any collection of XML data, whether that data is contained in an XML file or a database.

♦ SOAP: SOAP(Simple Object Access Protocol) is an XML language used for communication between a Web page reuqesting a Web service

and the Web service application. ♦ SVG and SMIL: SVG(Scalable Vector Graphics)

and SMIL (Synchronized Multimedia Integation Language) are XML language for multimedia.

Page 15: Lecture 2 - Using XML for Many Purposes

Thank you.

The end chapter two.http://it-slideshares.blogspot.com