Smart Tag Types [Office 2003 SDK Documentation]

Each smart tag type is defined by a namespace to keep it unique. A namespace is an XML construct for uniquely identifying a group of XML tags that belong to a logical category. A namespace groups related properties together for easy property discovery and, more importantly, to keep the property names unique.

Property names are constructed by combining the namespace Uniform Resource Identifier (URI) and its tag name. In other words, property names are composed of a namespace URI and a tag name of the namespace URI.

Similarly, smart tag types are defined by a unique namespace URI plus its tag name. A "#" character is appended to the namespace URI and is used to separate the namespace URI from its tag name. The format is as follows: namespaceURI#tagname.

An example of a smart tag type is "urn:schemas-microsoft-com:moneycentral#StockTickerSymbol". Here, the namespace URI is "urn:schemas-microsoft-com:moneycentral", with "StockTickerSymbol" as the tag name. They are combined to form a fully qualified name of the property, which in this case is a smart tag type.

It is a fully qualified description of an XML tag. Therefore, every smart tag type is uniquely identified by its tag name in addition to its namespace. The URI portion of the property name ensures that it is globally unique and unambiguous. Two properties with the same tag name can therefore be differentiated using namespaces.

The role of an ISmartTagRecognizer is to assign smart tag types to data. For example, a recognizer could see the string "MSFT" and assign to it the smart tag type "urn:schemas-microsoft-com:moneycentral#StockTickerSymbol".

The role of an ISmartTagAction interface is to provide actions for individual smart tag types. Thus, smart tag recognizers are fundamentally separate from the actions that work with a smart tag type. In view of that, you might want to use smart tag recognizers to annotate data without using smart tag actions; for example, the annotations might be used in a post-process analysis of the document.

There are also instances where you might want to provide smart tag actions without providing a recognizer. A server-side process that generates Excel workbooks using spreadsheet XML could also embed smart tags. When users open the XML spreadsheet, they will see smart tags that were not labeled by a recognizer.

You can also mix and match smart tag types, recognizer DLLs and action DLLs. For example, you can have one recognizer DLL that recognizes multiple smart tag types, or multiple recognizer DLLs that recognize one smart tag type. Similarly, you can have one action DLL that supplies actions for many smart tag types, or multiple action DLLs that supply actions for one smart tag type.