23
Integrating XML in Integrating XML in Business Business Ken Spencer Ken Spencer Vice President Vice President 32X Corporation 32X Corporation www.32x.com www.32x.com 6-311 6-311

Integrating XML in Business Ken Spencer Vice President 32X Corporation

Embed Size (px)

Citation preview

Page 1: Integrating XML in Business Ken Spencer Vice President 32X Corporation

Integrating XML in Business Integrating XML in Business

Ken Spencer Ken Spencer Vice PresidentVice President32X Corporation32X Corporation

www.32x.comwww.32x.com

6-3116-311

Page 2: Integrating XML in Business Ken Spencer Vice President 32X Corporation
Page 3: Integrating XML in Business Ken Spencer Vice President 32X Corporation

Cross-Platform InteropCross-Platform Interop

Application

DataComm

Windows DNA 2000 Other Platforms

Application

Frameworkimplementation

DataComm

Core Standards

Application Schemas

Frameworks

Platform/Tools

Solutions and Applications

Platform/Tools

Solutions and Applications

Frameworkimplementation

Page 4: Integrating XML in Business Ken Spencer Vice President 32X Corporation

Where is XML used?Where is XML used?

Sample XMLSample XML<?xml version="1.0"?><?xml version="1.0"?>

<Books><Books>

<Book><Book>

<Title_ID>BU1032</Title_ID><Title_ID>BU1032</Title_ID>

<Title>The Busy Executive's Database <Title>The Busy Executive's Database Guide</Title>Guide</Title>

<Notes>An overview of available database <Notes>An overview of available database systems with emphasis on common business systems with emphasis on common business applications. Illustrated.</Notes>applications. Illustrated.</Notes>

</Book></Book>

</Books></Books>

Page 5: Integrating XML in Business Ken Spencer Vice President 32X Corporation

Getting StartedGetting Started

XML must play by rulesXML must play by rules XML DeclarationXML Declaration

<?xml version="1.0"?> <?xml version="1.0"?> Define TagsDefine Tags Add DataAdd Data

Page 6: Integrating XML in Business Ken Spencer Vice President 32X Corporation

VB and XMLVB and XML

Wire into componentsWire into components Use with serialization techniquesUse with serialization techniques

Move data into and out of componentsMove data into and out of components Generate XML from componentsGenerate XML from components

Send to ASPSend to ASP Generate from ASP and send to Generate from ASP and send to

BrowserBrowser VendorVendor CustomerCustomer

Page 7: Integrating XML in Business Ken Spencer Vice President 32X Corporation

XMLGen.GeneratorXMLGen.Generator

Custom VB XML GeneratorCustom VB XML Generator SimpleSimple No frillsNo frills Designed to get data outDesigned to get data out Useful in intranet / Internet Useful in intranet / Internet

applicationsapplications Where full parser not required Where full parser not required

Page 8: Integrating XML in Business Ken Spencer Vice President 32X Corporation

XMLGen.Generator InterfaceXMLGen.Generator Interface

XMLDeclarationXMLDeclaration Format – formats dataFormat – formats data BeginTag – generates starting tagBeginTag – generates starting tag EndTag – generates ending tagEndTag – generates ending tag

Page 9: Integrating XML in Business Ken Spencer Vice President 32X Corporation

Generating the Declaration Generating the Declaration

Set output var to return valueSet output var to return valuevOutPut = oXML.XMLDeclaration()vOutPut = oXML.XMLDeclaration()

Results in this:Results in this:<?xml version="1.0"?><?xml version="1.0"?>

Page 10: Integrating XML in Business Ken Spencer Vice President 32X Corporation

Creating the XML StreamCreating the XML Stream

Call Format method to generate Call Format method to generate tagstags

sTitle = oXML.Format("Title", rsTitle("title"))sTitle = oXML.Format("Title", rsTitle("title"))

sID = oXML.Format("Title_ID", rsTitle("title_id"))sID = oXML.Format("Title_ID", rsTitle("title_id"))

sNotes = oXML.Format("Notes", rsTitle("notes"))sNotes = oXML.Format("Notes", rsTitle("notes"))

sReturn = sID & sTitle & sNotessReturn = sID & sTitle & sNotes

Return all XML as string from VB Return all XML as string from VB methodmethodRetrieveTitleRetrieveTitle = sReturn = sReturn

Page 11: Integrating XML in Business Ken Spencer Vice President 32X Corporation

ADO and XMLADO and XML

ADO 2.x can save RS as XMLADO 2.x can save RS as XML ADO 2.5 can save or stream RS as ADO 2.5 can save or stream RS as

XMLXML Use ADO to generate stream to other Use ADO to generate stream to other

applications applications

Page 12: Integrating XML in Business Ken Spencer Vice President 32X Corporation

ADO 2.5 Stream ObjectADO 2.5 Stream Object

Stream objectStream object Can hold different types of dataCan hold different types of data Load from ADO RSLoad from ADO RS Feed to MSXML ParserFeed to MSXML Parser

Page 13: Integrating XML in Business Ken Spencer Vice President 32X Corporation

XML from ASPXML from ASP

ADO 2.5 XML SupportADO 2.5 XML Support Generate XML from RSGenerate XML from RS

Send to Response objectSend to Response object

Use Customer FormatterUse Customer Formatter Why?Why?

Page 14: Integrating XML in Business Ken Spencer Vice President 32X Corporation

XML MappingXML Mapping

B2B or B2C requirementsB2B or B2C requirements Map DB Schema to XML Map DB Schema to XML Should use XMLFilter objectShould use XMLFilter object

Handle mapping automaticallyHandle mapping automatically Read XML SchemaRead XML Schema Map Schema to DB SchemaMap Schema to DB Schema Output XMLOutput XML Resist temptation to generate XML Resist temptation to generate XML

directly in Stored Procs or from databasedirectly in Stored Procs or from database

Page 15: Integrating XML in Business Ken Spencer Vice President 32X Corporation

Storing XML In DatabaseStoring XML In Database

Not easily searchableNot easily searchable Works best for self described dataWorks best for self described data

Query definition, state info (non Query definition, state info (non searchable)searchable)

Watch column sizeWatch column size Be careful with varchar vs. Be careful with varchar vs.

char/int/etc.char/int/etc.

Page 16: Integrating XML in Business Ken Spencer Vice President 32X Corporation

HTML vs. XMLHTML vs. XML

Use HTML Files when PossibleUse HTML Files when Possible Does note require script or XML Does note require script or XML

processingprocessing Simple file / HTTP processingSimple file / HTTP processing IIS 5 improves processing of ASP files IIS 5 improves processing of ASP files

with no scriptwith no script

Page 17: Integrating XML in Business Ken Spencer Vice President 32X Corporation

Session SupportSession Support

Turn offTurn off Frees up resources on serverFrees up resources on server Lets IIS process multithreaded Lets IIS process multithreaded

applications fasterapplications faster HowHow

Rework applications first (see Rework applications first (see FMStocks 1 & 2000 for sample FMStocks 1 & 2000 for sample code)code)

Remove reference to Session varsRemove reference to Session vars Use the ISM to turn off on serverUse the ISM to turn off on server

Page 18: Integrating XML in Business Ken Spencer Vice President 32X Corporation

Session State DataSession State Data

Don’t use ASP session objectDon’t use ASP session object Use XML to store stateUse XML to store state Store data in SQL Server Store data in SQL Server

Page 19: Integrating XML in Business Ken Spencer Vice President 32X Corporation

The Microsoft XML EngineThe Microsoft XML Engine

Freely distributedFreely distributed Fast parserFast parser Great for reading XML filesGreat for reading XML files Combine with ADO or other Combine with ADO or other

formatterformatter

Page 20: Integrating XML in Business Ken Spencer Vice President 32X Corporation

SQL ServerSQL Server

SQL Server 2000SQL Server 2000 Generate XML directlyGenerate XML directly More…More…

Page 21: Integrating XML in Business Ken Spencer Vice President 32X Corporation

With BrowserWith Browser

IE 5 Data IslandsIE 5 Data Islands Treat XML data as objectTreat XML data as object

Work with MSXML parserWork with MSXML parser Interact with DHTMLInteract with DHTML

Page 22: Integrating XML in Business Ken Spencer Vice President 32X Corporation

With XSLWith XSL

XSLXSL Extensible Style SheetExtensible Style Sheet

Works with XML on client or serverWorks with XML on client or server Used to transform XML data into Used to transform XML data into

something elsesomething else

Page 23: Integrating XML in Business Ken Spencer Vice President 32X Corporation