XML, CFMX SQL XML by uzd19483

VIEWS: 13 PAGES: 14

									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 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>
            XML Uncovered
   <?xml version="1.0" encoding="ISO-8859-1"?>

    <Animal>                         XML Declaration



        ►<Dog name=“Bailey”>
           <Type>Golden
ROOT ELEMENT
                              ATTRIBITE


             Retriever</Type>
        ►</Dog>                ELEMENT


    </Animal>
          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
                            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
                    CFML XML IA
► CFML   XML in Action

   Let‟s Dive in           Example
                             ► Create
                             ► Parse
                             ► Search
                             ► Extract


                             ► Cfug/Index.cfm
                          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.
          Complex form data can be passed to a stored procedure
     ► i.e.
       and manipulated
     ► sp_xml_preparedocument
     ► OPENXML
    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
              Questions?
► DTD‟s?
► XPath
► XSLT
► Schemas
► SQL   OPENXML
                References
► CFML   XML
   http://www.how2cf.com/files/papers/cfxml.pdf
► XML
   www.w3schools.com

								
To top