
Meet Dan Schorr, Italian software professional with over 20 years in project management, software development, and architecture, who has led software teams across telecom, research, marketing, and internet consulting.
Discover how the XML standard provides a flexible framework for exchanging data across sources and networks, and learn basic grammar, namespaces, and XML web services like SOAP.
Although it is defined as a language, in reality it is NOT. It is a set of rules and conventions to define any markup language (based on markups).
With XML you can define your own language and the hierarchical relationships between the components.
With XML you can extend your language.
XML has become one of the fundamental elements for the implementation of information systems, independently from the technology and the used architecture
In this lesson we will see why XML is important and when it is to be used.
In this example we will understand what tags are in XML and how to use them.
We will understand the hierarchical structure of an XML document and how it is displayed in an Internet browser
In order to understand the basic rules of an XML document,despite its content, we will first analyze an example.
We will give an informative structure assigning meaningful names to the tag.
The example contains information to describe a organizational structure in a generic business company.
Nesting is one of the most important concept when structuring an XML document.
The objects representing the information are inserted one within the other, when this is meaningful from the logical point of view, through the nesting process.
XML tags, as in any markup language, are associated to attributes which explain better some characteristic.
Attributes are couples name=“value” which must be inserted within the tag.
We will see the most important definitions to be used when structuring an XML document.
We will concept e.g.:
and we will see when an XML is valid and what valid means
XML Syntax is the set of sintatic rules to respect to have a well formed XML document.
In this lesson we will talk about the XML Syntax starting from the structure of an XML document.
An XML document is a container of information characterized by a hierarchical logical structure which can contain any type of object (flat, relational, binary or as object).
In this lesson we will see what a prologue is in an XML file and when it has to be included.
The Elaboration instructions are directives to give guidelines to the applcation using the XML document.
An XML document can be associated to grammar rules.
The grammar rules describe the semantic aspects of an XML document.
We will see how to set the information about the Grammar into an XML document.
We will see how to specify comments into an XML document.
Comments are additional information which can provide explanation about what is in an XML document.
We will see the defintion of the elements in an XML document and also some examples where elements are used.
An XML document is composed of a hierarchy of elements which can be nested at wish according to precise sintactic rules.
We will see how to define the most important and external element in an XML document: the root element
After the overview of the elements in an XML document we will see how to generate nesting of elements
We will see how we can name elements in XML and which naming convention is available for XML.
We will see which names are allowed and which not.
Sometimes some information of an element instead of being specified in a child element can be expressed as its specification. attributes to be associated to the markup of the elements.
Using attributes it is possible to better specify some characteristics or behaviours of the element.
We will see how to do this in this lesson.
As for the elements there are specific naming conventions also for the attributes.
This is explained in this lesson.
In this lesson we will see how to set the values of the attributes of elements in an XML document
In XML there are special markups which are called entities.
An entity, in general, is a way to insert into an XML document a piece of text to be analyzed only during the elaboration phase of the XML document.
It is therefore not considered during the analisys of the form of the document.
We will see the main predefined entities in XML.
Well formed XML documents are those compliant to the XML syntax as described in the specifications
XML documents must contain the information in such a way to be elaborated in automatic way.
At this aim syntactic rules alone are not enough.
We need also to define a grammar to identify the allowed elements, their number, their attributes, what is optional and what is mandatory, etc.
Validation can be performed through several tools available on the market.
Some of them are very complex tools including many functions to study and generate grammars, and to validate and transform XML documents.
A list of some of popular validation tools will be shown in this lesson.
To define a Grammar it is necessary to know and understand what we need to represent with our XML document.compliant to in order to produce what we are aiming.
We will start with the organization of the information and define our first Grammar.
We saw that we can insert a grammar in an XML document.
We already said that we can specify a grammar within an external file (extension “.dtd”).
This is a flexible way as you can refer more than one XML document to this file if you are using the same grammar.
In this lesson we will see what happens to our example when we move the grammar to an external document.
We just understood the principles of XML grammars and their relationships with the XML documents.
We will see in details some sintactic elements to produce XML grammars.
The grammar structure of a document is a portion of code which must satisfy some important sintactic rules.
Everything is linked to the concept of document type, which the grammar represents the definition.
A grammar describes a document type as all the XML documents which respect that grammar have structural characteristics in common.
Thus these documents are of the same type.
Each of these situations can be described with the grammar rules of the DTD grammars.
We will see this in this lesson.
We already said that the root element and the document type must have the same name.
We will see how to define the Grammar for the root element.
An XML document is a container of information organized hierarchically.
The hierarchy is described by the DTD grammars.
In this way the XML document is validated for its structure.
We will see how to do this with the hlep of the Nesting concept.
The rules describing the sorting order are very rigid.
It can be useful to have elements with a non pre-defined number of child elements.
It can be useful to have more than one instance for child element.
This is done defining the allowed number of elements in the Grammar.
You may need to choose only one element in a pre-defined list.
In this case the sintactic elements are no more enough.
In this lesson we will see how to do this.
In this lesson we will see how to define elements of mixed content in an XML document
Sometimes you might need to define elements which you do not decide the content type yet.
This is useful to have less constraints during the analysis.
This means to define a rule which specify for an element to contain any information (text or list of sub-elements).
We will see how to do this in this lesson.
We already know that in XML we can have elements without content.
The information of these is represented by the presence of the element itself.
No further information is needed.
We will see how to do this in this lesson.
A sequence allows to decide everything about the content of an element:
We will see how to define a sequence in XML in this lesson.
In this lesson we will see:
The entities are declared in the grammar and are then used in the XML document.
We will see in this lesson how to declare an entity (the syntax).
Also external entities can be defined.
External entities are contained in XML documents or grammars but in separated documents.
We will see in this lesson how to define an external entity.
We just saw entities which are defined in DTD grammars and then are inserted in the XML code to be substituted with the value associated to the entity.
In case you may need to have the same result within the DTD grammar.
It is possible to use the parametric entities defined and used directly in the DTD grammar.
We will understand the concept of parametric DTD analyzing one example of an XML document referring to an internal DTD grammar.
Generating a grammar we need to consider the attributes that are present in the XML document.
If we do not do this and try to validate the XML document the result will be negative.
In fact, in the grammar we missed out the definition of the attributes of the elements.
We need to describe any attribute in any element of a XML document in the associated grammar.
We will see how to do this in this lesson.
The attributes are associated to a type to explain to the XML parser which information they can memorize.
In this lesson we will see a list of possibile types to be associated to attributes.
Enumerations are attributes for which a real type is not defined in the grammar, but a list of possible values.
If the attribute present in the XML document is associated to one of the values provided by the grammar.
Then the document can be valid.
In case we use an attribute not included in the list, the document could not be validated.
The type of data NMTOKEN identifies a typical XML name.
We will see the rules indicated by the NMTOKEN attribute.
Another type of values associable to the XML attributes is NMTOKENS.
With NMTOKENS you define a list of values of the NMTOKEN type.
When using NMTOKENS it is natural to think that the value of the attribute is a list of names where every single element follows the naming rules defined before.
Explore how XML documents rely on elements and attributes, and how the choice between them shapes document use, with DTD grammars defining both element and attribute rules.
Using complex and sofisticated structures can introduce problems, especially if we are going to use more grammars, also produced by third parties.
We can solve this issue using the namespace.
We will see how to do this in this lesson.
Starting from an example of XML document created with the contribution of 2 different teams we will understand the importance of namespaces for XML.
We will see how to use the namespaces starting from the previous examples of XML documents.
In this lesson we will see the syntax of the namespaces in XML.
Attributes are also defined for the XML namespaces.
We will see how to define attributes for a namespace.
The presence of DTD grammars and the the requisite to validate the XML documentnis delicate when using the namespaces.
We will see how to validate an XML document using a grammar which makes reference to namespaces.
The best example to show the importance of namespaces in the XML language is the integration of a portion of MathML code within an XHTML document.
XSL stands for eXtensible Style Language.
It is the component of a language for the definition of style sheets.
These style sheets handle the presentation of data contained in XML documents.
In this way they can be shown correctly, e.g. In a web browser.
In this lesson we will see an example of how to use XSLT to transform an XML document in something different.
In this lesson we will complicate the structure of the previous example.
Having an XML document it is possible to apply different XSLT documents in order to obtain different results with the aim to always produce a HTML file as an output....
We will see the result of producing the transformation of the XML document.
Templates are rules that can be applied to any XML element of the source document.
They are replicated automatically for all the istances of that element.
In this lesson our scope is to transform an XML document into a PDF file going through the generation of the XSL:FO document using an XSL style sheet.
In this lesson starting from an XML document dealing with personal data of customers we will generate a PDF report containing all the data.
In the 2 components of the XSL language, XSLT and XSL:FO, we need to retrieve key elements in XML documents to use to extract information useful in other environments: this is done by the special expressions of the XPath language.
XPath is a powerful and flexible language used to create expressions even complex: patterns.
Through patterns the nodes of the XML document tree can be retrieved.
XPath is a key element to retrieve information within an XML document.
To better understand XPath we will go back to the previous example.
The match attribute is typical of the <xsl:template> element used in XSL.
The scope of match is to position the XSL elaboration in a specific point of the XML document in order to be run a recurring process through all the elements.
The pattern to use has to retrieve exactly an element, or a collection of elements, within the XML document.
The select attribute is typical of all the XSL elements which have to accomplish actions of data extraction from specific elements within the XML document.
Conclude by examining ex-parte language for positioning and selection, using referrers within a tree of nodes and a dedicated syntax; illustrate patterns X with key attributes and elements.
A complete video tutorial to understand and write your own XML files, create amazing web services and manage your information within your organization and also in connection with other external entities and partners.
Basically the course contains:
Introduction
Why XML
Organization of the course
The Overview of XML
Why XML
Example of An XML document
Basic Rules
Nesting
Attributes
Definitions
Structure of an XML document
Components of an XML document
Elements of an XML document
Nesting of elements
Tag naming
Tag attributes
Predefined entities
The DTD Grammars
The DTD Grammars
Validation Tools
Define Your First Grammar
Internal and External Grammars
More documents for the same Grammar
The Basis of XML Grammars
DTD and Entities
Syntax of the internal Entities
Syntax of the external Entities
Syntax of the parametrical Entities
DTD and Attributes
Syntax of attributes
Attributes in the DTD grammars
Type of Attributes and Modifiers
Enumerations
NMTOKEN and NMTOKENS
The namespaces
The namespaces
Why the XML namespaces
Use the XML namespaces
Syntax of the namespaces
Attributes and namespaces
Use the XML namespaces
Namespaces and DTD grammars
An application of namespaces
Transform with XSLT
Transform with XSLT
Example of XSLT Transformation
2nd Example of XSLT Transformation
Templates
Formatting with XSL:FO
The formatting process
Example
2nd Example - more complex
XPath
How to use XPath
Patterns for the match attribute
Patterns for the select attribute
XLink and XPointer
XLink and XPointer
XLink
Simple use of XLink
Complex links
XPointer
Example of use of XPointer
XML and the Web: XHTML
What’s XHTML
The basic XHTML syntax
The validation process
TEI - XML and text encoding
TEI
Structure of a TEI-Lite document
Transform a TEI-Lite document
MathML
Webservices