XP 1 New Perspectives on XML Binding XML Data with Internet Explorer.

Slides:



Advertisements
Similar presentations
XP 1 Developing a Basic Web Site Tutorial 2: Web Site Structures & Links.
Advertisements

Microsoft Excel 2003 Illustrated Complete Excel Files and Incorporating Web Information Sharing.
XP Adding Hypertext Links to a Web Page. XP Objectives Create hypertext links between elements within a Web page Create hypertext links between Web pages.
XP New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 2 1 Microsoft Office Access 2003 Tutorial 2 – Creating And Maintaining A.
Tutorial 16 Working with Dynamic Content and Styles.
Using Visual Basic 6.0 to Create Web-Based Database Applications
Tutorial 6 Working with Web Forms
Tutorial 8 Designing a Web Site with Frames. XP Objectives Explore the uses of frames in a Web site Create a frameset consisting of rows and columns of.
JavaScript 101 Lesson 5: Introduction to Events. Lesson Topics Event driven programming Events and event handlers The onClick event handler for hyperlinks.
Tutorial 6 Working with Web Forms. XP Objectives Explore how Web forms interact with Web servers Create form elements Create field sets and legends Create.
Create a Web Site with Frames
Browser and Basics Tutorial 1. Learn about Web browser software and Web pages The Web is a collection of files that reside on computers, called.
Tutorial 11: Connecting to External Data
Tutorial 3: Adding and Formatting Text. 2 Objectives Session 3.1 Type text into a page Copy text from a document and paste it into a page Check for spelling.
XP Tutorial 5New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Designing a Web Site with Frames Using Frames to Display Multiple Web Pages Tutorial.
XP New Perspectives on Microsoft Access 2002 Tutorial 71 Microsoft Access 2002 Tutorial 7 – Integrating Access With the Web and With Other Programs.
Access Tutorial 8 Sharing, Integrating, and Analyzing Data
XP New Perspectives on Integrating Microsoft Office XP Tutorial 1 1 Integrating Microsoft Office XP Tutorial 1 – Integrating Word and Excel.
Chapter 12 Creating and Using XML Documents HTML5 AND CSS Seventh Edition.
®® Microsoft Windows 7 Windows Tutorial 6 Searching for Information and Collaborating with Others.
WORKING WITH NAMESPACES
XP New Perspectives on XML Tutorial 4 1 XML Schema Tutorial – Carey ISBN Working with Namespaces and Schemas.
XP New Perspectives on XML Tutorial 3 1 DTD Tutorial – Carey ISBN
XP Tutorial 6New Perspectives on HTML and XHTML, Comprehensive 1 Creating Web Page Forms Designing a Product Registration Form Tutorial 6.
Copyright © Texas Education Agency, All rights reserved. 1 Web Technologies Website Development with Dreamweaver.
XP New Perspectives on Microsoft Access 2002 Tutorial 51 Microsoft Access 2002 Tutorial 5 – Enhancing a Table’s Design, and Creating Advanced Queries and.
Web Technologies Website Development Trade & Industrial Education
Tutorial 1 Getting Started with Adobe Dreamweaver CS3
XP New Perspectives on Browser and Basics Tutorial 1 1 Browser and Basics Tutorial 1.
Using Visual Basic 6.0 to Create Web-Based Database Applications
Adding User Interactivity – Lesson 51 Adding User Interactivity Lesson 5.
Website Development with Dreamweaver
XP Mohammad Moizuddin Creating Web Pages with HTML Tutorial 1 1 New Perspectives on Creating Web Pages With HTML Tutorial 1: Developing a Basic Web Page.
Tutorial 8 Designing a Web Site with Frames. XP Objectives Explore the uses of frames in a Web site Create a frameset consisting of rows and columns of.
XP New Perspectives on The Internet, Sixth Edition— Comprehensive Tutorial 8 1 Creating Effective Web Pages Creating HTML Documents Tutorial 8.
1 Tutorial 13 Validating Documents with DTDs Working with Document Type Definitions.
XP New Perspectives on Integrating Microsoft Office XP Tutorial 2 1 Integrating Microsoft Office XP Tutorial 2 – Integrating Word, Excel, and Access.
HTML Concepts and Techniques Fourth Edition Project 12 Creating and Using XML Documents.
XP New Perspectives on Microsoft Access 2002 Tutorial 21 Microsoft Access Tutorial 2 – Creating And Maintaining A Database.
XP New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 2 1 Microsoft Office Access 2003 Tutorial 2 – Creating And Maintaining A.
XP Tutorial 6 New Perspectives on JavaScript, Comprehensive1 Working with Windows and Frames Enhancing a Web Site with Interactive Windows.
Tutorial 8 Designing a Web Site with Frames. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Explore the uses of frames.
USING XML AS A DATA SOURCE. Data binding is a process by which information in a data source is stored as an object in computer memory. In this presentation,
1 Introduction  Extensible Markup Language (XML) –Uses tags to describe the structure of a document –Simplifies the process of sharing information –Extensible.
XP 1 Creating an XML Document Developing an XML Document for the Jazz Warehouse XML Tutorial.
XP New Perspectives on XML, 2nd Edition Tutorial 2 1 TUTORIAL 2 WORKING WITH NAMESPACES.
New Perspectives on XML, 2nd Edition Tutorial 9B1 USING XML AS A DATA SOURCE TUTORIAL 9B.
Tutorial 6 Working with Web Forms. XP Objectives Explore how Web forms interact with Web servers Create form elements Create field sets and legends Create.
Tutorial 6 Working with Web Forms. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Explore how Web forms interact with.
XP Tutorial 16 New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Working with Dynamic Content and Styles Creating a Dynamic Table of Contents.
Tutorial 91 Databases A database is an organized collection of related information stored in a file on a disk A database allows companies to store information.
1 Tutorial 12 Working with Namespaces Combining XML Vocabularies in a Compound Document.
Exploring Microsoft Microsoft FrontPage Chapter 21 Exploring Microsoft FrontPage 2002 Chapter 1 Creating a Home Page: Introduction to MS FrontPage.
Tutorial 6 Working with Web Forms. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Explore how Web forms interact with.
XP Review 1 New Perspectives on JavaScript, Comprehensive1 Introducing HTML and XHTML Creating Web Pages with HTML.
XP New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 8 1 Microsoft Office Access 2003 Tutorial 8 – Integrating Access with the.
XP New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 6 1 Microsoft Office Access 2003 Tutorial 6 – Creating Custom Forms.
XP New Perspectives on Macromedia Dreamweaver MX 2004 Tutorial 5 1 Adding Shared Site Elements.
Connecting to External Data. Financial data can be obtained from a number of different data sources.
Embedding XML in HTML: Using Data Islands Eugenia Fernandez IUPUI.
XP New Perspectives on Creating Web Pages With Word Tutorial 1 1 Creating Web Pages With Word Tutorial 1.
Generating XML Data from a Database Eugenia Fernandez IUPUI.
XP Tutorial 10 New Perspectives on JavaScript, Comprehensive 1 Working with Dynamic Content and Styles Creating a Dynamic Table of Contents.
Access Tutorial 8 Sharing, Integrating, and Analyzing Data
Microsoft Office Access 2003
Microsoft Office Access 2003
New Perspectives on XML
Microsoft Office Access 2003
New Perspectives on XML
Presentation transcript:

XP 1 New Perspectives on XML Binding XML Data with Internet Explorer

XP Creating Web Pages with XML Tutorial 2 2 Using XML as a Data Source Data binding is a technique where the Web page’s content is drawn from a data source. Data binding allows you to attach data from an XML document to a Web page. Data binding frees the data from the format in which it is displayed so the same data source can be combined with several different Web pages.

XP Creating Web Pages with XML Tutorial 2 3 Using XML as a Data Source In this tutorial, the data source is an XML document containing information about the employees at Freezing Point. The Web pages use placeholders which we will later populate with data from two XML documents.

XP Creating Web Pages with XML Tutorial 2 4 Opening the Web Page Open the file FP1text and save as FP1.htm. Open and view FR1.htm using Internet Explorer. page title text subtitle text descriptive text hyperlink to the page’s author information about an employee buttons to display different employees employee photograph employee name

XP Creating Web Pages with XML Tutorial 2 5 Using Data Binding to Create a Final Web Page This figure shows how data binding will be used to create a final Web page

XP Creating Web Pages with XML Tutorial 2 6 Fields, Records, and Recordsets Data in a data source is organized by fields, records, and recordsets. A field is an element that contains a single item of information such as an employees last name. A record is a collection of those fields. A recordset is a collection of records.

XP Creating Web Pages with XML Tutorial 2 7 Fields, Records, and Recordsets This figure shows fields, records, and a recordset of an XML document

XP Creating Web Pages with XML Tutorial 2 8 Data Islands The first step in data binding is to attach the Web page to a recordset. The attached data is called a data island. They can be either external files or code entered into the HTML file. The syntax to create a data island from an external file is: Here, id is the id name assigned to the data island URL is the filename and location of the external XML file

XP Creating Web Pages with XML Tutorial 2 9 Data Islands For example: This creates a data island named Company attached to Company.xml.

XP Creating Web Pages with XML Tutorial 2 10 Data Islands To insert a data island directly into the HTML file, use this syntax: xml code While this technique can be used, it is not recommended. After all, the philosophy of XML is to separate data content from data formatting.

XP Creating Web Pages with XML Tutorial 2 11 Data Islands Data islands are stored by the XML parser as a Data Source Object (DSO). The DSO takes care of the interaction between the Web page and the data island. Also, program code can be written to control the actions of the DSO such as specifying which records will be displayed in the Web page at any one time.

XP Creating Web Pages with XML Tutorial 2 12 Data Islands If the XML document is not well formed or valid, IE will not create a DSO. The DSO is created only once for each session. This means that if the contents of the data source are modified after the DSO is created, the changes will not be reflected in the Web page until it is refreshed or until the next time the page is opened.

XP Creating Web Pages with XML Tutorial 2 13 Creating a Data Island This figure shows how to create the data island name of data island XML document containing data for the Web page

XP Creating Web Pages with XML Tutorial 2 14 Binding XML Elements to HTML Tags After the data island has been created, the elements in the XML document need to be bound to the HTML file. The syntax is: Here, tag is the name of the HTML tag, id is the name of the data island, and field is the name of the field in the data source.

XP Creating Web Pages with XML Tutorial 2 15 HTML Tags that Support Data Binding in Internet Explorer This figure shows HTML tags that support data binding in Internet Explorer

XP Creating Web Pages with XML Tutorial 2 16 Binding XML Elements to HTML Tags This figure shows how to bind XML elements to HTML tags data source of the bound element bound element Placeholder text is deleted

XP Creating Web Pages with XML Tutorial 2 17 Binding XML Elements to HTML Tags Continued This figure shows how to bind the rest of the FPINFO.XML elements

XP Creating Web Pages with XML Tutorial 2 18 Binding to an XML Attribute Attributes, like the Status attribute of the Employee element, are treated by the DSO as fields. If the attribute is part of a record element, it is easy to bind attribute values to a Web page.

XP Creating Web Pages with XML Tutorial 2 19 Binding to an XML Attribute This code has the ID attribute as part of the Employee element: Alice Ashman Accounting

XP Creating Web Pages with XML Tutorial 2 20 Binding to an XML Attribute It is interpreted by the DSO as: E304 Alice Ashman Accounting

XP Creating Web Pages with XML Tutorial 2 21 Binding to an XML Attribute Attribute are more complicated when they are part of a field element: Alice Ashman Accounting

XP Creating Web Pages with XML Tutorial 2 22 Binding to an XML Attribute In the above code, the attribute is still treated by the DSO as a field element. A DSO treats the above code as: E304 Alice Ashman Accounting

XP Creating Web Pages with XML Tutorial 2 23 Binding to an XML Attribute However, this leaves the text "Alice Ashman" unassociated with a field. Remember to reference all character data within an element using the $Text field. The DSO interprets this code as: E304 Alice Ashman Accounting

XP Creating Web Pages with XML Tutorial 2 24 Binding to an XML Attribute If the attribute is part of a field element, it is still treated by the DSO as a field element. The field element containing the attribute becomes a record element. It is a good idea not to use attributes in field elements if you plan to do data binding.

XP Creating Web Pages with XML Tutorial 2 25 Binding to an XML Attribute This figure shows STAFF_INFO data displayed in the Web page bound element }

XP Creating Web Pages with XML Tutorial 2 26 The Data Source Object ActiveX Data Objects (ADO) is a data-access technology developed by Microsoft. ADO allows you to work with the Data Source Object by applying a method or by changing one of the properties of the DSO. The syntax for applying a method is: id.recordset.method

XP Creating Web Pages with XML Tutorial 2 27 The Data Source Object Here, id is the name of the data island in the Web document and method is the name of the method supported by ADO. There are several methods that can be applied to DSOs.

XP Creating Web Pages with XML Tutorial 2 28 The Data Source Object This figure shows a few available recordset methods

XP Creating Web Pages with XML Tutorial 2 29 The Data Source Object For example, if you want to display the last record in a DSO whose id is “Staff_Info”, run the following method: Staff_Info.recordset.moveLast( ) The simplest way to run a method is to assign the method to the onClick event handler of a as shown below:

XP Creating Web Pages with XML Tutorial 2 30 The Data Source Object When the user clicks the button, IE runs the command indicated by the onClick event handler, displaying the last record.

XP Creating Web Pages with XML Tutorial 2 31 Assigning a Recordset Method This figure shows how to enter the movefirst( ) method Move to the 1 st record in the recordset when this button is clicked

XP Creating Web Pages with XML Tutorial 2 32 Assigning a Recordset Method Continued This figure shows how to enter the remaining recordset methods move to the previous record move to the next record move to the last record

XP Creating Web Pages with XML Tutorial 2 33 Table Binding Using table data binding, each record can be displayed in a different row of a table. The syntax is:

XP Creating Web Pages with XML Tutorial 2 34 Table Binding In the example, id is the name of the data island, field1, field2 are the fields from the recordset.

XP Creating Web Pages with XML Tutorial 2 35 Page Binding As you add more records to your XML document, a table can become long and unwieldy. One way to fix this is to give the user the option of limiting the number of records displayed at any one time. The user can then move forward of backward that number of records at a time. This is called paging.

XP Creating Web Pages with XML Tutorial 2 36 Page Binding To specify the page size, add the dataPageSize attribute to the tag: dataPageSize=“number” number is the number of records you want displayed in a single page.

XP Creating Web Pages with XML Tutorial 2 37 Navigating a Table Page A unique identifier must be assigned to a table using the ID attribute before writing a command to navigate a table page. The syntax to do this is: Here, id is the name you assign to the table object. This is needed because the commands to navigate the table pages act on the table itself not the recordset.

XP Creating Web Pages with XML Tutorial 2 38 Table Methods and Properties These figures show some table methods and properties

XP Creating Web Pages with XML Tutorial 2 39 Table Methods and Properties To run these commands, add the command to the onClick event handler of a tag. For example, to move to the last page in a data table named “StaffTable”, you enter the attribute: onClick=“StaffTable.lastPage( )”

XP Creating Web Pages with XML Tutorial 2 40 Hierarchical Records This figure shows the layout of the EMP2.XML document

XP Creating Web Pages with XML Tutorial 2 41 Hierarchical Records To bind the Employee fields in the previous slide to a table, you create a table as follows: …

XP Creating Web Pages with XML Tutorial 2 42 Draft of the Final Web Page This figure shows the draft of the final Web page employee information grouped by department

XP Creating Web Pages with XML Tutorial 2 43 The Final Web Page This figure shows the final Web page

XP Creating Web Pages with XML Tutorial 2 44 Summary Data binding is a technique where the Web page’s content is drawn from a data source. The first step in data binding is to attach the Web page to a recordset. The attached data is called a data island. They can be either external files or code entered into the HTML file. ActiveX Data Objects (ADO) is a data-access technology developed by Microsoft. ADO allows you to work with the Data Source Object by applying a method or by changing one of the properties of the DSO.