Presentation Topic: XML and ASP Presented by Yanzhi Zhang.

14
Presentation Topic: Presentation Topic: XML and ASP XML and ASP Presented by Yanzhi Zhang Presented by Yanzhi Zhang

Transcript of Presentation Topic: XML and ASP Presented by Yanzhi Zhang.

Page 1: Presentation Topic: XML and ASP Presented by Yanzhi Zhang.

Presentation Topic:Presentation Topic:

XML and ASPXML and ASP

Presented by Yanzhi ZhangPresented by Yanzhi Zhang

Page 2: Presentation Topic: XML and ASP Presented by Yanzhi Zhang.

What is XML?What is XML?• XML stands for XML stands for ExtensibleExtensible Markup Markup LanguageLanguage

• XML is a XML is a markup languagemarkup language much like much like HTMLHTML

• XML is an open standardXML is an open standard

• XML was designed to XML was designed to describe datadescribe data

• XML tags are not predefined. You must XML tags are not predefined. You must definedefine

Your Own TagsYour Own Tags

• XML uses a XML uses a Document Type DefinitionDocument Type Definition

(DTD) or an (DTD) or an XML SchemaXML Schema to describe the to describe the data data

Page 3: Presentation Topic: XML and ASP Presented by Yanzhi Zhang.

Simple XML CodeSimple XML Code

   <?xml version="1.0" encoding="ISO-8859-<?xml version="1.0" encoding="ISO-8859-1" ?>1" ?>

<!-- Simple XML Code --> <!-- Simple XML Code --> <note><note>   <to><to>CindyCindy</to> </to>    <from><from>MikeMike</from> </from>    <heading><heading>ReminderReminder</heading> </heading>    <body><body>Don't forget to call me this Don't forget to call me this

weekend!weekend!</body> </body>    </note></note>

Page 4: Presentation Topic: XML and ASP Presented by Yanzhi Zhang.

Well formed & Valid XML Well formed & Valid XML

• ““Well formedWell formed” XML documents” XML documents• Conforming to the XML syntax rulesConforming to the XML syntax rules

• ““ValidValid” XML documents” XML documents• Well Formed and conforms to the rules of Well Formed and conforms to the rules of

DTDDTD

• DTD stands for Document Type DefinitionDTD stands for Document Type Definition

• <!DOCTYPE root-element [element-<!DOCTYPE root-element [element-declarations]>declarations]>

Page 5: Presentation Topic: XML and ASP Presented by Yanzhi Zhang.

XML and HTMLXML and HTML

• Both are Standard Generalized Markup Both are Standard Generalized Markup LanguageLanguage

• HTML uses “HTML uses “Predefined tagsPredefined tags” || XML uses ” || XML uses ””Self-defined tagsSelf-defined tags””

• XML is XML is Case-SensitiveCase-Sensitive• XML must have a XML must have a closing tagclosing tag for all for all

elementselements• XML does not accept XML does not accept overlapping tagsoverlapping tags• XML is XML is complementcomplement to HTML instead of a to HTML instead of a

replacement replacement

Page 6: Presentation Topic: XML and ASP Presented by Yanzhi Zhang.

How to display XML?How to display XML?

• CSSCSS

• XSLXSL

• JavaScriptJavaScript

Page 7: Presentation Topic: XML and ASP Presented by Yanzhi Zhang.

Displaying XML with CSSDisplaying XML with CSS

• CSS is Cascading Style Sheets CSS is Cascading Style Sheets

• links the XML file to the CSS file links the XML file to the CSS file

<?xml-stylesheet type="text/css“ <?xml-stylesheet type="text/css“ href = "cd_catalog.css"?> href = "cd_catalog.css"?>

• CD_CatalogCD_Catalog XML Sample code XML Sample code

Page 8: Presentation Topic: XML and ASP Presented by Yanzhi Zhang.

Displaying XML with XSLDisplaying XML with XSL

• XML Stylesheet LanguageXML Stylesheet Language• XSL consists of three parts:XSL consists of three parts:

• XSLT XSLT • XPathXPath• XSL Formatting ObjectsXSL Formatting Objects

• XSLT stands for XSL TransformationsXSLT stands for XSL Transformations eg: Transform XML into HTML to display eg: Transform XML into HTML to display

(XHTML)(XHTML) <?xml-stylesheet type="text/xsl" <?xml-stylesheet type="text/xsl"

href="food.xsl" ?>href="food.xsl" ?>• Food Menu sample codeFood Menu sample code• CD Catalog sample codeCD Catalog sample code

Page 9: Presentation Topic: XML and ASP Presented by Yanzhi Zhang.

Displaying XML with Java Displaying XML with Java Script Script

• Why using Java Script?Why using Java Script?• For non XSL aware browsersFor non XSL aware browsers

• Do Browser-specific testingDo Browser-specific testing

• Use different style sheets according to Use different style sheets according to browser browser

and user needs and user needs

Page 10: Presentation Topic: XML and ASP Presented by Yanzhi Zhang.

XML ServerXML Server

• Store XML on the serverStore XML on the server

• Generating XML with ASPGenerating XML with ASP

• Getting XML from a DataBaseGetting XML from a DataBase

Page 11: Presentation Topic: XML and ASP Presented by Yanzhi Zhang.

One XML ApplicationOne XML Application

• Use Data Island to access xml fileUse Data Island to access xml file

• Use JavaScript to NavigateUse JavaScript to Navigate

• To see how XML increase the client To see how XML increase the client side processing data capabilitiesside processing data capabilities

• Application CodeApplication Code

Page 12: Presentation Topic: XML and ASP Presented by Yanzhi Zhang.

Why XML is good?Why XML is good?

• Universal data exchange formatUniversal data exchange format

• Client-side processing and Client-side processing and manipulation of datamanipulation of data

• Search BetterSearch Better

• Getting Precise data updatesGetting Precise data updates

Page 13: Presentation Topic: XML and ASP Presented by Yanzhi Zhang.

The EndThe End

Thank youThank you

Page 14: Presentation Topic: XML and ASP Presented by Yanzhi Zhang.

What can you do with XML?What can you do with XML?

• Electronic CommerceElectronic Commerce

• Creating other markup languagesCreating other markup languages

• Push Technology (Web casting)Push Technology (Web casting)

• Advanced Search EngineAdvanced Search Engine

• Web-based Control systemsWeb-based Control systems