This section explains the concept of String Dictionary in XML Framework.
WBXML requires use of string dictionaries to store the element strings specific to the WBXML. The XML Framework allows strings to be stored for a particular DTD, XML namespace or WBXML codepage in an ECOM plug-in that can be accessed when required by the Parser and Client. These plug-ins are refered as String Dictionary plug-ins and they are all managed through a String Dictionary Collection object .
String dictionary is a concept of holding strings, and mapping them to token values. For example, string dictionaries allow the WBXML parser to parse various types (encodings) of WBXML documents, such as WML, Service Indication, etc. It must be provided for each different encoding of WBXML document.
String dictionaries are mainly used by the WBXML parser as the documents they parse are tokenised. They can also be used by other parsers within the same process as the strings are also loaded into the string pool (a collection of string groups). In these cases, there are no mappings associated. The string pool avoids string duplication and allows for fast comparisons.
All string comparisons within the WBXML and XML parsers are case-sensitive. If the string in the XML document does not match the case of the strings in the .st file, they are not matched. For WBXML, there are pre-defined DTDs, and hence, strings are pre-defined for both parser and client.
A string dictionary may either be loaded into the string dictionary collection prior to parsing or while parsing. The strings within the dictionary are linked into the string table statically at compile time and then loaded into the String Pool at runtime. For example, a string dictionary is provided by the WBXML component for static linkage into the program. When the parser parses, any string it comes across that are not statically linked are added to the string pool; these are called Dynamic Strings. Dynamic strings do not belong to any string dictionary and therefore are not in the string dictionary collection.
For XML, load the string dictionary prior to parsing because the XML parser has no concept of string dictionaries and does not understand what or how to load them; it only creates RStrings . These RStrings are passed back to the client as a function call (callback) on a client supplied object that encounters a published API specified by the XML Framework.
NOTE : The user who implements the callback must also have access to this same String Pool for the comparisons to work.
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License v1.0.