WSDAPI XML Type Bytecodes

These bytecodes are used by WSDAPI to parse and generate XML using bytecode tables which describe complex types.

The bytecode table for a type expresses both the binary (in-memory) and XML (on-the-wire) representations of the type. A bytecode table consists of a list of operations terminated by a special operation, namely OpEndOfTable. An operation consists of a one-byte operation code followed by zero or more bytes of argument data.

Bytecode Description
OpNone Matches nothing.
OpEndOfTable Indicates the end of a bytecode table.
OpBeginElement (name) Matches an element start token with the indicated name. The name appears in the table in 4-byte encoded form. OnBeginElement starts a clause that ends with a matching OpEndElement. Zero or more complete clauses must appear between OpBeginElement and its matching OpEndElement.
OpBeginAnyElement Matches an element start token with any name. OnBeginAnyElement starts a clause that ends with a matching OpEndElement. Zero or more complete clauses must appear between OpBeginAnyElement and its matching OpEndElement.
OpEndElement Ends a clause started with OpBeginElement or OpBeginAnyElement.
OpElement (name) Matches an entire element with the indicated name. The name appears in the table in 4-byte encoded form.
OpAnyElement Matches an entire element with any name.
OpAnyElements Matches any number of elements with any names.
OpAnyText Matches a text token.
OpAttribute (name) Matches the label token of an attribute with the indicated name. OpAttribute starts a clause that includes the subsequent clause in the table. The subsequent clause is used to match the value part of the attribute. OpAttribute clauses always appear after OpBeginElement or OpBeginAnyElement operations or after another OpAttribute clause.
OpBeginChoice OpBeginChoice starts a clause that ends with a matching OpEndChoice. Zero or more complete clauses must appear between OpBeginChoice and its matching OpEndChoice. The outer clause matches the tokens matched by any one of the inner clauses. All of the inner clauses must start with OpBeginElement except that the last one may be OpAnything. This construct corresponds to the XSD choice particle.
OpEndChoice Ends a clause started with OpBeginChoice.
OpBeginSequence OpBeginSequence starts a clause that ends with a matching OpEndSequence. Zero or more complete clauses must appear between OpBeginSequence and OpEndSequence. The outer clause matches the tokens matched by all the inner clauses in sequence. This construct corresponds to the XSD sequence particle.
OpEndSequence Ends a clause started with OpBeginSequence.
OpBeginAll OpBeginAll starts a clause that ends with a matching OpEndAll. Zero or more complete clauses must appear between OpBeginAll and OpEndAll. The outer clause matches the tokens matched by the inner clauses in any sequence. Occurrence operators relating to each inner clause indicate how many times the tokens for each clause may occur. The default is once. Multiple occurrences of a specified clause may be intermixed with occurrences of other inner clauses. All of the inner clauses must start with OpBeginElement except that the last one may be OpAnything. This construct corresponds to the XSD all particle.
OpEndAll Ends a clause started with OpBeginAll.
OpAnything Matches any number of elements and text tokens.
OpAnyNumber Indicates that the subsequent clause may occur any number of times. OpAnyNumber starts a clause that terminates at the end of the subsequent clause.
OpOneOrMore Indicates that the subsequent clause may occur one or more times. OpOneOrMore starts a clause that terminates at the end of the subsequent clause.
OpOptional Indicates that the subsequent clause may occur zero or one times. OpOptional starts a clause that terminates at the end of the subsequent clause.
OpFormatInt8 (type,field) Matches an 8-bit signed integer in a text token. A 4-byte offset argument indicates the offset of the binary representation in the current binary context. The OpFormatInt8 macro calculates the offset of the indicated field in the indicated type and supplies that offset as the argument.
OpFormatInt16 (type,field) Matches a 16-bit signed integer. A 4-byte offset argument indicates the offset of the binary representation in the current binary context. The OpFormatInt16 macro calculates the offset of the indicated field in the indicated type and supplies that offset as the argument.
OpFormatInt32 (type,field) Matches a 32-bit signed integer in a text token. A 4-byte offset argument indicates the offset of the binary representation in the current binary context. The OpFormatInt32 macro calculates the offset of the indicated field in the indicated type and supplies that offset as the argument.
OpFormatInt64 (type,field) Matches a 64-bit signed integer in a text token. A 4-byte offset argument indicates the offset of the binary representation in the current binary context. The OpFormatInt64 macro calculates the offset of the indicated field in the indicated type and supplies that offset as the argument.
OpFormatUInt8 (type,field) Matches an 8-bit unsigned integer in a text token. A 4-byte offset argument indicates the offset of the binary representation in the current binary context. The OpFormatUInt8 macro calculates the offset of the indicated field in the indicated type and supplies that offset as the argument.
OpFormatUInt16 (type,field) Matches a 16-bit unsigned integer in a text token. A 4-byte offset argument indicates the offset of the binary representation in the current binary context. The OpFormatUInt16 macro calculates the offset of the indicated field in the indicated type and supplies that offset as the argument.
OpFormatUInt32 (type,field) Matches a 32-bit unsigned integer in a text token. A 4-byte offset argument indicates the offset of the binary representation in the current binary context. The OpFormatUInt32 macro calculates the offset of the indicated field in the indicated type and supplies that offset as the argument.
OpFormatUInt64 (type,field) Matches a 64-bit unsigned integer in a text token. A 4-byte offset argument indicates the offset of the binary representation in the current binary context. The OpFormatUInt64 macro calculates the offset of the indicated field in the indicated type and supplies that offset as the argument.
OpFormatUnicodeString (type,field) Matches a string consisting of the entire value of a text token. A 4-byte offset argument indicates the offset where a pointer to the string appears in the current binary context. The OpFormatUnicodeString macro calculates the offset of the indicated field in the indicated type and supplies that offset as the argument.
OpFormatDom (type,field) Indicates that all XML matched by the subsequent clause is represented in binary form as DOM (a list of WSDXML_NODE structures). OpFormatDom starts a clause that terminates at the end of the subsequent clause. A 4-byte offset argument indicates the offset where a pointer to the first WSDXML_NODE appears in the current binary context. The OpFormatDom macro calculates the offset of the indicated field in the indicated type and supplies that offset as the argument.
OpFormatStruct (structType,type,field) Indicates that the binary context for the subsequent clause is a structure referenced by the current binary context. OpFormatStruct starts a clause that terminates at the end of the subsequent clause. The first of two 4-byte arguments indicates the size of the structure. The second argument indicates the offset where a pointer to the structure appears in the current binary context. The OpFormatStruct macro calculates the size of the indicated structure type (structType) and supplies the size as the first argument. The macro calculates the offset of the indicated field in the indicated type and supplies that offset as the second argument.
OpFormatUri (type,field) Matches a URI in a text token. A 4-byte offset argument indicates the offset where a pointer to the URI string appears in the current binary context. The OpFormatUri macro calculates the offset of the indicated field in the indicated type and supplies that offset as the argument.
OpFormatUuidUri (type,field) Matches a UUID protocol URI in a text token. A 4-byte offset argument indicates the offset where URI in GUID structure form appears in the current binary context. The OpFormatUuidUri macro calculates the offset of the indicated field in the indicated type and supplies that offset as the argument.
OpFormatName (type,field) Matches a qualified name in a text token. A 4-byte offset argument indicates the offset where a pointer to the qualified name (a WSDXML_NAME structure) appears in the current binary context. The OpFormatName macro calculates the offset of the indicated field in the indicated type and supplies that offset as the argument.
OpFormatListInsertTail (nodeType,type,field) Indicates that the binary contexts for all occurrences of the subsequent clause are structures in a singly-linked list referenced by the current binary context. OpFormatListInsertTail starts a clause that terminates at the end of the subsequent clause. The first of two 4-byte arguments indicates the size of the structures. The second argument indicates the offset where a pointer to the structure appears in the current binary context. The 'next' pointer that links the structures into a list is always the first field in the structures. The OpFormatListInsertTail macro calculates the size of the indicated structure type (nodeType) and supplies the size as the first argument. The macro calculates the offset of the indicated field in the indicated type and supplies that offset as the second argument.
OpFormatType (typetable,type,field) Matches the tokens matched by the indicated type table and indicates that the binary context for that table is embedded in the current binary context at an indicated offset. The first of two 4-byte arguments is the encoded reference to the type table. The second argument is the offset. The OpFormatType macro calculates the offset of the indicated field in the indicated type and supplies that offset as the argument.
OpFormatDynamicType (name,type,field) Matches the tokens matched by a type table obtained dynamically using the indicated name and indicates that the binary context for that table is embedded in the current binary context at an indicated offset. The first of two 4-byte arguments is the name that identifies the type table. Typically, this name is specified in the form of a single-quoted string such as "'body'", which produces a 4-byte value. The second argument is the offset. The OpFormatDynamicType macro calculates the offset of the indicated field in the indicated type and supplies that offset as the argument.
OpFormatLookupType (urifield,type,field) Matches the tokens matched by the type table identified by the URI at an indicated offset in the current binary context and indicates that the binary context for that table is embedded in the current binary context at an indicated offset. The first of two 4-byte arguments is the offset of the type URI in the current binary context. The second argument is the offset for the new binary context. The OpFormatLookupType macro calculates the offset of the indicated field in the indicated type and supplies that offset as the argument.
OpProcess(type,field) Flags the referenced field as requiring additional processing during the generation and parsing phases. This is used for complex fields that cannot be automatically be processed.