XML processing in ColdFusion MX Everything you wanted to know about XML, but were afraid to ask October 2006 Jaxfusion User Group.

Slides:



Advertisements
Similar presentations
XML-XSL Introduction SHIJU RAJAN SHIJU RAJAN Outline Brief Overview Brief Overview What is XML? What is XML? Well Formed XML Well Formed XML Tag Name.
Advertisements

XML Schema Heewon Lee. Contents 1. Introduction 2. Concepts 3. Example 4. Conclusion.
Open Office.Org What is the Open Office.org Source Project? Open source project through which Sun Microsystems is releasing the technology for the popular.
What is XML? a meta language that allows you to create and format your own document markups a method for putting structured data into a text file; these.
XML: Extensible Markup Language
Leveraging XML with ColdFusion Jeff Tapper June 2004.
1 XML: Advanced Guide Holly A. Hyland, FSA Andrew Smalera, XML Framework Session 14.
1 XML DTD & XML Schema Monica Farrow G30
Introduction XML Technologies Mark Graves. This presentation is Copyright 2001, 2002 by Mark Graves and contains material Copyright 2002 by Prentice Hall.
Tutorial 9 Working with XHTML
Java API for XML Processing (JAXP) CSE 4/586: Distributed Systems Department of Computer Science and Engineering University at Buffalo, New York Jia Zhao.
Tutorial 9 Working with XHTML. XP Objectives Describe the history and theory of XHTML Understand the rules for creating valid XHTML documents Apply a.
Creating a Well-Formed Valid Document. 2 Objectives Introducing XHTML Creating a Well-Formed Document Creating a Valid Document Creating an XHTML Document.
28-Jun-15 StAX Streaming API for XML. XML parser comparisons DOM is Memory intensive Read-write Typically used for documents smaller than 10 MB SAX is.
XML Introduction What is XML –XML is the eXtensible Markup Language –Became a W3C Recommendation in 1998 –Tag-based syntax, like HTML –You get to make.
September 15, 2003Houssam Haitof1 XSL Transformation Houssam Haitof.
Manohar – Why XML is Required Problem: We want to save the data and retrieve it further or to transfer over the network. This.
Introduction to XML: Part I By Sandeep Jangity CS 157B, Section 2 Dr. Lee.
Working with XHTML Creating a Well-Formed Valid Document.
XP Tutorial 9New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with XHTML Creating a Well-Formed Valid Document Tutorial 9.
XML, CFMX CFML & SQL XML Kevin Penny, MMCP
XP The University of Akron Summit College Business Technology Department Computer Information Systems 2440: 140 Internet Tools Instructor: Enoch E. Damson.
XML Anisha K J Jerrin Thomas. Outline  Introduction  Structure of an XML Page  Well-formed & Valid XML Documents  DTD – Elements, Attributes, Entities.
Why XML ? Problems with HTML HTML design - HTML is intended for presentation of information as Web pages. - HTML contains a fixed set of markup tags. This.
Scientific Markup Languages Birds of a Feather A 10-Minute Introduction to XML Timothy W. Cole Mathematics Librarian & Professor of.
XML eXtensible Markup Language by Darrell Payne. Experience Logicon / Sterling Federal C, C++, JavaScript/Jscript, Shell Script, Perl XML Training XML.
XSLT for Data Manipulation By: April Fleming. What We Will Cover The What, Why, When, and How of XSLT What tools you will need to get started A sample.
XML and its applications: 4. Processing XML using PHP.
Structured-Document Processing Languages Spring 2011 Course Review Repetitio mater studiorum est!
ColdFusion’s XML Capabilities Maryland CFUG April 12, 2005 Presented by Doug Ward.
ASP.NET and XML Presented By: Shravan S. Mylavarapu 1.
XML eXtensible Markup Language w3c standard Why? Store and transport data Easy data exchange Create more languages WSDL (Web Service Description Language)
Representing Web Data: XML CSI 3140 WWW Structures, Techniques and Standards.
XP 1 CREATING AN XML DOCUMENT. XP 2 INTRODUCING XML XML stands for Extensible Markup Language. A markup language specifies the structure and content of.
An Introduction to XML Presented by Scott Nemec at the UniForum Chicago meeting on 7/25/2006.
XML What is XML? XML v.s. HTML XML Components Well-formed and Valid Document Type Definition (DTD) Extensible Style Language (XSL) SAX and DOM.
What is XML?  XML stands for EXtensible Markup Language  XML is a markup language much like HTML  XML was designed to carry data, not to display data.
What is XML (Extensible Markup Language)? XML is basically a better comma delimited file. Example: Your client asks you to write a new reporting system.
Session IV Chapter 9 – XML Schemas
XML TUTORIAL Portions from w3 schools By Dr. John Abraham.
1 Chapter 10: XML What is XML What is XML Basic Components of XML Basic Components of XML XPath XPath XQuery XQuery.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter X IXXXXXXXXXX XXXXXX.
XP Tutorial 9 1 Working with XHTML. XP SGML 2 Standard Generalized Markup Language (SGML) A standard for specifying markup languages. Large, complex standard.
Softsmith Infotech XML. Softsmith Infotech XML EXtensible Markup Language XML is a markup language much like HTML Designed to carry data, not to display.
Utilizing XML in ColdFusion MX by Attila Domokos.
Introduction to XML This presentation covers introductory features of XML. What XML is and what it is not? What does it do? Put different related technologies.
XML eXtensible Markup Language. XML A method of defining a format for exchanging documents and data. –Allows one to define a dialect of XML –A library.
XML and SAX (A quick overview) ● What is XML? ● What are SAX and DOM? ● Using SAX.
COMP9321 Web Application Engineering Semester 2, 2015 Dr. Amin Beheshti Service Oriented Computing Group, CSE, UNSW Australia Week 4 1COMP9321, 15s2, Week.
CS 157B: Database Management Systems II February 13 Class Meeting Department of Computer Science San Jose State University Spring 2013 Instructor: Ron.
Web Technologies Lecture 4 XML and XHTML. XML Extensible Markup Language Set of rules for encoding a document in a format readable – By humans, and –
Dom and XSLT Dom – document object model DOM – collection of nodes in a tree.
What is XML? eXtensible Markup Language eXtensible Markup Language A subset of SGML (Standard Generalized Markup Language) A subset of SGML (Standard Generalized.
XML and Object Serialization. Structure of an XML Document Header Root Element Start Tags / End Tags Element Contents – Child Elements – Text – Both (mixed.
1 Introduction JAXP. Objectives  XML Parser  Parsing and Parsers  JAXP interfaces  Workshops 2.
XP Tutorial 9New Perspectives on HTML and XHTML, Comprehensive 1 Working with XHTML Creating a Well-Formed Valid Document Tutorial 9.
Martin Kruliš by Martin Kruliš (v1.1)1.
Tutorial 9 Working with XHTML. New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition 2 Objectives Describe the history and theory of XHTML.
CIS 228 The Internet 9/20/11 XHTML 1.0. “Quirks” Mode Today, all browsers support standards Compliant pages are displayed similarly There are multiple.
Jackson, Web Technologies: A Computer Science Perspective, © 2007 Prentice-Hall, Inc. All rights reserved Chapter 7 Representing Web Data:
Tutorial 9 Working with XHTML. XP Objectives Describe the history and theory of XHTML Understand the rules for creating valid XHTML documents Apply a.
XML & JSON. Background XML and JSON are to standard, textual data formats for representing arbitrary data – XML stands for “eXtensible Markup Language”
I Copyright © 2004, Oracle. All rights reserved. Introduction.
1 Introduction to XML Babak Esfandiari. 2 What is XML? introduced by W3C in 98 Stands for eXtensible Markup Language it is more general than HTML, but.
Unit 4 Representing Web Data: XML
XML processing in ColdFusion MX
XML in Web Technologies
Chapter 7 Representing Web Data: XML
XML Data Introduction, Well-formed XML.
XML and its applications: 4. Processing XML using PHP
Presentation transcript:

XML processing in ColdFusion MX Everything you wanted to know about XML, but were afraid to ask October 2006 Jaxfusion User Group

About the Presenter »David Fekke »Working with XML 1999 »Lead for Vurv HR-XML API

Covered in this presentation »Properly formed XML »ColdFusion XML Tags and functions »XPath queries »XML XSDs and Validation »XML Namespaces »DOM vs. Streaming parsers »StAX API

XML »eXtensible Markup Language »Originated from SGML »W3C standard »More versatile then Flat files

XML Syntax »XML declaration » »Must have one root tag » »All tags must have closing tag. » : single tags can have forward slash at the end » tags can have attributes

Pre MX XML features »WDDX »SOXML custom tag, windows only

ColdFusion MX 6 »CFXML tag turns serialized XML into a ColdFusion object »XMLParse() function »ColdFusion XML Object works like series of structures and arrays »XMLSearch() function »XMLSearch Uses XPath queries to return array of XML nodes

XML Check functions »IsXMLIsXML »IsXmlDocIsXmlDoc »IsWDDXIsWDDX »IsXmlAttributeIsXmlAttribute »IsXmlElemIsXmlElem »IsXmlNodeIsXmlNode »IsXmlRootIsXmlRoot

XML editing functions »XmlNew() »XmlChildPos()XmlChildPos »XmlNew()XmlNew »XmlTransform()XmlTransform »XmlElemNew()XmlElemNew

ColdFusion MX 7 Functions »XmlGetNodeType()XmlGetNodeType »XmlValidate()XmlValidate

XPath queries »Provides a way to pull the elements you need without having to iterate through the entire DOM »/rootelement/parent/childelement »//childelement//childelement »/rootelement/parent[childelement = “foo”] »Used with XSLT templates

XML Validation »Define XML with DTD or XSD »XSD preferred method for validation »XSD uses an XML format »Allows for strict and custom datatypes »Allows for pattern recognition

Dwight Mercer 32 Miguel Cabrera 33

Default XSD element types »xs:String »xs:normalizedString »xs:integer »xs:base64Binary »xs:negativeInteger »xs:positiveInteger »xs:Hexbinary »xs:Long »xs:short

Custom Types

XML Namespaces »Namespaces allow for XML to be segmented into different parts » namespace will prefix the element name »<fekke:root xmlns:fekke=“ »No namespace xmlns=“” »Use explicit XPath with no namespace »Nonamespace xpath=“/:element”

DOM, SAX and Pull Parsers »ColdFusion uses a DOM parser. Entire XML object in memory. »SAX parser reads in file portion of the time. Raises events when elements match. »StAX uses pull based parser to read one node at time. Uses streams to read in portion

StAX »BEA JSR 173 »Many implementations »Includes Event and Pull parsers »Jim Collins working on CFStAX library »Woodstox library extremely fast implementation

StAX objects »XMLInputFactory »XMLStreamConstants »XMLStreamReader »XMLEventReader

XMLStreamConstants »Constants for different node types »XMLStreamConstants.START_ELEMENT »XMLStreamConstants.END_ELEMENT »XMLStreamConstants.START_DOCUMENT »XMLStreamConstants.END_DOCUMENT

XmlStreamReader methods »Next() iterates through XML stream »getLocalName() returns tag name »getAttributeCount() returns tags attribute count »getAttributeLocalName() returns attribute name »getAttributeValue() returns attribute value »hasText() returns boolean if element has text »getText() returns element text

Free XML Tools »IE and Firefox have built in DOM parsers »XMLFox for testing validation »XMLButterfly for editing and formatting XML »Don’t use ALtova XML Spy, its crap!

Summary »Use XMLSearch instead of iterating through DOM »Don’t use cfsavecontent to build XML, use CFXML »If using no namespace, use explicit xpaths »Use xmlFormat or CDATA to handle special characters »Use XSDs over DTDs

Links » » » » con.com/read/ htmhttp://coldfusion.sys- con.com/read/ htm

Books »ColdFusion Application Development »Beginning XML (Programmer to Programmer) »O’reilly XML in a Nutshell