XML Guide
Gale
Created on October 22, 2024
Over 30 million people build interactive content in Genially.
Check out what others have designed:
Transcript
Let's go!
A beginner's course in XML
XML Guide
Start course
Learn the basics of XML, including reasons why XML matters to technical communicators and the components that make up a "well-formed" document
Introduction
Certificate
Assessment
Activities
Modules
Index
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
Modules
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.
Module 1. What is XML used for?
What can XML Do?
TransferData
Search the Web
FormatDocuments
CreateLayouts
Store Configuration Data
Click the shapes to learn
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?
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.
Module 2. Components
Click the tools to learn
Text Editors
Web Browsers
Source-Code Editors
An element is a basic unit within an XML document
Click the boxes to learn what an element can contain
Elements
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
Elements: Naming Rules
Source: W3Schools
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
- Describe document content
- Validata data correctness
- Define data restrictions
- Define data formats
- Convert data between different types
Module 3. Schema
Source: W3Schools
Click to view the XML
Identify the Schema Syntax Errors
Activity 2
Identify the Elements & Attributes Syntax Errors
Activity 1
you have 10 seconds to click
Identify the Elements & Attributes Syntax Errors
<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>
Missing quotation mark in the attribute name Incorrect: <Animal Category="Mammals> Correct: <Animal Category="Mammals">
Extra space in tag name Incorrect: <Average Weight>8.8 lbs.</Average Weight> Correct: <AverageWeight>8.8 lbs.</AverageWeight>
Missing closing tag Incorrect: <Animal> Correct: </Animal>
you have 10 seconds to click
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>
Missing use="required" Incorrect: <xs:attribute name="Category" type="xs:string"/> Correct: <xs:attribute name="Category" type="xs:string" use="required"/>
Incorrect type Incorrect: <xs:element name="AverageWeight" type="xs:integer"/> Correct: <xs:element name="AverageWeight" type="xs:string"/>
Element not defined in complexType Incorrect: <xs:element name="Habitat" type="xs:string"/> Correct: [removed]
Put your XML knowledge to the test!5 Questions
Evaluation
1/5
2/5
3/5
4/5
5/5
October, 2024
Lead Instructional Designer
Congratulations on reaching the first stop on your journey of learning XML!
Certificateof Achievement
Abigail Vo
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 StudioCode
SublimeText
Element with Attribute
Attributes
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
Code Academy
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
Create Layouts
Code Academy
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.
Element with No Content
Nothing
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.
GoogleChrome
AppleSafari
Format Documents
Code Academy
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.
Child Elements
Other 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.
MicrosoftNotePad
AppleTextEdit
Store Configuration Data
Code Academy
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.
Element with Text
Text
Elements with text label the text valueExample:<CommonName>Zebra<CommonName>
<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>
Example.xsd
Oracle Help Center
Create Layouts
Code Academy
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.
Format Documents
Code Academy
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.
Transfer Data
Code Academy
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
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
Code Academy
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.
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.
MicrosoftNotePad
AppleTextEdit
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.
GoogleChrome
AppleSafari
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 StudioCode
SublimeText