Click or drag to resize

PdfXmpNamespace RegisterNamespace Method

Register a namespace URI with a suggested prefix.

Namespace: Spire.Pdf.Interchange.Metadata
Assembly: Spire.Pdf (in Spire.Pdf.dll) Version: 11.3.7.0 (11.3.7.1046)
Syntax
public static string RegisterNamespace(
	string namespaceUri,
	string suggestedNamespacePrefix
)

Parameters

namespaceUri
Type: System String
The URI for the namespace. Must be a valid XML URI.
suggestedNamespacePrefix
Type: System String
The suggested prefix to be used if the URI is not yet registered. Must be a valid XML name.

Return Value

Type: String
Returns the registered prefix for this URI, is equal to the suggestedPrefix if the namespace hasn't been registered before, otherwise the existing prefix.
Remarks
It is not an error if the URI is already registered, no matter what the prefix is. If the URI is not registered but the suggested prefix is in use, a unique prefix is created from the suggested one. The actual registered prefix is always returned. The function result tells if the registered prefix is the suggested one.

Note: No checking is presently done on either the URI or the prefix.
See Also