DictionaryXMLTransforms Object [C++]
Use this object to transform data from a Dictionary object into Extensible Markup Language (XML) and vice-versa, using a specified XML Data Reduced (XDR) schema.
In Commerce Server 2000, the DictionaryXMLTransforms object did not support Dictionary objects that contained SimpleList objects. An example of such a Dictionary object is an OrderForm object. In Commerce Server 2002 Enterprise Edition, the DictionaryXMLTransforms object supports these objects.
ProgID: | Commerce.DictionaryXMLTransforms (Externally creatable) |
COM Class Name: | DictionaryXMLTransforms |
Type Library Name: | Microsoft Commerce 2002 DictionaryXMLTransform Type Library |
DLL Name: | DictionaryXMLTransforms.dll |
Threading Model: | Apartment |
[C++]
COM Interface Name: | _DictionaryXMLTransforms |
Interface ID Constant: | None |
Header File: | None |
Important
- The DictionaryXMLTransforms object is only capable of processing dictionary keys with names that would be allowable as XML Node names. Allowable characters include A-Z and the underscore "_" character. Disallowed characters include"*", "\", and so forth, and foreign language characters.
- Every dictionary key value must be URL-encoded.
[C++]
In C++, use the _DictionaryXMLTransforms interface to access the properties and methods of the DictionaryXMLTransforms object.
Methods
[C++]
Method | Description |
---|---|
GenerateSampleXMLInstanceFromDictionary | Produces an XML instance based on the specified Dictionary or OrderForm object. |
GenerateXMLForDictionaryUsingSchema | Extracts an XML instance from the specified Dictionary or OrderForm object that conforms to the specified schema. |
GetXMLFromFile | Generates an XML Document Object Model (DOM) document from the specified file. |
ReconstructDictionaryFromXML | Transforms the specified XML instance (which must comply with the specified schema) into a Dictionary object. If the schema was originally generated from an OrderForm object, the structure of the regenerated Dictionary object will reflect the OrderForm object. |
[Visual Basic]
Method | Description |
---|---|
GenerateSampleXMLInstanceFromDictionary | Produces an XML instance based on the specified Dictionary or OrderForm object. |
GenerateXMLForDictionaryUsingSchema | Extracts an XML instance from the specified Dictionary or OrderForm object that conforms to the specified schema. |
GetXMLFromFile | Generates an XML Document Object Model (DOM) document from the specified file. |
ReconstructDictionaryFromXML | Transforms the specified XML instance (which must comply with the specified schema) into a Dictionary object. If the schema was originally generated from an OrderForm object, the structure of the regenerated Dictionary object will reflect the OrderForm object. |
Remarks
The example code that calls this method can be found in the payment.asp and _recvpo.asp files. An example of the use of a XML schema can be found in the POSchema.xml file in the Solution Sites.
The following table lists the datatypes converted using the DictionaryXMLTransform object.
COM Variant Type | XML Data Type | VB function |
VT_BSTR | string | string |
VT_INT | int | Cint |
VT_R8 | float | Cdbl |
VT_BOOL | boolean | Cbool |
VT_I1 | i1 | Cint |
VT_I2 | i2 | Cdbl |
VT_UI1 | ui1 | Cint |
VT_UI2 | ui2 | Cdbl |
VT_R4 | r4 | Cdbl |
VT_I4 | i4 | long |
Other | else | string |
The middle column of the table lists the XML datatypes that can be specified in the XDR Schema for the Dictionary. For example, when generating the following XML using the DictionaryXMLTranform object:
<Items product_catalog="look there" quantity="2"/>
you can specify the data type used used by the property. First, use an XML editor, such as Biztalk Editor, to generate an XDR for the Dictionary. The XDR can be created by selecting the Export Schema option on the Tools menu of BizTalk Editor. By default, code in the XDR would appear similar to the following:
<AttributeType name="quantity" />
<AttributeType name="product_catalog" />
The values in the middle row can be used to set the datatype for the property. For example, to set the data type for the quantity property to int, and the product_catalog property to string, do the following:
<AttributeType name="quantity" d:type="int" />
<AttributeType name="product_catalog" d:type="string" />
See Also
[C++]Dictionary Object
[Visual Basic]Dictionary Object
Copyright © 2005 Microsoft Corporation.
All rights reserved.