/* c/zx-cb-dec.c - WARNING: This file was auto generated by xsd2sg.pl. DO NOT EDIT!
 * $Id$ */
/* Code generation design Copyright (c) 2006 Sampo Kellomaki (sampo@iki.fi),
 * All Rights Reserved. NO WARRANTY. See file COPYING for terms and conditions
 * of use. Some aspects of code generation were driven by schema
 * descriptions that were used as input and may be subject to their own copyright.
 * Code generation uses a template, whose copyright statement follows. */

/** dec-templ.c  -  XML decoder template, used in code generation
 ** Copyright (c) 2010 Sampo Kellomaki (sampo@iki.fi), All Rights Reserved.
 ** Copyright (c) 2006-2007 Symlabs (symlabs@symlabs.com), All Rights Reserved.
 ** Author: Sampo Kellomaki (sampo@iki.fi)
 ** This is confidential unpublished proprietary source code of the author.
 ** NO WARRANTY, not even implied warranties. Contains trade secrets.
 ** Distribution prohibited unless authorized in writing.
 ** Licensed under Apache License 2.0, see file COPYING.
 ** Id: dec-templ.c,v 1.30 2008-10-04 23:42:14 sampo Exp $
 **
 ** 28.5.2006, created, Sampo Kellomaki (sampo@iki.fi)
 ** 8.8.2006,  reworked namespace handling --Sampo
 ** 12.8.2006, added special scanning of xmlns to avoid backtracking elem recognition --Sampo
 ** 23.9.2006, added collection of WO information --Sampo
 ** 21.6.2007, improved handling of undeclared namespace prefixes --Sampo
 ** 27.10.2010, CSE refactoring, re-engineered namespace handling --Sampo
 ** 21.11.2010, re-engineered to extract most code to zx_DEC_elem, leaving just switches --Sampo
 **
 ** N.B: This template is meant to be processed by pd/xsd2sg.pl. Beware
 ** of special markers that xsd2sg.pl expects to find and understand.
 **/

#include "errmac.h"
#include "zx.h"
#include "c/zx-const.h"
#include "c/zx-data.h"
#include "c/zx-cb-data.h"
#define TPF zx_
#include "zx_ext_pt.h"



int zx_DEC_ATTR_cb_By(struct zx_ctx* c, struct zx_cb_By_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_sortAlg_ATTR|zx_cb_NS:  x->sortAlg = x->gg.attr; return 1;
    case zx_sortWeight_ATTR|zx_cb_NS:  x->sortWeight = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_cb_By(struct zx_ctx* c, struct zx_cb_By_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {

  default: return 0;
  }
}




int zx_DEC_ATTR_cb_Create(struct zx_ctx* c, struct zx_cb_Create_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_id_ATTR:  x->id = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_cb_Create(struct zx_ctx* c, struct zx_cb_Create_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_cb_ResourceID_ELEM:
    if (!x->ResourceID)
      x->ResourceID = (struct zx_cb_ResourceID_s*)el;
    return 1;
  case zx_cb_EncryptedResourceID_ELEM:
    if (!x->EncryptedResourceID)
      x->EncryptedResourceID = (struct zx_cb_EncryptedResourceID_s*)el;
    return 1;
  case zx_cb_Subscription_ELEM:
    if (!x->Subscription)
      x->Subscription = (struct zx_cb_Subscription_s*)el;
    return 1;
  case zx_cb_CreateItem_ELEM:
    if (!x->CreateItem)
      x->CreateItem = (struct zx_cb_CreateItem_s*)el;
    return 1;
  case zx_cb_ItemSelection_ELEM:
    if (!x->ItemSelection)
      x->ItemSelection = (struct zx_cb_ItemSelection_s*)el;
    return 1;
  case zx_cb_Extension_ELEM:
    if (!x->Extension)
      x->Extension = (struct zx_cb_Extension_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_cb_CreateItem(struct zx_ctx* c, struct zx_cb_CreateItem_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_id_ATTR:  x->id = x->gg.attr; return 1;
    case zx_itemID_ATTR:  x->itemID = x->gg.attr; return 1;
    case zx_objectType_ATTR:  x->objectType = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_cb_CreateItem(struct zx_ctx* c, struct zx_cb_CreateItem_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_cb_NewData_ELEM:
    if (!x->NewData)
      x->NewData = (struct zx_cb_NewData_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_cb_CreateResponse(struct zx_ctx* c, struct zx_cb_CreateResponse_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_id_ATTR:  x->id = x->gg.attr; return 1;
    case zx_timeStamp_ATTR:  x->timeStamp = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_cb_CreateResponse(struct zx_ctx* c, struct zx_cb_CreateResponse_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_cb_Status_ELEM:
    if (!x->Status)
      x->Status = (struct zx_cb_Status_s*)el;
    return 1;
  case zx_cb_ItemData_ELEM:
    if (!x->ItemData)
      x->ItemData = (struct zx_cb_ItemData_s*)el;
    return 1;
  case zx_cb_Extension_ELEM:
    if (!x->Extension)
      x->Extension = (struct zx_cb_Extension_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_cb_Credential(struct zx_ctx* c, struct zx_cb_Credential_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_notOnOrAfter_ATTR:  x->notOnOrAfter = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_cb_Credential(struct zx_ctx* c, struct zx_cb_Credential_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_sa_Assertion_ELEM:
    if (!x->Assertion)
      x->Assertion = (struct zx_sa_Assertion_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_cb_Data(struct zx_ctx* c, struct zx_cb_Data_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_id_ATTR:  x->id = x->gg.attr; return 1;
    case zx_itemIDRef_ATTR:  x->itemIDRef = x->gg.attr; return 1;
    case zx_nextOffset_ATTR:  x->nextOffset = x->gg.attr; return 1;
    case zx_notSorted_ATTR:  x->notSorted = x->gg.attr; return 1;
    case zx_remaining_ATTR:  x->remaining = x->gg.attr; return 1;
    case zx_setID_ATTR:  x->setID = x->gg.attr; return 1;
    case zx_changeFormat_ATTR|zx_cb_NS:  x->changeFormat = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_cb_Data(struct zx_ctx* c, struct zx_cb_Data_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_cb_Card_ELEM:
    if (!x->Card)
      x->Card = el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_cb_Delete(struct zx_ctx* c, struct zx_cb_Delete_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_id_ATTR:  x->id = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_cb_Delete(struct zx_ctx* c, struct zx_cb_Delete_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_cb_ResourceID_ELEM:
    if (!x->ResourceID)
      x->ResourceID = (struct zx_cb_ResourceID_s*)el;
    return 1;
  case zx_cb_EncryptedResourceID_ELEM:
    if (!x->EncryptedResourceID)
      x->EncryptedResourceID = (struct zx_cb_EncryptedResourceID_s*)el;
    return 1;
  case zx_cb_DeleteItem_ELEM:
    if (!x->DeleteItem)
      x->DeleteItem = (struct zx_cb_DeleteItem_s*)el;
    return 1;
  case zx_cb_Extension_ELEM:
    if (!x->Extension)
      x->Extension = (struct zx_cb_Extension_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_cb_DeleteItem(struct zx_ctx* c, struct zx_cb_DeleteItem_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_id_ATTR:  x->id = x->gg.attr; return 1;
    case zx_itemID_ATTR:  x->itemID = x->gg.attr; return 1;
    case zx_notChangedSince_ATTR:  x->notChangedSince = x->gg.attr; return 1;
    case zx_objectType_ATTR:  x->objectType = x->gg.attr; return 1;
    case zx_predefined_ATTR:  x->predefined = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_cb_DeleteItem(struct zx_ctx* c, struct zx_cb_DeleteItem_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_cb_Select_ELEM:
    if (!x->Select)
      x->Select = el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_cb_DeleteResponse(struct zx_ctx* c, struct zx_cb_DeleteResponse_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_id_ATTR:  x->id = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_cb_DeleteResponse(struct zx_ctx* c, struct zx_cb_DeleteResponse_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_cb_Status_ELEM:
    if (!x->Status)
      x->Status = (struct zx_cb_Status_s*)el;
    return 1;
  case zx_cb_Extension_ELEM:
    if (!x->Extension)
      x->Extension = (struct zx_cb_Extension_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_cb_EncryptedResourceID(struct zx_ctx* c, struct zx_cb_EncryptedResourceID_s* x)
{
  switch (x->gg.attr->g.tok) {

  default: return 0;
  }
}

int zx_DEC_ELEM_cb_EncryptedResourceID(struct zx_ctx* c, struct zx_cb_EncryptedResourceID_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_xenc_EncryptedData_ELEM:
    if (!x->EncryptedData)
      x->EncryptedData = (struct zx_xenc_EncryptedData_s*)el;
    return 1;
  case zx_xenc_EncryptedKey_ELEM:
    if (!x->EncryptedKey)
      x->EncryptedKey = (struct zx_xenc_EncryptedKey_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_cb_Extension(struct zx_ctx* c, struct zx_cb_Extension_s* x)
{
  switch (x->gg.attr->g.tok) {

  default: return 0;
  }
}

int zx_DEC_ELEM_cb_Extension(struct zx_ctx* c, struct zx_cb_Extension_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {

  default: return 0;
  }
}




int zx_DEC_ATTR_cb_ItemData(struct zx_ctx* c, struct zx_cb_ItemData_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_id_ATTR:  x->id = x->gg.attr; return 1;
    case zx_itemIDRef_ATTR:  x->itemIDRef = x->gg.attr; return 1;
    case zx_notSorted_ATTR:  x->notSorted = x->gg.attr; return 1;
    case zx_changeFormat_ATTR|zx_cb_NS:  x->changeFormat = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_cb_ItemData(struct zx_ctx* c, struct zx_cb_ItemData_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_cb_Card_ELEM:
    if (!x->Card)
      x->Card = el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_cb_ItemSelection(struct zx_ctx* c, struct zx_cb_ItemSelection_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_format_ATTR|zx_cb_NS:  x->format = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_cb_ItemSelection(struct zx_ctx* c, struct zx_cb_ItemSelection_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {

  default: return 0;
  }
}




int zx_DEC_ATTR_cb_Modification(struct zx_ctx* c, struct zx_cb_Modification_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_id_ATTR:  x->id = x->gg.attr; return 1;
    case zx_itemID_ATTR:  x->itemID = x->gg.attr; return 1;
    case zx_notChangedSince_ATTR:  x->notChangedSince = x->gg.attr; return 1;
    case zx_objectType_ATTR:  x->objectType = x->gg.attr; return 1;
    case zx_overrideAllowed_ATTR:  x->overrideAllowed = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_cb_Modification(struct zx_ctx* c, struct zx_cb_Modification_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_cb_Select_ELEM:
    if (!x->Select)
      x->Select = el;
    return 1;
  case zx_cb_NewData_ELEM:
    if (!x->NewData)
      x->NewData = (struct zx_cb_NewData_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_cb_Modify(struct zx_ctx* c, struct zx_cb_Modify_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_id_ATTR:  x->id = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_cb_Modify(struct zx_ctx* c, struct zx_cb_Modify_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_cb_ResourceID_ELEM:
    if (!x->ResourceID)
      x->ResourceID = (struct zx_cb_ResourceID_s*)el;
    return 1;
  case zx_cb_EncryptedResourceID_ELEM:
    if (!x->EncryptedResourceID)
      x->EncryptedResourceID = (struct zx_cb_EncryptedResourceID_s*)el;
    return 1;
  case zx_cb_Subscription_ELEM:
    if (!x->Subscription)
      x->Subscription = (struct zx_cb_Subscription_s*)el;
    return 1;
  case zx_cb_Modification_ELEM:
    if (!x->Modification)
      x->Modification = (struct zx_cb_Modification_s*)el;
    return 1;
  case zx_cb_ItemSelection_ELEM:
    if (!x->ItemSelection)
      x->ItemSelection = (struct zx_cb_ItemSelection_s*)el;
    return 1;
  case zx_cb_Extension_ELEM:
    if (!x->Extension)
      x->Extension = (struct zx_cb_Extension_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_cb_ModifyResponse(struct zx_ctx* c, struct zx_cb_ModifyResponse_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_id_ATTR:  x->id = x->gg.attr; return 1;
    case zx_timeStamp_ATTR:  x->timeStamp = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_cb_ModifyResponse(struct zx_ctx* c, struct zx_cb_ModifyResponse_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_cb_Status_ELEM:
    if (!x->Status)
      x->Status = (struct zx_cb_Status_s*)el;
    return 1;
  case zx_cb_ItemData_ELEM:
    if (!x->ItemData)
      x->ItemData = (struct zx_cb_ItemData_s*)el;
    return 1;
  case zx_cb_Extension_ELEM:
    if (!x->Extension)
      x->Extension = (struct zx_cb_Extension_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_cb_NewData(struct zx_ctx* c, struct zx_cb_NewData_s* x)
{
  switch (x->gg.attr->g.tok) {

  default: return 0;
  }
}

int zx_DEC_ELEM_cb_NewData(struct zx_ctx* c, struct zx_cb_NewData_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_cb_Card_ELEM:
    if (!x->Card)
      x->Card = el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_cb_Notification(struct zx_ctx* c, struct zx_cb_Notification_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_endReason_ATTR:  x->endReason = x->gg.attr; return 1;
    case zx_expires_ATTR:  x->expires = x->gg.attr; return 1;
    case zx_id_ATTR:  x->id = x->gg.attr; return 1;
    case zx_subscriptionID_ATTR:  x->subscriptionID = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_cb_Notification(struct zx_ctx* c, struct zx_cb_Notification_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_cb_ItemData_ELEM:
    if (!x->ItemData)
      x->ItemData = (struct zx_cb_ItemData_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_cb_Notify(struct zx_ctx* c, struct zx_cb_Notify_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_id_ATTR:  x->id = x->gg.attr; return 1;
    case zx_timeStamp_ATTR:  x->timeStamp = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_cb_Notify(struct zx_ctx* c, struct zx_cb_Notify_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_cb_Notification_ELEM:
    if (!x->Notification)
      x->Notification = (struct zx_cb_Notification_s*)el;
    return 1;
  case zx_cb_Extension_ELEM:
    if (!x->Extension)
      x->Extension = (struct zx_cb_Extension_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_cb_NotifyAdminTo(struct zx_ctx* c, struct zx_cb_NotifyAdminTo_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_id_ATTR:  x->id = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_cb_NotifyAdminTo(struct zx_ctx* c, struct zx_cb_NotifyAdminTo_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_cb_SecurityMechID_ELEM:
    if (!x->SecurityMechID)
      x->SecurityMechID = el;
    return 1;
  case zx_cb_Credential_ELEM:
    if (!x->Credential)
      x->Credential = (struct zx_cb_Credential_s*)el;
    return 1;
  case zx_cb_Endpoint_ELEM:
    if (!x->Endpoint)
      x->Endpoint = el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_cb_NotifyResponse(struct zx_ctx* c, struct zx_cb_NotifyResponse_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_id_ATTR:  x->id = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_cb_NotifyResponse(struct zx_ctx* c, struct zx_cb_NotifyResponse_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_cb_Status_ELEM:
    if (!x->Status)
      x->Status = (struct zx_cb_Status_s*)el;
    return 1;
  case zx_cb_Extension_ELEM:
    if (!x->Extension)
      x->Extension = (struct zx_cb_Extension_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_cb_NotifyTo(struct zx_ctx* c, struct zx_cb_NotifyTo_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_id_ATTR:  x->id = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_cb_NotifyTo(struct zx_ctx* c, struct zx_cb_NotifyTo_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_cb_SecurityMechID_ELEM:
    if (!x->SecurityMechID)
      x->SecurityMechID = el;
    return 1;
  case zx_cb_Credential_ELEM:
    if (!x->Credential)
      x->Credential = (struct zx_cb_Credential_s*)el;
    return 1;
  case zx_cb_Endpoint_ELEM:
    if (!x->Endpoint)
      x->Endpoint = el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_cb_Query(struct zx_ctx* c, struct zx_cb_Query_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_id_ATTR:  x->id = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_cb_Query(struct zx_ctx* c, struct zx_cb_Query_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_cb_ResourceID_ELEM:
    if (!x->ResourceID)
      x->ResourceID = (struct zx_cb_ResourceID_s*)el;
    return 1;
  case zx_cb_EncryptedResourceID_ELEM:
    if (!x->EncryptedResourceID)
      x->EncryptedResourceID = (struct zx_cb_EncryptedResourceID_s*)el;
    return 1;
  case zx_cb_Subscription_ELEM:
    if (!x->Subscription)
      x->Subscription = (struct zx_cb_Subscription_s*)el;
    return 1;
  case zx_cb_QueryItem_ELEM:
    if (!x->QueryItem)
      x->QueryItem = (struct zx_cb_QueryItem_s*)el;
    return 1;
  case zx_cb_Extension_ELEM:
    if (!x->Extension)
      x->Extension = (struct zx_cb_Extension_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_cb_QueryItem(struct zx_ctx* c, struct zx_cb_QueryItem_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_count_ATTR:  x->count = x->gg.attr; return 1;
    case zx_offset_ATTR:  x->offset = x->gg.attr; return 1;
    case zx_setID_ATTR:  x->setID = x->gg.attr; return 1;
    case zx_setReq_ATTR:  x->setReq = x->gg.attr; return 1;
    case zx_format_ATTR|zx_cb_NS:  x->format = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_cb_QueryItem(struct zx_ctx* c, struct zx_cb_QueryItem_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {

  default: return 0;
  }
}




int zx_DEC_ATTR_cb_QueryResponse(struct zx_ctx* c, struct zx_cb_QueryResponse_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_id_ATTR:  x->id = x->gg.attr; return 1;
    case zx_itemIDRef_ATTR:  x->itemIDRef = x->gg.attr; return 1;
    case zx_timeStamp_ATTR:  x->timeStamp = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_cb_QueryResponse(struct zx_ctx* c, struct zx_cb_QueryResponse_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_cb_Status_ELEM:
    if (!x->Status)
      x->Status = (struct zx_cb_Status_s*)el;
    return 1;
  case zx_cb_Data_ELEM:
    if (!x->Data)
      x->Data = (struct zx_cb_Data_s*)el;
    return 1;
  case zx_cb_Extension_ELEM:
    if (!x->Extension)
      x->Extension = (struct zx_cb_Extension_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_cb_RefItem(struct zx_ctx* c, struct zx_cb_RefItem_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_ItemIDRef_ATTR:  x->ItemIDRef = x->gg.attr; return 1;
    case zx_subscriptionID_ATTR:  x->subscriptionID = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_cb_RefItem(struct zx_ctx* c, struct zx_cb_RefItem_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {

  default: return 0;
  }
}




int zx_DEC_ATTR_cb_ReportUsage(struct zx_ctx* c, struct zx_cb_ReportUsage_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_id_ATTR:  x->id = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_cb_ReportUsage(struct zx_ctx* c, struct zx_cb_ReportUsage_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_cb_ResourceID_ELEM:
    if (!x->ResourceID)
      x->ResourceID = (struct zx_cb_ResourceID_s*)el;
    return 1;
  case zx_cb_EncryptedResourceID_ELEM:
    if (!x->EncryptedResourceID)
      x->EncryptedResourceID = (struct zx_cb_EncryptedResourceID_s*)el;
    return 1;
  case zx_cdm_CARDID_ELEM:
    if (!x->CARDID)
      x->CARDID = el;
    return 1;
  case zx_cb_UsageType_ELEM:
    if (!x->UsageType)
      x->UsageType = (struct zx_cb_UsageType_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_cb_ReportUsageResponse(struct zx_ctx* c, struct zx_cb_ReportUsageResponse_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_id_ATTR:  x->id = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_cb_ReportUsageResponse(struct zx_ctx* c, struct zx_cb_ReportUsageResponse_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_cb_Status_ELEM:
    if (!x->Status)
      x->Status = (struct zx_cb_Status_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_cb_ResourceID(struct zx_ctx* c, struct zx_cb_ResourceID_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_id_ATTR:  x->id = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_cb_ResourceID(struct zx_ctx* c, struct zx_cb_ResourceID_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {

  default: return 0;
  }
}




int zx_DEC_ATTR_cb_Status(struct zx_ctx* c, struct zx_cb_Status_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_code_ATTR:  x->code = x->gg.attr; return 1;
    case zx_comment_ATTR:  x->comment = x->gg.attr; return 1;
    case zx_ref_ATTR:  x->ref = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_cb_Status(struct zx_ctx* c, struct zx_cb_Status_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_cb_Status_ELEM:
    if (!x->Status)
      x->Status = (struct zx_cb_Status_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_cb_Subscription(struct zx_ctx* c, struct zx_cb_Subscription_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_expires_ATTR:  x->expires = x->gg.attr; return 1;
    case zx_id_ATTR:  x->id = x->gg.attr; return 1;
    case zx_includeData_ATTR:  x->includeData = x->gg.attr; return 1;
    case zx_starts_ATTR:  x->starts = x->gg.attr; return 1;
    case zx_subscriptionID_ATTR:  x->subscriptionID = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_cb_Subscription(struct zx_ctx* c, struct zx_cb_Subscription_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_cb_ItemSelection_ELEM:
    if (!x->ItemSelection)
      x->ItemSelection = (struct zx_cb_ItemSelection_s*)el;
    return 1;
  case zx_cb_RefItem_ELEM:
    if (!x->RefItem)
      x->RefItem = (struct zx_cb_RefItem_s*)el;
    return 1;
  case zx_cb_NotifyTo_ELEM:
    if (!x->NotifyTo)
      x->NotifyTo = (struct zx_cb_NotifyTo_s*)el;
    return 1;
  case zx_cb_NotifyAdminTo_ELEM:
    if (!x->NotifyAdminTo)
      x->NotifyAdminTo = (struct zx_cb_NotifyAdminTo_s*)el;
    return 1;
  case zx_cb_Aggregation_ELEM:
    if (!x->Aggregation)
      x->Aggregation = el;
    return 1;
  case zx_cb_Trigger_ELEM:
    if (!x->Trigger)
      x->Trigger = el;
    return 1;
  case zx_cb_Extension_ELEM:
    if (!x->Extension)
      x->Extension = (struct zx_cb_Extension_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_cb_UsageType(struct zx_ctx* c, struct zx_cb_UsageType_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_success_ATTR:  x->success = x->gg.attr; return 1;
    case zx_ACC_ATTR|zx_cb_NS:  x->ACC = x->gg.attr; return 1;
    case zx_ACCTime_ATTR|zx_cb_NS:  x->ACCTime = x->gg.attr; return 1;
    case zx_id_ATTR|zx_cb_NS:  x->id = x->gg.attr; return 1;
    case zx_modificationTime_ATTR|zx_cb_NS:  x->modificationTime = x->gg.attr; return 1;
    case zx_modifier_ATTR|zx_cb_NS:  x->modifier = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_cb_UsageType(struct zx_ctx* c, struct zx_cb_UsageType_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {

  default: return 0;
  }
}


/* EOF -- c/zx-cb-dec.c */
