Xml For Dummies   Chapter 17 Serving Up The Data Xml And Databases
Upcoming SlideShare
Loading in...5
×
 

Xml For Dummies Chapter 17 Serving Up The Data Xml And Databases

on

  • 2,942 views

 

Statistics

Views

Total Views
2,942
Slideshare-icon Views on SlideShare
2,935
Embed Views
7

Actions

Likes
3
Downloads
74
Comments
0

3 Embeds 7

http://www.slideshare.net 4
http://milpallares.blogspot.com 2
http://milpallares.blogspot.mx 1

Accessibility

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Xml For Dummies   Chapter 17 Serving Up The Data Xml And Databases Xml For Dummies Chapter 17 Serving Up The Data Xml And Databases Presentation Transcript

    • XML For Dummies
      Book Author : Lucinda Dykes & Ed Tittle
      Slides Prepared By: Son TN
      Chapter 17 : Serving Up the Data: XML and Databases
    • Contents
      Using Databases with XML
      Creating XML from Database Files
      Using XML with Access 2003
    • 17.1 Using Databases with XML
      The connection between databases and XML is a logical one.
      All the major database systems — from Oracle to Microsoft SQL Server and beyond — have XML utilities that help you work with XML in the context of the database.
      Another common use of databases with XML is to let the database serve as an index to the content described with XML.
      If your solution includes a database, you need to think about how, if at all, your XML documents will interface with the database.
    • 17.1 Using Databases with XML (Cont)
      For example, an online article archive uses XML as the format for describing articles.
      An online article archive, takes advantage of the individual strengths of both XML and databases
      XML provides detailed structural information about the articles, which a database can’t handle very well.
      The data about the articles (the article metadata) stored in the database can be searched and filtered according to all manner of criteria — something XML isn’t particularly suited for.
    • 17.1.1 Text-intensive XML
      Text-intensive XML documents can also be configuredto work with a database.
      For example :
      A database can store paragraphs of text.
      An XML document can then connect with the database to import a particular block of text information to add to the content of the XML document.
      When the information in the database changes, the content of the XML document changes, too.
    • 17.1.2 Data-intensive XML
      Interacting with a database is “natural” for XML documents with data intensive content.
      Businesses commonly use databases to store data intensive content.
      This content can be imported from a database to populate XML documents with the most current version of the data.
      The XML document can then be displayed in print, on a Web page, in an online form, or on a mobile device.
    • 17.2 Creating XML from Database Files
      In the following section , We focus on using an Access database with XML documents in :
      Microsoft Word 2003.
      Microsoft InfoPath.
      AltovaXMLSpy.
    • 17.2.1 Using Word 2003
      All versions of Word 2003 can save documents in XML format.
      To import database information into a Word 2003 XML document, follow these steps:
      Open Word 2003, choose File➪New from the main menu, and then choose XML Document from the New Document task pane on the left.
      Select View➪Toolbars➪Database.
      Click the Insert Database icon on the Database toolbar.
      Click the Get Data button, browse to the bookstore.mdb file, and then click Open.
      If you want to use Word’s default table formatting options, move on to Step 6.
      Click the Insert Data button in the Database dialog box.
      From the Insert Data dialog box, choose All or a range of values for the Insert records option and then click OK.
    • 17.2.1 Using Word 2003 (Cont)
      Your XML file now displays the database information in a table, as
      shown in Figure 17-1.
    • 17.2.2 Using InfoPath
      InfoPath allows you to import database information into a blank InfoPath form.
      To import database information and create a new InfoPath form, follow these steps:
      Open InfoPath, and choose File➪Design a Form to open the Design a Form task pane.
      From the Design a Form task pane, choose New from Data Connection.
      Choose Database from the Data Connection Wizard and then click Next.
      Click the Select Database button in the next screen in the wizard, browse to the location of bookstore.mdb, and then click Open.
      Click Next in the wizard screen and then enter a name for the data connection in the text field labeled “Enter a name for this data connection.”
    • 17.2.2 Using InfoPath (Cont)
      Click Finish.
      Insert the cursor in the Drag Data Fields Here box on the form template.
      Select the dataFields folder from the task pane and then right-click the folder.
      Choose Section with Controls from the contextual menu.
      To format the display, right-click the Repeating Section label; choose Borders and Shading; use the main tab of the Borders and Shading dialog box to make your selections for border width, color, and size; and then click the Shading tab to choose a background color.
      With your data fields out of the way, insert the cursor into the Drag Query Fields Here box on the form template.
      Select the queryFields folder from the task pane, and right-click the folder.
    • 17.2.2 Using InfoPath (Cont)
      Choose Section with Controls from the contextual menu.
      Put the cursor in the Query box, and add a title for this box. Do the same in the Data box (we used Book Query and Book Data for our titles).
      In the area that says Click to Add a Title, enter a title for your form.
      In the area that says Click to Add Form Content, add some instructions for form users.
      Choose File➪Save and then click Save in the Microsoft Office InfoPath window to save the form design changes.
      Enter a name for your form (we used Book.xsn) and then click Save.
      Choose File➪PreviewForm➪Default to create a functional Preview file, and test out the form!
    • 17.2.2 Using InfoPath (Cont)
      Figure 17-2 shows the Preview version of the Book form.
    • 17.2.3 Using XMLSpy
      XMLSpy is a multifaceted XML tool.
      Follow these steps to import information from a database and create a new XML file:
      Open XMLSpy, and choose Convert➪Import Database Data from the main menu.
      In the Import Database data dialog box, choose Convert Database Data into XML, and click OK.
      Select Microsoft Access (ADO) from the Select a Source Database window and then click Next.
      In the Select a MS Access Database window, click the Browse button and navigate to bookstore.mdb; then click Next.
    • 17.2.3 Using XMLSpy (Cont)
      In the Import Database Data window, click the Choose Database Table button.
      In the Choose a Database Table window, select Book and then click OK.
      In the Import Database Data window, go to the Import Settings section and choose the Compatible with Schema Data Types option, check the boxes for the Exclude Primary/Foreign Keys and the Create Empty Elements from Empty Fields options, and then click the Import button.
      Click the Text tab at the bottom of the file to see the underlying markup.
    • 17.2.3 Using XMLSpy (Cont)
    • 17.2.3 Using XMLSpy (Cont)
      Here’s how to export data from an XML file to a database:
      Choose File➪Open from the main menu in XMLSpy. Navigate to your XML file in the Open dialog box and then click Open.
      Choose Convert➪Export to Text Files/Database.
      From the Export to Text Files/Databases dialog box, select Convert XML into Text Files or Database Data and then click OK.
      In the Automatic Fields section of the Export to Text Files/Database window, uncheck the Independent Primary Key Counter for Every Element box and then click the Export to Database button.
      Click OK in the next window (Export to Database) to create the database file.
    • 17.2.3 Using XMLSpy (Cont)
      Open the database file in Access and then click the Row table to view the table contents, as shown in Figure 17-4.
    • 17.3 Using XML with Access 2003
      Using Access 2003, you can import data from an XML file as well as export data as XML files.
      The import and export methods in Access 2003 also allow you to import and export XML data, schema information, and/or presentation information to and from :
      Microsoft SQL Server 2000 Desktop Engine,
      Microsoft SQL Server 7.0 or later.
      The Microsoft Jet Database Engine.
      Access 2003 also supports the use of XSLT files when importing or exporting XML data.
    • 17.3 Using XML with Access 2003 (Cont)
      Follow these instructions to import data from an XML file into Access 2003:
      Select File➪New to create a new database file.
      Select Blank Database from the New list in the New File task pane.
      Enter a name for the database in the File New Database window and then click Create.
      To get the import ball rolling, choose File➪Get External Data➪Import.
      In the Import dialog box, choose XML from the Files of Type dropdown menu and then browse to the location of your XML file. Select your XML file and then click Import.
    • 17.3 Using XML with Access 2003 (Cont)
      Click the Options button to show all the import options, as shown in Figure 17-5.
    • 17.3 Using XML with Access 2003 (Cont)
      Follow these instructions to export data from an Access 2003 table to an XML file:
      Open the database table in Access and then select File➪Export.
      In the Export dialog box, choose XML in the Save as Type drop-down menu and then click the Export button. (As Figure 17.6 )
      Depending on your choices in the Export XML dialog box, Access 2003 will create the following files:
      • An XML file
      • An XML Schema file
      • An XSLT file
    • 17.3 Using XML with Access 2003 (Cont)
      In addition to exporting XML files from Access 2003 database tables, you can export Access 2003 database tables as RTF (Rich Text Format) files.
    • 17.4 Summary
      In this chapter, you have the opportunity to get some hands-on practice with XML and databases.
      Using three different software applications (Word, InfoPath, and XMLSpy), you find out how to import data from a database to an XML document and how to export data from an XML document to a database.
      You also discover how to export data directly from Access 2003 in several different file formats.