1 / 7

ITApplications XML Module

ITApplications XML Module. Session 8: Introduction to Programming with XML. Introduction – Programming with XML.

varana
Télécharger la présentation

ITApplications XML Module

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. ITApplications XML Module Session 8:Introduction to Programming with XML

  2. Introduction – Programming with XML • XML documents, when parsed, are represented as a hierarchical tree structure.This structure can be accessed by a programming tool via an API. SAX and DOM are two dramatically different APIs for accessing information in XML documents.

  3. Event-driven programming with Simple API for XML (SAX) • SAX was developed by the W3C and released in 1998. SAX-based parsers invoke methods when markup (e.g. a start tag, an end tag, etc.) is encountered. No tree structure is created - data is passed to the application from the XML document as it is found. SAX parsers are typically used for reading XML documents that will not be modified. • SAX-based parsers are available for a variety of programming languages; C++, Java, and Perl being the most popular. SAX is based on an event-driven model using call-backs to handle processing.

  4. What an event-driven program can do: • Search a document for an element containing a keyword • Print out formatted content • Modify an XML document by making small changes, such as fixing spelling and renaming elements • Read data to build a complex data structure • What an event-driven program can't do: • Re-order the elements in a document • Resolve cross-references between elements • Verify ID-IDREF links • Validate an XML document

  5. Event-driven programming with Document Object Model (DOM) • The W3C provides a standard recommendation for building a tree structure in memory for XML documents called the XML Document Object Model (DOM). A DOM-based parser exposes (i.e. makes available) a library, called the DOM Application Programming Interface (API), that allows data in an XML document to be accessed and modified by manipulating the nodes in a DOM tree.

  6. Event-driven programming with Asynchronous JavaScript and XML (Ajax) • Ajax is a web development technique that makes use of a combination of: • HTML/XHTML and stylesheets (CSS) for data presentation. • The DOM is programmed using Javascript for dynamically displaying data. • An XMLHttpRequest object is used to exchange XML data asynchronously between a browser and a web server.

  7. Concluding Remarks and Coursework Assignment • Let’s read the FMA assignment and clarify any questions you may have. • Any Final Questions???

More Related