Drawings SDK Developer Guide > Using Drawings Revision Control > Working with the XML Scheme for DRC > Overview of the XML Scheme
Overview of the XML Scheme

To work with revision control, you must write an .xml file for every class which contains the description of the read/write process of the object data (similar to the dwgIn()/dwgOut() methods). If the class is not described, you cannot merge its changes and cannot properly compress subsequent revisions of the object in the database.

First, the TD_Tf module must be loaded before scheme registration. After, use ::odTfInitialize(pHostApp); to initialize the module functionality. The scheme file must be placed within the folder that contains other binary files. For example, to register the scheme:

OdString schemeName = L"MyScheme.txds"; //xml scheme
::odrxRegisterSchema(schemeName);

or

OdString schemeName = L"MyScheme.tsbf"; //binary scheme
::odrxRegisterSchema(schemeName);

To convert an xml scheme to binary format, use:

::odrxConvertSchema(L"MyScheme.txds");

Binary scheme is saved in the same folder and under the same name as the original.

To work with the XML scheme, use these tags:

  • <oda:condition name="name" oda:conditionValue="condition"> — The same as "if" in programming.
  • <oda:array name="name" [oda:breakValue="value"]> — The same as "for/while" in programming.
  • <oda:mark name="name " oda:setCondition="value "> — Writes/rewrites (only for a bool value) a new value to the cache with a key that wasn't written/read by dwgIn()/dwgOut().

The next attributes are used:

  • oda:isCondition="" — Used in the <xs:element> tag.
  • oda:isArrayLength="" — Used in the <xs:element> tag.
  • oda:isBreak="" — Used in the <xs:element> tag.
  • oda:breakValue="value" — Used in the <oda:array> tag.
  • oda:conditionValue="condition" — Used in the <oda:condition> tag.
  • oda:countBytes="name | value" — Used in the <xs:element> tag.
  • oda:isSum="" — Used in the <xs:element>, <oda:array> tags.
  • oda:isTableCache="" — Used in the <xs:element> tag.
  • oda:isTableQueue="" — Used in the <xs:element> tag.
  • oda:isTableName="" — Used in the <xs:element> tag.
  • oda:isMarkCondition="" — Used in the <oda:condition> tag.
  • oda:isOwner="value" — Used in the <oda:condition> tag.
  • oda:reduceIn="value" — Used in the <xs:element> tag with the xs:hexBinary element type.
  • oda:increaseIn="value" — Used in the <xs:element> tag with the xs:hexBinary element type.
  • oda:addInVersion="value" — Used in the <xs:element>, <oda:array>, <oda:condition> tags.
  • oda:deletedInVersion="value" — Used in the <xs:element>, <oda:array>, <oda:condition> tags.
  • oda:default="value" — Used in the <xs:element> tag.
  • oda:decreaseOn="value" — Used in the <oda:array> tag.
  • oda:increaseOn="value" — Used in the <oda:array> tag.

The following are the types of elements (<xs:element name="..." type="___ "/>):

  • Subclass — Name of other <complexType>
  • Bool — xs:boolean
  • Byte — xs:byte
  • Short — xs:short
  • Int — xs:int
  • UnsignedByte — xs:unsignedByte
  • UnsignedShort — xs:unsignedShort
  • UnsignedInt — xs:unsignedInt
  • Long — xs:long
  • Double — xs:double
  • HexBinary — xs:hexBinary
  • String — xs:string
  • Handle — OdDbHandle
  • SoftOwnershipId — OdDbSoftOwnershipId
  • HardOwnershipId — OdDbHardOwnershipId
  • SoftPointerId — OdDbSoftPointerId
  • HardPointerId — OdDbHardPointerId
  • Point2d — OdGePoint2d
  • Point3d — OdGePoint3d
  • Vector2d — OdGeVector2d
  • Vector3d — OdGeVector3d
  • Scale3d — OdGeScale3d
  • Table — OdTable (unique use)
  • Empty — OdEmpty (unique use)

Note: Values of elements that are marked with attributes "oda:isArrayLength" or "oda:isCondition" are stored in the cache with a key (a key is a string that is taken from the attribute "name" in the tag).

Note: All names for the <xs:element> tag must be unique.

See Also

Working with the XML Scheme for Revision Control

Copyright © 2002 – 2020. Open Design Alliance. All rights reserved.