1 / 9

XML – What to do with it Using XML in VDF

XML – What to do with it Using XML in VDF. John Tuohy Data Access Worldwide. An XML Document Consists of. PIs – Processing Instructions DTDs Root Element (or Document Element) The root contains all other elements Elements Elements contain child elements, attributes, Text Data Attributes

Download Presentation

XML – What to do with it Using XML in VDF

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 – What to do with itUsing XML in VDF John Tuohy Data Access Worldwide

  2. An XML Document Consists of PIs – Processing Instructions DTDs Root Element (or Document Element) The root contains all other elements Elements Elements contain child elements, attributes, Text Data Attributes Character Data Text data or CDataSection

  3. An XML Document <CUSTOMERLIST> <CUSTOMER PRODUCT="Food"> <NAME>Ming Foo Bakery</NAME> <ADDRESS> <STREET>1199 Sutter St</STREET> <CITY>San Francisco</CITY> </ADDRESS> </CUSTOMER> </CUSTOMERLIST>

  4. <CUSTOMERLIST> An XML Document as DOM Nodes <CUSTOMER> PRODUCT=“Food” <NAME> <ADDRESS> <CITY> Ming Foo Bakery <STREET> San Francisco 1199 Sutter St

  5. The Main XML Classes in VDF cXmlDomNode cXmlDomDocument cXmlDomElement cXmlDomAttribute cXmlDomCharacterData cXMLDomTextNode cXMLDomCDataSection NodeCollection cXmlDomNodeList cXmlDomNamedNodeMap

  6. The cXmlDomDocument Interface Get Create U_cXMLDOMDocument to hoXML Set psDocumentName of hoXML to sName Set pbValidateOnParse of hoXML To bState Get LoadXMLDocument of hoXML to bTest Get DocumentElement of hoXML to hoRoot Get CreateDocumentElement of hoXML sRoot to hoRoot Get SaveXMLDocument of hoXML to bTest Send Destroy Of hoXML

  7. The cXMLDomElement Interface Get FindNode of hoEle sQuery to hoNode Get FindNodeList of hoEle sQuery to hoNode Get ChildNodeValue of hoEle sTagName to sValue Get AttributeValue of hoEle sAttribute to sValue Get AddElement of hoEle sTagName sData to hoNode Send AddElement of hoEle sTagName sData Send AddAttribute of hoEle sAttribute sData Send AddChildTexNode of hoEle sData Send AddCDataSection of hoEle sData

  8. The cXmlNodeList Interface Get NodeListLength of hoNodeList to iItems Get CollectionNode of hoNodeList iItem to hoNode Get FindNodeList of hoRoot "CUSTOMER" to hoList Get NodeListLength of hoList to iItems Decrement iItems For i from 0 to iItems Get CollectionNode of hoList i to hoCust Send ShowCust hoCust Send Destroy of hoCust Loop send Destroy of hoList

  9. Transforming Data – using XSLT Get XSLTransformation of hoRoot hoXSL to sHTMLData Get Create U_cXMLDOMDocument to hoXML Set psDocumentName of hoXML to (sPath - "\customer.xml") Get LoadXMLDocument of hoXML to bOK Get DocumentElement of hoXML to hoRoot Get Create U_cXMLDOMDocument to hoXSL Set psDocumentName of hoXSL to (sPath - "\customer.xsl") Get LoadXMLDocument of hoXSL to bOK Get XSLTransformation of hoRoot hoXSL to sHTMLData Direct_Output Channel 0 (sPath - "\NewCustomer.html") writeln Channel 0 sHTMLData Close_Output Channel 0 Send Destroy of hoXSL Send Destroy of hoXML

More Related