iText 8.0.2 API
iText.Kernel.XMP.XMPSchemaRegistry Interface Reference

The schema registry keeps track of all namespaces and aliases used in the XMP metadata. More...

Inheritance diagram for iText.Kernel.XMP.XMPSchemaRegistry:
iText.Kernel.XMP.Impl.XMPSchemaRegistryImpl

Public Member Functions

String  RegisterNamespace (String namespaceURI, String suggestedPrefix)
  Register a namespace URI with a suggested prefix. More...
 
String  GetNamespacePrefix (String namespaceURI)
  Obtain the prefix for a registered namespace URI. More...
 
String  GetNamespaceURI (String namespacePrefix)
  Obtain the URI for a registered namespace prefix. More...
 
IDictionary  GetNamespaces ()
 
IDictionary  GetPrefixes ()
 
void  DeleteNamespace (String namespaceURI)
  Deletes a namespace from the registry. More...
 
XMPAliasInfo  ResolveAlias (String aliasNS, String aliasProp)
  Determines if a name is an alias, and what it is aliased to. More...
 
XMPAliasInfo[]  FindAliases (String aliasNS)
  Collects all aliases that are contained in the provided namespace. More...
 
XMPAliasInfo  FindAlias (String qname)
  Searches for registered aliases. More...
 
IDictionary  GetAliases ()
 

Detailed Description

The schema registry keeps track of all namespaces and aliases used in the XMP metadata.

The schema registry keeps track of all namespaces and aliases used in the XMP metadata. At initialisation time, the default namespaces and default aliases are automatically registered. Namespaces must be registered before used in namespace URI parameters or path expressions. Within the XMP Toolkit the registered namespace URIs and prefixes must be unique. Additional namespaces encountered when parsing RDF are automatically registered. The namespace URI should always end in an XML name separator such as '/' or '#'. This is because some forms of RDF shorthand catenate a namespace URI with an element name to form a new URI.

Aliases in XMP serve the same purpose as Windows file shortcuts, Macintosh file aliases, or UNIX file symbolic links. The aliases are simply multiple names for the same property. One distinction of XMP aliases is that they are ordered, there is an alias name pointing to an actual name. The primary significance of the actual name is that it is the preferred name for output, generally the most widely recognized name.

The names that can be aliased in XMP are restricted. The alias must be a top level property name, not a field within a structure or an element within an array. The actual may be a top level property name, the first element within a top level array, or the default element in an alt-text array. This does not mean the alias can only be a simple property. It is OK to alias a top level structure or array to an identical top level structure or array, or to the first item of an array of structures.

27.01.2006

Member Function Documentation

◆ DeleteNamespace()

void iText.Kernel.XMP.XMPSchemaRegistry.DeleteNamespace ( String  namespaceURI )

Deletes a namespace from the registry.

Deletes a namespace from the registry.

Does nothing if the URI is not registered, or if the namespaceURI parameter is null or the empty string.

Note: Not yet implemented.

Parameters
namespaceURI The URI for the namespace.

Implemented in iText.Kernel.XMP.Impl.XMPSchemaRegistryImpl.

◆ FindAlias()

XMPAliasInfo iText.Kernel.XMP.XMPSchemaRegistry.FindAlias ( String  qname )

Searches for registered aliases.

Parameters
qname an XML conform qname
Returns
Returns if an alias definition for the given qname to another schema and property is registered.

Implemented in iText.Kernel.XMP.Impl.XMPSchemaRegistryImpl.

◆ FindAliases()

XMPAliasInfo [] iText.Kernel.XMP.XMPSchemaRegistry.FindAliases ( String  aliasNS )

Collects all aliases that are contained in the provided namespace.

Collects all aliases that are contained in the provided namespace. If nothing is found, an empty array is returned.

Parameters
aliasNS a schema namespace URI
Returns
Returns all alias infos from aliases that are contained in the provided namespace.

Implemented in iText.Kernel.XMP.Impl.XMPSchemaRegistryImpl.

◆ GetAliases()

IDictionary iText.Kernel.XMP.XMPSchemaRegistry.GetAliases ( )
Returns
Returns the registered aliases as map, where the key is the "qname" (prefix and name) and the value an XMPAliasInfo-object.

Implemented in iText.Kernel.XMP.Impl.XMPSchemaRegistryImpl.

◆ GetNamespacePrefix()

String iText.Kernel.XMP.XMPSchemaRegistry.GetNamespacePrefix ( String  namespaceURI )

Obtain the prefix for a registered namespace URI.

Obtain the prefix for a registered namespace URI.

It is not an error if the namespace URI is not registered.

Parameters
namespaceURI The URI for the namespace. Must not be null or the empty string.
Returns
Returns the prefix registered for this namespace URI or null.

Implemented in iText.Kernel.XMP.Impl.XMPSchemaRegistryImpl.

◆ GetNamespaces()

IDictionary iText.Kernel.XMP.XMPSchemaRegistry.GetNamespaces ( )
Returns
Returns the registered prefix/namespace-pairs as map, where the keys are the namespaces and the values are the prefixes.

Implemented in iText.Kernel.XMP.Impl.XMPSchemaRegistryImpl.

◆ GetNamespaceURI()

String iText.Kernel.XMP.XMPSchemaRegistry.GetNamespaceURI ( String  namespacePrefix )

Obtain the URI for a registered namespace prefix.

Obtain the URI for a registered namespace prefix.

It is not an error if the namespace prefix is not registered.

Parameters
namespacePrefix The prefix for the namespace. Must not be null or the empty string.
Returns
Returns the URI registered for this prefix or null.

Implemented in iText.Kernel.XMP.Impl.XMPSchemaRegistryImpl.

◆ GetPrefixes()

IDictionary iText.Kernel.XMP.XMPSchemaRegistry.GetPrefixes ( )
Returns
Returns the registered namespace/prefix-pairs as map, where the keys are the prefixes and the values are the namespaces.

Implemented in iText.Kernel.XMP.Impl.XMPSchemaRegistryImpl.

◆ RegisterNamespace()

String iText.Kernel.XMP.XMPSchemaRegistry.RegisterNamespace ( String  namespaceURI,
String  suggestedPrefix 
)

Register a namespace URI with a suggested prefix.

Register a namespace URI with a suggested prefix. 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 registeed 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.

Parameters
namespaceURI The URI for the namespace. Must be a valid XML URI.
suggestedPrefix The suggested prefix to be used if the URI is not yet registered. Must be a valid XML name.
Returns
Returns the registered prefix for this URI, is equal to the suggestedPrefix if the namespace hasn't been registered before, otherwise the existing prefix.

Implemented in iText.Kernel.XMP.Impl.XMPSchemaRegistryImpl.

◆ ResolveAlias()

XMPAliasInfo iText.Kernel.XMP.XMPSchemaRegistry.ResolveAlias ( String  aliasNS,
String  aliasProp 
)

Determines if a name is an alias, and what it is aliased to.

Parameters
aliasNS The namespace URI of the alias. Must not be null or the empty string.
aliasProp The name of the alias. May be an arbitrary path expression path, must not be null or the empty string.
Returns
Returns the XMPAliasInfo for the given alias namespace and property or null if there is no such alias.

Implemented in iText.Kernel.XMP.Impl.XMPSchemaRegistryImpl.