Sign in Join
FPDoc Onlineexperiment

IsXmlName function

In unit Laz2_XMLUtils

Determines if the specified value contains a valid XML element name.

Declaration

pascal
function IsXmlName(const Value: TXMLUtilString; Xml11: Boolean=False)
: Boolean; overload

Arguments

Value

Value examined in the routine.

Xml11

True when XML 1.1 naming conventions used in the document.

Function result

True when the value is a valid XML element name.

Description

IsXmlName is an overloaded Boolean function used to determine if Value contains a valid XML element name. It ensures that the name is valid using the Name production in the XML specifications.

In XML 1.0, the valid characters allowed in a name was restricted. It used the principle of "that which is not expressly permitted is prohibited."

The Xml11 flag indicates if the XML 1.1 element naming conventions are allowed. When set to True, the XML 1.1 naming conventions are used. XML 1.1 allows almost all Unicode characters in any position in the name except the NameStart character. When to False (the default value), XML 1.0 naming conventions are used.

Extensible Markup Language (XML) 1.0 (Fifth Edition) Names and Tokens

Extensible Markup Language (XML) 1.1 (Second Edition) Names and Tokens

The overloaded variants allow Value to be specified as a TXMLUtilString (AnsiString) or a PXMLUtilChar (PChar) type.

The return value is True when Value is a valid XML element name for the indicated specification level.

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.