DirectCommentConstructor

Construct an XML comment.


Syntax

DirectCommentConstructor

graphics/DirectCommentConstructor.png

Description

A DirectCommentConstructor creates a comment node. Its parent node is the node constructed by the nearest containing element or document node constructor, either direct or computed, if such a constructor exists; otherwise the parent node is empty.

An XML comment begins with "<!--" and ends with "-->". In between it may not contain two consecutive hyphens and it may not end with a hyphen. Formally, this is:

"<!--" ((Char - '-') | ('-' (Char - '-')))* "-->"

Note:
The XML comment created by this constructor is different from an XQuery comment.

Example

  • This is a directly constructed comment:

    <!-- Page Header -->

Related Syntax Construct

The following construct(s) refer to this construct:

This construct is also related to the following construct(s):

ElementConstructor