6 311 W

354 views
267 views

Published on

Published in: Business, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
354
On SlideShare
0
From Embeds
0
Number of Embeds
33
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

6 311 W

  1. 1. Integrating XML in Business Ken Spencer Vice President 32X Corporation www.32x.com 6-311
  2. 3. Cross-Platform Interop Application Data Comm Windows DNA 2000 Other Platforms Application Framework implementation Data Comm Core Standards Application Schemas Frameworks Platform/Tools Solutions and Applications Platform/Tools Solutions and Applications Framework implementation
  3. 4. Where is XML used? <ul><li>Sample XML </li></ul><ul><li><?xml version=&quot;1.0&quot;?> </li></ul><ul><li><Books> </li></ul><ul><li><Book> </li></ul><ul><li><Title_ID>BU1032</Title_ID> </li></ul><ul><li><Title>The Busy Executive's Database Guide</Title> </li></ul><ul><li><Notes>An overview of available database systems with emphasis on common business applications. Illustrated.</Notes> </li></ul><ul><li></Book> </li></ul><ul><li></Books> </li></ul>
  4. 5. Getting Started <ul><li>XML must play by rules </li></ul><ul><ul><li>XML Declaration </li></ul></ul><ul><li><?xml version=&quot;1.0&quot;?> </li></ul><ul><ul><li>Define Tags </li></ul></ul><ul><ul><li>Add Data </li></ul></ul>
  5. 6. VB and XML <ul><li>Wire into components </li></ul><ul><li>Use with serialization techniques </li></ul><ul><ul><li>Move data into and out of components </li></ul></ul><ul><li>Generate XML from components </li></ul><ul><ul><li>Send to ASP </li></ul></ul><ul><li>Generate from ASP and send to </li></ul><ul><ul><ul><li>Browser </li></ul></ul></ul><ul><ul><ul><li>Vendor </li></ul></ul></ul><ul><ul><ul><li>Customer </li></ul></ul></ul>
  6. 7. XMLGen.Generator <ul><li>Custom VB XML Generator </li></ul><ul><ul><li>Simple </li></ul></ul><ul><ul><li>No frills </li></ul></ul><ul><ul><li>Designed to get data out </li></ul></ul><ul><ul><li>Useful in intranet / Internet applications </li></ul></ul><ul><ul><ul><li>Where full parser not required </li></ul></ul></ul>
  7. 8. XMLGen.Generator Interface <ul><li>XMLDeclaration </li></ul><ul><li>Format – formats data </li></ul><ul><li>BeginTag – generates starting tag </li></ul><ul><li>EndTag – generates ending tag </li></ul>
  8. 9. Generating the Declaration <ul><li>Set output var to return value </li></ul><ul><ul><li>vOutPut = oXML.XMLDeclaration() </li></ul></ul><ul><li>Results in this: </li></ul><ul><ul><li><?xml version=&quot;1.0&quot;?> </li></ul></ul>
  9. 10. Creating the XML Stream <ul><li>Call Format method to generate tags </li></ul><ul><li>sTitle = oXML.Format(&quot;Title&quot;, rsTitle(&quot;title&quot;)) </li></ul><ul><li>sID = oXML.Format(&quot;Title_ID&quot;, rsTitle(&quot;title_id&quot;)) </li></ul><ul><li>sNotes = oXML.Format(&quot;Notes&quot;, rsTitle(&quot;notes&quot;)) </li></ul><ul><li>sReturn = sID & sTitle & sNotes </li></ul><ul><li>Return all XML as string from VB method </li></ul><ul><ul><li>RetrieveTitle = sReturn </li></ul></ul>
  10. 11. ADO and XML <ul><li>ADO 2.x can save RS as XML </li></ul><ul><li>ADO 2.5 can save or stream RS as XML </li></ul><ul><ul><li>Use ADO to generate stream to other applications </li></ul></ul>
  11. 12. ADO 2.5 Stream Object <ul><li>Stream object </li></ul><ul><ul><li>Can hold different types of data </li></ul></ul><ul><ul><li>Load from ADO RS </li></ul></ul><ul><ul><li>Feed to MSXML Parser </li></ul></ul>
  12. 13. XML from ASP <ul><li>ADO 2.5 XML Support </li></ul><ul><ul><li>Generate XML from RS </li></ul></ul><ul><ul><ul><li>Send to Response object </li></ul></ul></ul><ul><li>Use Customer Formatter </li></ul><ul><ul><li>Why? </li></ul></ul>
  13. 14. XML Mapping <ul><li>B2B or B2C requirements </li></ul><ul><ul><li>Map DB Schema to XML </li></ul></ul><ul><ul><li>Should use XMLFilter object </li></ul></ul><ul><ul><ul><li>Handle mapping automatically </li></ul></ul></ul><ul><ul><ul><li>Read XML Schema </li></ul></ul></ul><ul><ul><ul><li>Map Schema to DB Schema </li></ul></ul></ul><ul><ul><ul><li>Output XML </li></ul></ul></ul><ul><ul><ul><li>Resist temptation to generate XML directly in Stored Procs or from database </li></ul></ul></ul>
  14. 15. Storing XML In Database <ul><li>Not easily searchable </li></ul><ul><li>Works best for self described data </li></ul><ul><ul><li>Query definition, state info (non searchable) </li></ul></ul><ul><li>Watch column size </li></ul><ul><ul><li>Be careful with varchar vs. char/int/etc. </li></ul></ul>
  15. 16. HTML vs. XML <ul><li>Use HTML Files when Possible </li></ul><ul><ul><li>Does note require script or XML processing </li></ul></ul><ul><ul><li>Simple file / HTTP processing </li></ul></ul><ul><ul><li>IIS 5 improves processing of ASP files with no script </li></ul></ul>
  16. 17. Session Support <ul><li>Turn off </li></ul><ul><ul><li>Frees up resources on server </li></ul></ul><ul><ul><li>Lets IIS process multithreaded applications faster </li></ul></ul><ul><li>How </li></ul><ul><ul><li>Rework applications first (see FMStocks 1 & 2000 for sample code) </li></ul></ul><ul><ul><li>Remove reference to Session vars </li></ul></ul><ul><ul><li>Use the ISM to turn off on server </li></ul></ul>
  17. 18. Session State Data <ul><li>Don’t use ASP session object </li></ul><ul><li>Use XML to store state </li></ul><ul><li>Store data in SQL Server </li></ul>
  18. 19. The Microsoft XML Engine <ul><li>Freely distributed </li></ul><ul><li>Fast parser </li></ul><ul><li>Great for reading XML files </li></ul><ul><li>Combine with ADO or other formatter </li></ul>
  19. 20. SQL Server <ul><li>SQL Server 2000 </li></ul><ul><ul><li>Generate XML directly </li></ul></ul><ul><ul><li>More… </li></ul></ul>
  20. 21. With Browser <ul><li>IE 5 Data Islands </li></ul><ul><ul><li>Treat XML data as object </li></ul></ul><ul><ul><ul><li>Work with MSXML parser </li></ul></ul></ul><ul><ul><ul><li>Interact with DHTML </li></ul></ul></ul>
  21. 22. With XSL <ul><li>XSL </li></ul><ul><ul><li>Extensible Style Sheet </li></ul></ul><ul><ul><ul><li>Works with XML on client or server </li></ul></ul></ul><ul><ul><ul><li>Used to transform XML data into something else </li></ul></ul></ul>

×