SetName

Description

Sets the name of the current PBDOM_PROCESSINGINSTRUCTION object.

Syntax

pbdom_pi_name.SetName(string strName)

Argument

Description

pbdom_pi_name

The name of a PBDOM_PROCESSINGINSTRUCTION object

strName

The new name you want to set for the current PBDOM_PROCESSINGINSTRUCTION object


Return value

Boolean.

Returns true if the name of the current PBDOM_PROCESSINGINSTRUCTION object was changed, and false otherwise.

Throws

EXCEPTION_INVALID_NAME -- This exception is thrown if the name is invalid. The name can be xml, making this PBDOM_PROCESSINGINSTRUCTION object an XML declaration processing instruction. However, in this case, the name xml must be in lowercase, or the EXCEPTION_INVALID_NAME exception will be thrown.

EXCEPTION_INVALID_STRING -- This exception is thrown if the name is xml and the current data of this PBDOM_PROCESSINGINSTRUCTION object is not valid. The data is valid only under the following circumstances:

  • It is an empty string.

  • If it is not an empty string, it must contain a name/value pair for the name version.

  • If it is not an empty string and it contains a name/value pair for the name version, it can also contain a name/value pair for the name encoding.

  • If it is not an empty string and it contains a name/value pair for the name version, it can also contain a name/value pair for the name standalone. If it does, the value for standalone must be either yes or no (both are case sensitive).

  • If it is not an empty string and it contains a name/value pair for the name version, it must not contain any other data (in name/value pair format or otherwise) except for encoding and standalone.

Usage

This method is equivalent to setting the target of the processing instruction object. See the list of exceptions for information about the restrictions on the use of xml as the target.