SlideShare a Scribd company logo
XML Fundamentals
Your company tagline
70s Big headache
During 70's big companies make a lot
of integrations among them using flat
files.
The solution
How to know what is the data type?
1
The solution
Report relational data (master detail)
2
The companies had to build hugh
validators and loading process.
3
IBM invented GML (generic markup
language) and ISO adopted as SGML then
this standard was the base to define HTML
and many developers adopted it as a
exchange language.
XML stands for EXtensible Markup Language
XML is a markup language much like HTML
XML was designed to store and transport data
XML was designed to be self-descriptive
XML is a W3C Recommendation
What is XML?
It is based on tags related by nodes in a hierarchical way
XML Simplifies things
Data Sharing Data Transport Platform Changes Data Availability
XML Syntax
Must have a root element
XML Prolog
<?xml version="1.0" encoding="UTF-8"?>
All XML Elements must have a closing tag
<p>This is a paragraph.</p>
<br />
The tags elements are case sensitive
<table></table>
<Table></Table>
The tag elements must be properly nested
Incorrect
<b><i>This text is bold and italic</b></i>
Correct
<b><i>This text is bold and italic</i></b>
The attribute Values must be quoted
incorrect
<note date=12/11/2007>
<to>Tove</to>
<from>Jani</from>
</note>
Correct
<note date="12/11/2007">
<to>Tove</to>
<from>Jani</from>
</note>
Comments in XML
<!-- This is a comment -->
If the xml accomplish with these
rules the xml is well formed.
XML Element Text
Attributes
Other Element
Also a combination
XML Namespaces
<table>
<tr>
<td>Apples</td>
<td>Bananas</td>
</tr>
</table>
<table>
<name>African
Coffee Table</name>
<width>80</width>
<length>120</length>
</table>
Adding a prefix
<h:table>
<h:tr>
<h:td>Apples</h:td>
<h:td>Bananas</h:td>
</h:tr>
</h:table>
How to define the prefix?
<h:table
xmlns:h="http://www.w3.org/TR/html4/">
<h:tr>
<h:td>Apples</h:td>
<h:td>Bananas</h:td>
</h:tr>
</h:table>
How to constraint the data and
validate the XML Content?
Using a Xml Schema Definition File (XSD) or a Data Type
Definition file DTD
The most used is the XSD.
<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema">
...
</xs:schema>
We will start with the standard XML declaration followed by the xs:schema
element that defines a schema:
XSD describe the elements and attributes that an xml could
use.
It can be defined three kind of data types and with these
definitions the elements will be composed.
● Attribute
● Simple Type
● Complex Type
Attribute
<xs:attribute name="xxx" type="yyy"/>
<xs:attribute name="lang" type="xs:string" default="EN"/>
<xs:attribute name="lang" type="xs:string" use="required"/>
Simple Type
<xs:element name="idElement" type="id"/>
<xs:simpleType name="id">
<xs:restriction base="xs:integer">
<xs:minInclusive value="0"/>
<xs:maxInclusive value="100"/>
</xs:restriction>
</xs:simpleType>
Complex Type
<xs:element name="note" type="noteType"/>
<xs:complexType name="noteType" >
<xs:sequence>
<xs:element name="to" type="xs:string"/>
<xs:element name="from" type="xs:string"/>
<xs:element name="heading" type="xs:string"/>
<xs:element name="body" type="xs:string"/>
</xs:sequence>
</xs:complexType>
Commons Data types
xs:string
xs:decimal
xs:integer
xs:boolean
xs:date
xs:time
Restrictions of Values
<xs:element name="age">
<xs:simpleType>
<xs:restriction base="xs:integer">
<xs:minInclusive value="0"/>
<xs:maxInclusive value="120"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
Set of Values
<xs:element name="car">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="Audi"/>
<xs:enumeration value="Golf"/>
<xs:enumeration value="BMW"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
Using REGEXP
<xs:element name="letter">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="[a-z]"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
Restriction of Length
<xs:element name="password">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:length value="8"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
How to process it?
DOM
Using the Document Object Model that
process the xml file as a tree structure
this method is used by HTML
The understanding and handling the xml
with this method could be easier but add
an overhead.
DOM Properties
These are some typical DOM properties:
* x.nodeName - the name of x
* x.nodeValue - the value of x
* x.parentNode - the parent node of x
* x.childNodes - the child nodes of x
* x.attributes - the attributes nodes of x
DOM Methods
● x.getElementsByTagName(name) - get all elements with a specified
tag name
● x.appendChild(node) - insert a child node to x
● x.removeChild(node) - remove a child node from x
SAXSimple API for XML is an algorithm
alternative to process a xml file sequentiality
this method could be faster but depend on
some events so could be more difficult to
manage.
Andres Felipe Rincon
PMP, TOGAF

More Related Content

PPTX
Xml schema
PPTX
XML Schema
ODP
SCDJWS 1. xml schema
DOCX
Introduction to xml schema
PPT
02 xml schema
PPTX
Xml schema
PPT
Xsd examples
PPTX
XML Schemas
Xml schema
XML Schema
SCDJWS 1. xml schema
Introduction to xml schema
02 xml schema
Xml schema
Xsd examples
XML Schemas

What's hot (19)

PPT
Xml schema
PDF
Xsd tutorial
PPT
XML Schema
PPTX
XML's validation - XML Schema
PPT
PPTX
Publishing xml
PPT
XML/XSLT
PPTX
Web programming xml
PDF
Xml schema
PPTX
fundamentals of XML
PPTX
XML DTD and Schema
PPTX
XML, DTD & XSD Overview
PPTX
PPT
Xml Schema
PPTX
Jungahan web presentation
PPTX
Xml basics
Xml schema
Xsd tutorial
XML Schema
XML's validation - XML Schema
Publishing xml
XML/XSLT
Web programming xml
Xml schema
fundamentals of XML
XML DTD and Schema
XML, DTD & XSD Overview
Xml Schema
Jungahan web presentation
Xml basics
Ad

Viewers also liked (15)

PPTX
Unit 1
PPTX
ADO .NET by Sonu Vishwakarma
PPT
Organizational behavior learning
PDF
Advanced Asp.Net Concepts And Constructs
PDF
Asp.Net 3 5 Part 1
PPT
Unit 1
PPT
Distributed computing
PPT
Intro, personality, attitude edited
PDF
Chapter 1 - Multimedia Fundamentals
PDF
Web Services (SOAP, WSDL, UDDI)
PPT
Chapter1
PPTX
Ooad unit – 1 introduction
PDF
Organisational behavior
PPT
Organisational behaviour ppt
PPTX
Introduction of Cloud computing
Unit 1
ADO .NET by Sonu Vishwakarma
Organizational behavior learning
Advanced Asp.Net Concepts And Constructs
Asp.Net 3 5 Part 1
Unit 1
Distributed computing
Intro, personality, attitude edited
Chapter 1 - Multimedia Fundamentals
Web Services (SOAP, WSDL, UDDI)
Chapter1
Ooad unit – 1 introduction
Organisational behavior
Organisational behaviour ppt
Introduction of Cloud computing
Ad

Similar to XML Fundamentals (20)

DOC
PPTX
PPTX
Web Service Workshop - 3 days
PDF
CTDA Workshop on XML and MODS
PPTX
XML notes.pptx
PPTX
Internet and Web Technology (CLASS-7) [XML and AJAX] | NIC/NIELIT Web Technology
PPT
Xml and DTD's
PPT
Introduction of xml and xslt
PPT
1 xml fundamentals
PDF
XSD Incomplete Overview Draft
PPT
Xml iet 2015
PPT
XML Presentation-2
PPT
Introduction to xml
DOCX
PPTX
Xsd restrictions, xsl elements, dhtml
PDF
WT UNIT-2 XML.pdf
PDF
XML for Web Development Information tech.pdf
PPT
CrashCourse: XML technologies
PPTX
Xml andweb services
Web Service Workshop - 3 days
CTDA Workshop on XML and MODS
XML notes.pptx
Internet and Web Technology (CLASS-7) [XML and AJAX] | NIC/NIELIT Web Technology
Xml and DTD's
Introduction of xml and xslt
1 xml fundamentals
XSD Incomplete Overview Draft
Xml iet 2015
XML Presentation-2
Introduction to xml
Xsd restrictions, xsl elements, dhtml
WT UNIT-2 XML.pdf
XML for Web Development Information tech.pdf
CrashCourse: XML technologies
Xml andweb services

Recently uploaded (20)

PDF
iTop VPN Free 5.6.0.5262 Crack latest version 2025
PPTX
assetexplorer- product-overview - presentation
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
Softaken Excel to vCard Converter Software.pdf
PPTX
L1 - Introduction to python Backend.pptx
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PDF
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
top salesforce developer skills in 2025.pdf
PDF
System and Network Administraation Chapter 3
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PPTX
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PPTX
Reimagine Home Health with the Power of Agentic AI​
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
iTop VPN Free 5.6.0.5262 Crack latest version 2025
assetexplorer- product-overview - presentation
Navsoft: AI-Powered Business Solutions & Custom Software Development
Softaken Excel to vCard Converter Software.pdf
L1 - Introduction to python Backend.pptx
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
Wondershare Filmora 15 Crack With Activation Key [2025
PTS Company Brochure 2025 (1).pdf.......
top salesforce developer skills in 2025.pdf
System and Network Administraation Chapter 3
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
Upgrade and Innovation Strategies for SAP ERP Customers
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
How to Choose the Right IT Partner for Your Business in Malaysia
Reimagine Home Health with the Power of Agentic AI​
Design an Analysis of Algorithms II-SECS-1021-03
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool

XML Fundamentals

Editor's Notes

  • #11: t simplifies data sharing: b/c abstracts the differences between operating systems and formalize the message format, It simplifies data transport: could be stored as a flat file and could be send as an string for many protocols, there are also specific protocols designed to shared this kind of format information It simplifies platform changes: b/c the message is easier to expand or upgrade to new operating systems, new applications, or new browsers, without losing data. It simplifies data availability: it is easy to read for a humans and machines.