XML tag, element, and attribute formatting

Note

These guidelines apply also to Extensible Hypertext Markup Language (XHTML), Extensible Stylesheet Language (XSL), Extensible Stylesheet Language for Transformations (XSLT), and XML Path Language (XPath).

Elements vs. tags

An element includes the tags, the attributes, and the content, if any. For example, consider the following:

<xsl:apply-templates
order-by="sort-criteria-list"
select=expression
mode=QName>
</xsl:apply-templates>

In this example, the <xsl:apply-templates> element consists of the start tag (<xsl:apply-templates>); the order-by, select, and mode attributes; and the end tag (</xsl:apply-templates>).

Note that XML can have empty tags, such as <doctitle/> or <elementName att1Name=“att1Value” ...

Get Microsoft® Manual of Style, Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.