 2004 Prentice Hall, Inc. All rights reserved. 1 Chapter 34 - Case Study: Active Server Pages and XML Outline 34.1 Introduction 34.2 Setup and Message.

Slides:



Advertisements
Similar presentations
XML-XSL Introduction SHIJU RAJAN SHIJU RAJAN Outline Brief Overview Brief Overview What is XML? What is XML? Well Formed XML Well Formed XML Tag Name.
Advertisements

WEB DESIGN TABLES, PAGE LAYOUT AND FORMS. Page Layout Page Layout is an important part of web design Why do you think your page layout is important?
 2004 Prentice Hall, Inc. All rights reserved. Chapter 23 – ASP.NET Outline 23.1 Introduction 23.2.NET Overview NET Framework ASP (Active.
CG0119 Web Database Systems Parsing XML: using SimpleXML & XSLT.
 2001 Prentice Hall, Inc. All rights reserved. 1.
 2001 Prentice Hall, Inc. All rights reserved. 1 Chapter 7 - JavaScript: Introduction to Scripting Outline 7.1 Introduction 7.2 Simple Program: Printing.
XSLT (eXtensible Stylesheet Language Transformation) 1.
XML: Managing Data Exchange Stylesheets. Lesson Contents CSS The basic XSL file XSL transforms Templates Sort Numbering Parameters and Variables Datatypes.
Tutorial 6 Working with Web Forms
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 3 Style Sheets: CSS WEB.
 2008 Pearson Education, Inc. All rights reserved Document Object Model (DOM): Objects and Collections.
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.
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic DHTML.
September 15, 2003Houssam Haitof1 XSL Transformation Houssam Haitof.
Chapter 19 – Macromedia Dreamweaver MX 2004
CST JavaScript Validating Form Data with JavaScript.
Chapter 12 Creating and Using XML Documents HTML5 AND CSS Seventh Edition.
WORKING WITH NAMESPACES
Sheet 1XML Technology in E-Commerce 2001Lecture 6 XML Technology in E-Commerce Lecture 6 XPointer, XSLT.
DHTML. What is DHTML?  DHTML is the combination of several built-in browser features in fourth generation browsers that enable a web page to be more.
XP Tutorial 6New Perspectives on HTML and XHTML, Comprehensive 1 Creating Web Page Forms Designing a Product Registration Form Tutorial 6.
 2004 Prentice Hall, Inc. All rights reserved. Chapter 13 - Dynamic HTML: Object Model and Collections Outline 13.1 Introduction 13.2 Object Referencing.
HTML, XHTML, and CSS Chapter 12 Creating and Using XML Documents.
Copyright © 2012 Accenture All Rights Reserved.Copyright © 2012 Accenture All Rights Reserved. Accenture, its logo, and High Performance Delivered are.
XP New Perspectives on XML Tutorial 6 1 TUTORIAL 6 XSLT Tutorial – Carey ISBN
XP 1 CREATING AN XML DOCUMENT. XP 2 INTRODUCING XML XML stands for Extensible Markup Language. A markup language specifies the structure and content of.
WORKING WITH XSLT AND XPATH
XP New Perspectives on XML, 2 nd Edition Tutorial 10 1 WORKING WITH THE DOCUMENT OBJECT MODEL TUTORIAL 10.
 2008 Pearson Education, Inc. All rights reserved Document Object Model (DOM): Objects and Collections.
1 JavaScript: Objects and Object Models October 25, 2005 Slides modified from Internet & World Wide Web: How to Program (3rd) edition. By Deitel,
Copyright © 2008 Pearson Prentice Hall. All rights reserved. 1 Exploring Microsoft Office Word 2007 Chapter 8 Word and the Internet Robert Grauer, Keith.
1 Macromedia Dreamweaver Outline Introduction Macromedia Dreamweaver Text Styles Images and Links Symbols and Lines Tables Forms Scripting in Dreamweaver.
Working with the XML Document Object Model ©NIITeXtensible Markup Language/Lesson 7/Slide 1 of 44 Objectives In this lesson, you will learn to: *Identify.
Client side web programming Introduction Jaana Holvikivi, DSc. School of ICT.
HTML Concepts and Techniques Fourth Edition Project 12 Creating and Using XML Documents.
CITA 330 Section 6 XSLT. Transforming XML Documents to XHTML Documents XSLT is an XML dialect which is declared under namespace "
XSLT Kanda Runapongsa Dept. of Computer Engineering Khon Kaen University.
CIS 375—Web App Dev II XSL. 2 XSL Introduction XSL stands for _____________________________. XSL is the language used for manipulating and displaying.
 2001 Prentice Hall, Inc. All rights reserved. Chapter 15 – Case Study: Message Forum with Active Server Pages Outline 15.1Introduction 15.2Setup and.
 2008 Pearson Education, Inc. All rights reserved Introduction to XHTML.
 2001 Prentice Hall, Inc. All rights reserved. 1 Chapter 13 - Dynamic HTML: Object Model and Collections Outline 13.1 Introduction 13.2 Object Referencing.
1 Introduction  Extensible Markup Language (XML) –Uses tags to describe the structure of a document –Simplifies the process of sharing information –Extensible.
 2002 Prentice Hall, Inc. All rights reserved. 1 Chapter 12 – XSL: Extensible Stylesheet Language Transformations (XSLT) Outline 12.1Introduction 12.2Setup.
XP New Perspectives on XML, 2nd Edition Tutorial 2 1 TUTORIAL 2 WORKING WITH NAMESPACES.
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.
 2004 Prentice Hall, Inc. All rights reserved. Chapter 13 - Dynamic HTML: Object Model and Collections Outline 13.1 Introduction 13.2 Object Referencing.
McGraw-Hill/Irwin © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Applying eXtensible Style Sheets (XSL) Ellen Pearlman Eileen Mullin Programming.
 2004 Prentice Hall, Inc. All rights reserved. Chapter 24 – Case Study: ASP.NET and XML Outline 24.1 Introduction 24.2 Setup and Message Forum Documents.
1 Overview of XSL. 2 Outline We will use Roger Costello’s tutorial The purpose of this presentation is  To give a quick overview of XSL  To describe.
1 Tutorial 12 Working with Namespaces Combining XML Vocabularies in a Compound Document.
 2001 Prentice Hall, Inc. All rights reserved. 1 Chapter 26 - Case Study: Active Server Pages and XML Outline 26.1 Introduction 26.2 Setup and Message.
Internet & World Wide Web How to Program, 5/e. © by Pearson Education, Inc. All Rights Reserved.2 Revised by Dr. T. Tran for CSI3140.
 2008 Pearson Education, Inc. All rights reserved Document Object Model (DOM): Objects and Collections.
XSLT. XSLT stands for Extensible Stylesheet Language Transformations XSLT is used to transform XML documents into other kinds of documents. XSLT can produce.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
Tutorial 6 Working with Web Forms. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Explore how Web forms interact with.
Chapter 1 Introduction to HTML, XHTML, and CSS HTML5 & CSS 7 th Edition.
Tutorial 9 Working with XHTML. New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition 2 Objectives Describe the history and theory of XHTML.
Chapter 29. Copyright 2003, Paradigm Publishing Inc. CHAPTER 29 BACKNEXTEND 29-2 LINKS TO OBJECTIVES Attach an XML Schema Attach an XML Schema Load XML.
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 7 Representing Web Data:
1 Introducing Web Developer Tools Rapid application development tools ASP.NET-compatible web editors –Visual Studio.NET Professional Edition –Visual Studio.
Session IV Chapter 14 – Chapter 14 – XSLThttp://
DHTML.
Unit 4 Representing Web Data: XML
Creating an XSLT Style Sheet for Formatting Data
CIIT-Human Computer Interaction-CSC456-Fall-2015-Mr
Chapter 7 Representing Web Data: XML
Chapter 13 - Dynamic HTML: Object Model and Collections
Chapter 26 - Case Study: Active Server Pages and XML
Presentation transcript:

 2004 Prentice Hall, Inc. All rights reserved. 1 Chapter 34 - Case Study: Active Server Pages and XML Outline 34.1 Introduction 34.2 Setup and Message Forum Documents 34.3 Forum Navigation 34.4 Adding Forums 34.5 Forum XML Documents 34.6 Posting Messages 34.7 Other Documents 34.8 Web Resources

 2004 Prentice Hall, Inc. All rights reserved. 2 Objectives In this tutorial, you will learn: –To create a Web-based message forum using Active Server Pages. –To use XML with Active Server Pages. –To be able to add new forums. –To be able to post messages to the message forum. –To use Microsoft’s DOM to manipulate an XML document. –To use XSLT to transform XML documents.

 2004 Prentice Hall, Inc. All rights reserved Introduction Message forums –Popular internet feature –Discuss topics –Exchange information –Several major sites provide this service messages.yahoo.com/index.html web.eesite.com/forums groups.google.com

 2004 Prentice Hall, Inc. All rights reserved Setup and Message Forum Documents Prerequisites –Microsoft Internet Information Services 6 (IIS) –Internet Explorer 6 (for XML and XSLT processing) –MSXML 3.0 or higher –Write permissions on forum folder

 2004 Prentice Hall, Inc. All rights reserved Setup and Message Forum Documents

 2004 Prentice Hall, Inc. All rights reserved Forum Navigation default.asp addForum.asp forums.xml forumASP.xml addPost.asp formatting.xsl Fig Key interactions between message forum documents.

 2004 Prentice Hall, Inc. All rights reserved Setup and Message Forum Documents Forum listing –XML –filename attribute

 2004 Prentice Hall, Inc. All rights reserved. Outline 8 forums.xml (1 of 1) Name of forum. XML document that contains the information for forum ASP.

 2004 Prentice Hall, Inc. All rights reserved Setup and Message Forum Documents Presenting forum listing –Convert to XHTML –CSS for formatting –ASP facilitates the conversion DOMDocument Async property DocumentElement ChildNodes For Each…Next control structure

 2004 Prentice Hall, Inc. All rights reserved. Outline 10 default.asp (1 of 3) Link to CSS style sheet style.css.

 2004 Prentice Hall, Inc. All rights reserved. Outline 11 default.asp (2 of 3) Instantiate an XML DOM object.Setting Async to False causes the object referenced by xmlFile to behave synchronously. Method Load parses the XML document forums.xml.If the parsing fails, the browser is redirected to invalid.html. Property DocumentElement gets the root element’s child nodes. Property ChildNodes returns a collection of the element node’s child nodes. Method getAttribute gets a forum’s filename. The anchor element creates a link to the available forums.

 2004 Prentice Hall, Inc. All rights reserved. Outline 12 default.asp (3 of 3) This anchor element links to the ASP document addForum.asp that allows the user to create a new forum.

 2004 Prentice Hall, Inc. All rights reserved Forum Navigation Fig Message forums main page.

 2004 Prentice Hall, Inc. All rights reserved Adding Forums Template forum –Bare minimum elements of forum –stylesheet tag for formatting –forum tag

 2004 Prentice Hall, Inc. All rights reserved. Outline 15 template.xml The stylesheet processing instruction references formatting.xsl.

 2004 Prentice Hall, Inc. All rights reserved Adding Forums Generating forum from template –Form to get information on new forum Name and file name User name Message title and text –Script to act on form input Confirm valid input SetAttribute –filename –timestamp CreateElement AppendChild Save

 2004 Prentice Hall, Inc. All rights reserved. Outline 17 addForum.asp (1 of 7) Check to see if a value was entered in each of the form fields. Test to see if the form was submitted by testing the form’s submit field for a value.

 2004 Prentice Hall, Inc. All rights reserved. Outline 18 addForum.asp (2 of 7) Method Load loads the template XML document. Method setAttribute creates an attribute node named filename that has the value contained in form field filename. Method AppendChild appends the newly created element name node to the root element.

 2004 Prentice Hall, Inc. All rights reserved. Outline 19 addForum.asp (3 of 7) Calling method Save saves the XML document to disk. Open XML document forums.xml.

 2004 Prentice Hall, Inc. All rights reserved. Outline 20 addForum.asp (4 of 7) Modify forums.xml. Save forums.xml with its new contents to disk.

 2004 Prentice Hall, Inc. All rights reserved. Outline 21 addForum.asp (5 of 7) This XHTML form allows a user to input the name, filename, a user name, a message title and the message text to create a new forum.

 2004 Prentice Hall, Inc. All rights reserved. Outline 22 addForum.asp (6 of 7)

 2004 Prentice Hall, Inc. All rights reserved. Outline 23 addForum.asp (7 of 7) The Submit button submits the form and the values input in the form fields. The Clear button will delete all values in the form fields.

 2004 Prentice Hall, Inc. All rights reserved Adding Forums Fig Page to add a forum.

 2004 Prentice Hall, Inc. All rights reserved Forum XML Documents Sample forum –XML modified with several forums added –XSLT used to transform XML –Final XHTML page served to Internet Explorer

 2004 Prentice Hall, Inc. All rights reserved. Outline 26 forumASP.xml (1 of 2) The name of the forum.Each message element and its children contain the information for a post.

 2004 Prentice Hall, Inc. All rights reserved. Outline 27 forumASP.xml (2 of 2)

 2004 Prentice Hall, Inc. All rights reserved. Outline 28 formatting.xsl (1 of 4) Element xsl:stylesheet is the XSLT document’s root element. Attribute version specifies the XSLT version to which this style sheet conforms. The attribute xmlns creates a namespace prefix xsl. The xsl:output element specifies how the result tree is output. Attribute method is assigned html, which specifies that an XHTML document is being output. Attribute omit-xml- declaration is assigned no, which results in an XML declaration in the result tree. Select the template that match es the XML document root ( / ). The asterisk selects element nodes.

 2004 Prentice Hall, Inc. All rights reserved. Outline 29 formatting.xsl (2 of 4) Link to the CSS style sheet style.css. Get value of name element. Apply message template.

 2004 Prentice Hall, Inc. All rights reserved. Outline 30 formatting.xsl (3 of 4) Get the value of attribute filename. Begin template message.Get value of user element.

 2004 Prentice Hall, Inc. All rights reserved. Outline 31 formatting.xsl (4 of 4) Get value of attribute timestamp. Get value of text element.

 2004 Prentice Hall, Inc. All rights reserved. Outline 32 forumASP_transformed.html (1 of 3) Forum title.Message title.

 2004 Prentice Hall, Inc. All rights reserved. Outline 33 forumASP_transformed.html (2 of 3) Message author.Time and date posted. Message text.

 2004 Prentice Hall, Inc. All rights reserved. Outline 34 forumASP_transformed.html (3 of 3) Link to add a new post.

 2004 Prentice Hall, Inc. All rights reserved Forum XML Documents Fig Output of the transformation of the forum XML document.

 2004 Prentice Hall, Inc. All rights reserved Posting Messages Posting a message –Procedure similar to creating new forum

 2004 Prentice Hall, Inc. All rights reserved. Outline 37 addPost.asp (1 of 5) Test to see if the form was submitted by testing the form’s submit field for a value. Check to see if a value was entered in each of the form fields. Method Load loads the forum XML document.

 2004 Prentice Hall, Inc. All rights reserved. Outline 38 addPost.asp (2 of 5) Create a message node. Create a timeStamp attribute for the message node. Create the children of the message node: user, title and text.

 2004 Prentice Hall, Inc. All rights reserved. Outline 39 addPost.asp (3 of 5)

 2004 Prentice Hall, Inc. All rights reserved. Outline 40 addPost.asp (4 of 5) This form allows the user to create a post by entering the values into the form fields.

 2004 Prentice Hall, Inc. All rights reserved. Outline 41 addPost.asp (5 of 5)

 2004 Prentice Hall, Inc. All rights reserved Posting Messages Fig Adding a message to a forum.

 2004 Prentice Hall, Inc. All rights reserved Posting Messages Fig New forum on the message board.

 2004 Prentice Hall, Inc. All rights reserved Posting Messages Fig Initial content of the newly added forum.

 2004 Prentice Hall, Inc. All rights reserved Posting Messages Fig Contents of the Internet and World Wide Web: Third Edition forum.

 2004 Prentice Hall, Inc. All rights reserved Other Documents Other documents required by forum –Error page –CSS for formatting XHTML Forums

 2004 Prentice Hall, Inc. All rights reserved. Outline 47 invalid.html (1 of 1) Link that references CSS style sheet site.css.

 2004 Prentice Hall, Inc. All rights reserved. Outline 48 site.css (1 of 3) Define styles for the body element.Define styles for the anchor element.Define styles for the table element.

 2004 Prentice Hall, Inc. All rights reserved. Outline 49 site.css (2 of 3)

 2004 Prentice Hall, Inc. All rights reserved. Outline 50 site.css (3 of 3)

 2004 Prentice Hall, Inc. All rights reserved. Outline 51 style.css (1 of 5) Define styles for the h1 element.Define styles for the h2 element.Define styles for the p element.

 2004 Prentice Hall, Inc. All rights reserved. Outline 52 style.css (2 of 5) Define styles for the body element.Define styles for the li element.

 2004 Prentice Hall, Inc. All rights reserved. Outline 53 style.css (3 of 5) Define styles for the input element. Define styles for the textarea element.

 2004 Prentice Hall, Inc. All rights reserved. Outline 54 style.css (4 of 5)

 2004 Prentice Hall, Inc. All rights reserved. Outline 55 style.css (5 of 5)