Review of XML Concepts Helpdesk Training
Review of XML Concepts What is an XML declaration? What is an XML Element What is Nesting? What is a Document Element? What is Text Content / Inner Text? How should special characters be handled?
What is an XML Declaration? An XML Declaration is a way for a document to state which XML standard it conforms to. Most applications use the 1.0 standard. If a declaration is not supplied, the XML parser will usually imply 1.0
What is an XML Element? An XML Element is a way to define an object in an XML Document. Each element has a starting tag and and ending tag. The ending tag should have the name with a / in front of it. Both xmlelement and childelement are considered XML Elements.
What is Nesting? Nesting is a technical term referring to objects that have parent-child associations. In the example above, childelement is the child of xmlelement. Xmlelement is the parent of childelement. In addition, xmlelement is the child of the document itself, as the document is the parent of xmlelement. This is known as single parent inheritance. This structure allows an application to easily locate information based on the relationships between objects.
What is the Document Element? Document Element is a special name for the topmost element. That is, the element that only has the document itself as the parent object. In the example above, xmlelement is considered the Document Element
What is Text Content (aka Inner Text)? Text content is text that is between the starting and closing tag of an element. In the example, I have circled an example of Text Content.
How to handle special characters Special characters can cause parsing errors if they are used as part of the document structure. Some examples are &<>'”. You can “escape” the characters by using specific names starting with & and ending in ;. See chart below: Unescaped CharEscaped Char << >> “" '' &&
Quick Quiz (to make sure you were paying attention) If an XML declaration is missing, what is the assumed version typically? What is the parent element of the Document Element? How many children elements does xmlelement have in the examples used throughout the presentation? What are 3 of the special characters that must be escaped to prevent XML parsing errors?
End of Presentation Created by: Christopher Wallis