Want to create interactive content? It’s easy in Genially!

Get started free

XML Guide

Gale

Created on October 22, 2024

Start designing with a free template

Discover more than 1500 professional designs like these:

Transcript

XML Guide

A beginner's course in XML

Let's go!

Introduction

Learn the basics of XML, including reasons why XML matters to technical communicators and the components that make up a "well-formed" document

Start course

Index

Assessment
Modules
Certificate
Activities

Modules

Understand how to formally describe elements in XML

Schema

Learn the parts that make an XML document and how they work

Components

An introduction to what XML can do and why it is an important tool for technical communicators

Capabilities

Module 1. What is XML used for?

Extensible Markup Language (XML) is a markup language that allows data definition using custom tags. Creating tags can help you describe your data and its structure, allowing you to separate document formatting and content. Programming languages can use XML documents to structure and process data.

What can XML Do?

Click the shapes to learn

FormatDocuments

CreateLayouts

Store Configuration Data

TransferData

Search the Web

XML for Technical Communicators

Click the questions to learn
Why should technical communicators care about XML?
Why is it important to the profession?
Why might technical communicators want to know this skill?

Module 2. Components

Before we get started learning more about XML in practice, it is important to know the best tools to use. You can create and edit files using the following tools. Some have more advantages than others.

Click the tools to learn
Text Editors
Web Browsers
Source-Code Editors

Elements

An element is a basic unit within an XML document

Click the boxes to learn what an element can contain

Elements: Naming Rules

Elements require the following in their names:

  • Case-sensitivity
  • First character must be a letter or underscore
  • Can contain letters, digits, hyphens, underscores, and periods
  • Cannot start with the letters XML
  • Cannot contain spaces

Source: W3Schools

Module 3. Schema

Schema formally describe the structure of an XML document by defining:

  • Number and order of child elements
  • Elements and attributes
    • Data types
    • Default and fixed values
Schema support data types, making it easier to:
  • Describe document content
  • Validata data correctness
  • Define data restrictions
  • Define data formats
  • Convert data between different types

Click to view the XML

Source: W3Schools

Identify the Schema Syntax Errors

Activity 2

Identify the Elements & Attributes Syntax Errors

Activity 1

Identify the Elements & Attributes Syntax Errors

you have 10 seconds to click

<Animals><Animal Category="Mammals><CommonName>Polar Bear</CommonName> <LatinName>Ursus maritimus</LatinName> <AverageWeight>990 lbs.</AverageWeight> <Average Height>4.4 ft.</AverageHeight><Animal><Animal Category="Birds"><CommonName>Flamingo</CommonName><LatinName>Phoenicopterus ruber</LatinName><Average Weight>8.8 lbs.</Average Weight><AverageHeight>4.9 ft.</AverageHeight></Animal></Animals>

Identify the Schema Syntax Errors

<xs:schema xmlns:xs="http://www.animals.com/examples"> <xs:element name="Animals"> <xs:complexType> <xs:sequence> <xs:element name="Animal" maxOccurs="unbounded"> <xs:complexType> <xs:sequence> <xs:element name="CommonName" type="xs:string"/> <xs:element name="LatinName" type="xs:string"/> <xs:element name="AverageWeight" type="xs:integer"/> <xs:element name="AverageHeight" type="xs:string"/> </xs:sequence> <xs:attribute name="Category" type="xs:string"/> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="Habitat" type="xs:string"/> </xs:schema>

you have 10 seconds to click

Evaluation

Put your XML knowledge to the test! 5 Questions

1/5

2/5

3/5

4/5

5/5

Certificateof Achievement

Congratulations on reaching the first stop on your journey of learning XML!

Abigail Vo

Lead Instructional Designer

October, 2024

Course completed!

Search the Web

Search engines utilize XML tags to make searches more relevant. Example: When searching a local library’s database for books by J.R.R. Tolkien, the database parses its data for search results with J.R.R. Tolkien tagged as an author.

Why is it important to the profession?

XML allows for the publishing of content to multiple channels using single sourcing, which means that one source of content can be shared with multiple. Single sourcing makes editing downstream incredibly easy and eliminates the time required to edit all the child documents.

Source-Code Editors

Source-code editors provide the most in-depth experience for editing XML. Users can spot errors, view highlighted elements, read numbered lines of code, and validate their code in one enviroment. Source-code editors usually cost a one-time fee or subscription, but some, like Visual Studio are free.

Visual Studio Code
Sublime Text

Attributes

Element with Attribute

Attributes contain unique labels related to an element. Example: <Animals Group="Mammals"> </CommonName>Zebra</CommonName>

Why should technical communicators care about XML?

XML offers many benefits, including being flexible in organizing, tagging, and recalling information. Many consider XML an essential skill to learn in the technical writing profession, as many companies prefer to organize their content in the format.

Transfer Data

XML is a format programmers use to transfer data in a readily accessible format for APIs (Application Programming Interface). Programmers connect APIs to save and access databases in the applications they develop. Example: Google’s Custom Search XML API allows Google Site Search customers to display and format Google search results on their websites using XML.

Programmable Search Engine

Code Academy

Create Layouts

Layouts determine where data should be rendered on-screen. Example: Android mobile applications use layouts created in XML. Android layouts can align on-screen content horizontally, vertically, and dynamically.

Code Academy

Nothing

Element with No Content

Elements with no content can be used as placeholders for text. Example: <CommonName></CommonName>

Web Browsers

Web browsers offer a lightweight option for viewing XML code. However, it is not suggested by professionals to edit using web browsers, as they can be cumbersome and are unable to validate your code.

Google Chrome
Apple Safari

Format Documents

Programming languages can process XML and display the data using tags that define elements, such as headings, paragraphs, and steps. Example: Files, such as PDF files, Microsoft Word documents, and PowerPoint documents, are stored as XML. When opening a file, the application parses, formats, and applies styles using XML to display what you see on screen.

Code Academy

Other Elements

Child Elements

By nesting elements, XML can be used to create a data hierarchy for organizing information. Example: <Mammals> <CommonName>Zebra</CommonName> <LatinName>Equus quagga</LatinName> </Mammals>

Why might technical communicators want to know this skill?

Many companies' preferred method of storing information is based on XML, which makes it a marketable skill in the job market. In Huntsville, Alabama, most Department of Defence contractors require technical writers with XML experience.

Text Editors

Text editors are usually included in the base operating systems package of your computer. Although they are low-cost, text editors may make it more difficult to spot user-made errors in XML code, as they do not highlight elements or suggest corrections.

Microsoft NotePad
Apple TextEdit

Store Configuration Data

XML stores data used to configure applications. Example: Microsoft Excel spreadsheets are stored as XML. The spreadsheet’s XML contains the data, column definitions, field formatting, calculations, etc.

Code Academy

Text

Element with Text

Elements with text label the text value Example: <CommonName>Zebra<CommonName>

Example.xsd

<xs:schema targetNamespace:xs="http://www.example.org"> <xs:element name="UnionTest"> <xs:complexType> <xs:sequence> <xs:element name="element1" type="xs:string"/> <xs:element name="element2" type="xs:string"/> </xs:sequence> <xs:attribute name="attribute1" type="xs:string"/> <xs:attribute name="attribute2"> <xs:simpleType> <xs:union> <xs:simpleType> <xs:restriction base="xs:string"> <xs:pattern value="abcd"/> </xs:restriction> </xs:simpleType> </xs:union> </xs:simpleType> </xs:attribute> </xs:complexType> </xs:element> </xs:schema>

Oracle Help Center

Create Layouts

Layouts determine where data should be rendered on-screen. Example: Android mobile applications use layouts created in XML. Android layouts can align on-screen content horizontally, vertically, and dynamically.

Code Academy

Format Documents

Programming languages can process XML and display the data using tags that define elements, such as headings, paragraphs, and steps. Example: Files, such as PDF files, Microsoft Word documents, and PowerPoint documents, are stored as XML. When opening a file, the application parses, formats, and applies styles using XML to display what you see on screen.

Code Academy

Transfer Data

XML is a format programmers use to transfer data in a readily accessible format for APIs (Application Programming Interface). Programmers connect APIs to save and access databases in the applications they develop. Example: Google’s Custom Search XML API allows Google Site Search customers to display and format Google search results on their websites using XML.

Programmable Search Engine

Code Academy

Search the Web

Search engines utilize XML tags to make searches more relevant. Example: When searching a local library’s database for books by J.R.R. Tolkien, the database parses its data for search results with J.R.R. Tolkien tagged as an author.

Store Configuration Data

XML stores data used to configure applications. Example: Microsoft Excel spreadsheets are stored as XML. The spreadsheet’s XML contains the data, column definitions, field formatting, calculations, etc.

Code Academy

Why should technical communicators care about XML?

XML offers many benefits, including being flexible in organizing, tagging, and recalling information. Many consider XML an essential skill to learn in the technical writing profession, as many companies prefer to organize their content in the format.

Why is it important to the profession?

XML allows for the publishing of content to multiple channels using single sourcing, which means that one source of content can be shared with multiple. Single sourcing makes editing downstream incredibly easy and eliminates the time required to edit all the child documents.

Why might technical communicators want to know this skill?

Many companies' preferred method of storing information is based on XML, which makes it a marketable skill in the job market. In Huntsville, Alabama, most Department of Defence contractors require technical writers with XML experience.

Text Editors

Text editors are usually included in the base operating systems package of your computer. Although they are low-cost, text editors may make it more difficult to spot user-made errors in XML code, as they do not highlight elements or suggest corrections.

Microsoft NotePad
Apple TextEdit

Web Browsers

Web browsers offer a lightweight option for viewing XML code. However, it is not suggested by professionals to edit using web browsers, as they can be cumbersome and are unable to validate your code.

Google Chrome
Apple Safari

Source-Code Editors

Source-code editors provide the most in-depth experience for editing XML. Users can spot errors, view highlighted elements, read numbered lines of code, and validate their code in one enviroment. Source-code editors usually cost a one-time fee or subscription, but some, like Visual Studio are free.

Visual Studio Code
Sublime Text