NIEM Practical Implementer’s Course
Lesson 2 – XML Conceptual Review
Core Definitions
- Elements: The tags that exist within an XML document, collectively termed the “markup”. Types of elements include root, parent, and child.
- Attributes: Part(s) of an XML element that provide(s) additional information about that element. Attributes are defined and written as a name/value pair (e.g. name=”value” ).
- Instance: A document containing XML tags and content that results from use of XML schema rules.
- Well-Formed Instance: An XML instance is “well-formed” if it uses the correct syntax and structure as defined by XML standard(s) being used and meets the minimum criteria for XML parsers to read the document.
General Notes
- Rules/Guidelines for XML Elements
- Can contain letters, numbers, and other characters.
- Must not start with number or punctuation.
- Must not start with xml, XML, or Xml.
- Cannot contain spaces.
- Should be descriptive to contained information.
- Avoid dashes, colons, and periods (allowed, but usually are reserved for namespaces).
- Avoid non-English letters/characters (allowed, but may not always be supported).
- XML Prolog & Processing Instructions
- Prolog specifies the version and the character encoding used for the XML instance and should always come first in every document.
- Processing instructions are used to associate presentation and/or transformation files with the data.
- XML Comments
- Start with “<!– ” and end with ” –>”
- Can include linebreaks.
Note: Information is being shared under the Creative Commons Attribution-ShareAlike 2.0 (CC BY-SA) license. Original content was created by NIEM course instructors Jenness, Owen, and Carlson.