1 / 14

XML, CFMX CFML & SQL XML

XML, CFMX CFML & SQL XML. Kevin Penny, MMCP kevin@hotgigs.com. What is XML?. Animal, vegetable, or mineral? Best reference: www.w3schools.com XML stands for E X tensible M arkup L anguage XML was designed to describe data XML can be used to Share Data/Store Data, Create New Languages

luyu
Télécharger la présentation

XML, CFMX CFML & SQL XML

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. XML, CFMX CFML & SQL XML Kevin Penny, MMCP kevin@hotgigs.com

  2. What is XML? • Animal, vegetable, or mineral? • Best reference: www.w3schools.com • XML stands for EXtensible Markup Language • XML was designed to describe data • XML can be used to Share Data/Store Data, Create New Languages • XML is designed to be self-descriptive • <Animal> • <Dog name=“Bailey”> • <Type>Golden Retriever</Type> • </Dog> • </Animal>

  3. XML Uncovered • <?xml version="1.0" encoding="ISO-8859-1"?> • <Animal> • <Dog name=“Bailey”> • <Type>Golden Retriever</Type> • </Dog> • </Animal> XML Declaration ATTRIBITE ROOT ELEMENT ELEMENT

  4. Rules of the Road • XML is cAsE Sensitive • Elements must have a closing tag • Elements must be properly nested • Attribute values must be quoted • All XML documents must have a root element

  5. CFML and XML • New great XML functions • XMLParse(xmlDocument) • Creates a tree structure of the XML document as an array of structures • Data can come from a database query, a file on the server, an http request etc. • XMLSearch(xmlDocument, xPathString) • Used to navigate/search an xml document using elements (walking the nodes) • XMLFormat(string) • Used to escape special XML characters in a string so that it is safe to use with XML • < > ‘ “ & • XMLTransform(xmlDocument,xslString) • Applies an XSLT to an XML document • XMLNew() or <CFXML • Creates an XML Document • Great Reference • http://www.how2cf.com/files/papers/cfxml.pdf

  6. CFML XML in Action Let’s Dive in Example Create Parse Search Extract Cfug/Index.cfm CFML XML IA

  7. SQL XML • Microsoft SQL Server 2000’s support for XML • Creating queries that create an XML output • FOR XML Cause • Inputting XML to a procedure that can manipulate the XML Document and put the data into a table etc. • i.e. Complex form data can be passed to a stored procedure and manipulated • sp_xml_preparedocument • OPENXML

  8. SQL XML meets CFML XML • Example • SQL Query as XML • SQL OPENXML Example in a Stored Procedure • CFML Call to the Procedure inserting the XML Document

  9. Questions? • DTD’s? • XPath • XSLT • Schemas • SQL OPENXML

  10. References • CFML XML • http://www.how2cf.com/files/papers/cfxml.pdf • XML • www.w3schools.com

More Related