Viewpoint | Concept | Characteristics |
---|---|---|
data | XML is a data format | No mixed content Lots of attributes Often a memory dump of internal objects Often inflexible |
document | XML is a document format | Mixed content Favors elements over attributes High-level view of mixed data Very flexible to additional elements and attributes |
text - text "cin" is the text content of the element name:
nested elements - element name is nested inside of element expr
The element includes the start tag, the end tag, and all content in between
Example | Nested Text | Nested Elements | Purpose | |
---|---|---|---|---|
Attributes | Yes | No | metadata | |
Subelements | Yes | Yes | data |
<students>...</students>
unescaped | escaped | notes |
---|---|---|
< |
< |
required |
& |
& |
required |
> |
> |
typically done, but not required |
' |
' |
depends on context |
" |
" |
depends on context |
Unescaped:
Escaped:
s
https://mlcollard.net/Student
s
is shorthand for the URI https://mlcollard.net/Student:
<{https://mlcollard.net/Student}student>
xmllint
- Tool for checking if XML is well-formedxmllint --noout data.xml
<!--
-->
src:if
src
if