/* c/zx-ps-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-ps-data.h"
#define TPF zx_
#include "zx_ext_pt.h"



int zx_DEC_ATTR_ps_AddCollectionRequest(struct zx_ctx* c, struct zx_ps_AddCollectionRequest_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_ps_AddCollectionRequest(struct zx_ctx* c, struct zx_ps_AddCollectionRequest_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_ps_Object_ELEM:
    if (!x->Object)
      x->Object = (struct zx_ps_Object_s*)el;
    return 1;
  case zx_ps_Subscription_ELEM:
    if (!x->Subscription)
      x->Subscription = (struct zx_ps_Subscription_s*)el;
    return 1;

  default: return 0;
  }
}




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

  default: return 0;
  }
}

int zx_DEC_ELEM_ps_AddCollectionResponse(struct zx_ctx* c, struct zx_ps_AddCollectionResponse_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_lu_Status_ELEM:
    if (!x->Status)
      x->Status = (struct zx_lu_Status_s*)el;
    return 1;
  case zx_ps_Object_ELEM:
    if (!x->Object)
      x->Object = (struct zx_ps_Object_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_ps_AddEntityRequest(struct zx_ctx* c, struct zx_ps_AddEntityRequest_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_ps_AddEntityRequest(struct zx_ctx* c, struct zx_ps_AddEntityRequest_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_ps_Object_ELEM:
    if (!x->Object)
      x->Object = (struct zx_ps_Object_s*)el;
    return 1;
  case zx_ps_PStoSPRedirectURL_ELEM:
    if (!x->PStoSPRedirectURL)
      x->PStoSPRedirectURL = el;
    return 1;
  case zx_ps_CreatePSObject_ELEM:
    if (!x->CreatePSObject)
      x->CreatePSObject = (struct zx_ps_CreatePSObject_s*)el;
    return 1;
  case zx_ps_Subscription_ELEM:
    if (!x->Subscription)
      x->Subscription = (struct zx_ps_Subscription_s*)el;
    return 1;
  case zx_sec_TokenPolicy_ELEM:
    if (!x->TokenPolicy)
      x->TokenPolicy = (struct zx_sec_TokenPolicy_s*)el;
    return 1;

  default: return 0;
  }
}




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

  default: return 0;
  }
}

int zx_DEC_ELEM_ps_AddEntityResponse(struct zx_ctx* c, struct zx_ps_AddEntityResponse_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_lu_Status_ELEM:
    if (!x->Status)
      x->Status = (struct zx_lu_Status_s*)el;
    return 1;
  case zx_ps_Object_ELEM:
    if (!x->Object)
      x->Object = (struct zx_ps_Object_s*)el;
    return 1;
  case zx_ps_SPtoPSRedirectURL_ELEM:
    if (!x->SPtoPSRedirectURL)
      x->SPtoPSRedirectURL = el;
    return 1;
  case zx_ps_QueryString_ELEM:
    if (!x->QueryString)
      x->QueryString = el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_ps_AddKnownEntityRequest(struct zx_ctx* c, struct zx_ps_AddKnownEntityRequest_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_ps_AddKnownEntityRequest(struct zx_ctx* c, struct zx_ps_AddKnownEntityRequest_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_ps_Object_ELEM:
    if (!x->Object)
      x->Object = (struct zx_ps_Object_s*)el;
    return 1;
  case zx_sec_Token_ELEM:
    if (!x->Token)
      x->Token = (struct zx_sec_Token_s*)el;
    return 1;
  case zx_ps_CreatePSObject_ELEM:
    if (!x->CreatePSObject)
      x->CreatePSObject = (struct zx_ps_CreatePSObject_s*)el;
    return 1;
  case zx_ps_Subscription_ELEM:
    if (!x->Subscription)
      x->Subscription = (struct zx_ps_Subscription_s*)el;
    return 1;
  case zx_sec_TokenPolicy_ELEM:
    if (!x->TokenPolicy)
      x->TokenPolicy = (struct zx_sec_TokenPolicy_s*)el;
    return 1;

  default: return 0;
  }
}




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

  default: return 0;
  }
}

int zx_DEC_ELEM_ps_AddKnownEntityResponse(struct zx_ctx* c, struct zx_ps_AddKnownEntityResponse_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_lu_Status_ELEM:
    if (!x->Status)
      x->Status = (struct zx_lu_Status_s*)el;
    return 1;
  case zx_ps_Object_ELEM:
    if (!x->Object)
      x->Object = (struct zx_ps_Object_s*)el;
    return 1;
  case zx_ps_SPtoPSRedirectURL_ELEM:
    if (!x->SPtoPSRedirectURL)
      x->SPtoPSRedirectURL = el;
    return 1;
  case zx_ps_QueryString_ELEM:
    if (!x->QueryString)
      x->QueryString = el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_ps_AddToCollectionRequest(struct zx_ctx* c, struct zx_ps_AddToCollectionRequest_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_ps_AddToCollectionRequest(struct zx_ctx* c, struct zx_ps_AddToCollectionRequest_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_ps_TargetObjectID_ELEM:
    if (!x->TargetObjectID)
      x->TargetObjectID = el;
    return 1;
  case zx_ps_ObjectID_ELEM:
    if (!x->ObjectID)
      x->ObjectID = el;
    return 1;
  case zx_ps_Subscription_ELEM:
    if (!x->Subscription)
      x->Subscription = (struct zx_ps_Subscription_s*)el;
    return 1;

  default: return 0;
  }
}




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

  default: return 0;
  }
}

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

  default: return 0;
  }
}




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

  default: return 0;
  }
}

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

  default: return 0;
  }
}




int zx_DEC_ATTR_ps_DisplayName(struct zx_ctx* c, struct zx_ps_DisplayName_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_IsDefault_ATTR:  x->IsDefault = x->gg.attr; return 1;
    case zx_Locale_ATTR:  x->Locale = x->gg.attr; return 1;

  default: return 0;
  }
}

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

  default: return 0;
  }
}




int zx_DEC_ATTR_ps_GetObjectInfoRequest(struct zx_ctx* c, struct zx_ps_GetObjectInfoRequest_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_ps_GetObjectInfoRequest(struct zx_ctx* c, struct zx_ps_GetObjectInfoRequest_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_ps_TargetObjectID_ELEM:
    if (!x->TargetObjectID)
      x->TargetObjectID = el;
    return 1;
  case zx_ps_Subscription_ELEM:
    if (!x->Subscription)
      x->Subscription = (struct zx_ps_Subscription_s*)el;
    return 1;

  default: return 0;
  }
}




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

  default: return 0;
  }
}

int zx_DEC_ELEM_ps_GetObjectInfoResponse(struct zx_ctx* c, struct zx_ps_GetObjectInfoResponse_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_lu_Status_ELEM:
    if (!x->Status)
      x->Status = (struct zx_lu_Status_s*)el;
    return 1;
  case zx_ps_Object_ELEM:
    if (!x->Object)
      x->Object = (struct zx_ps_Object_s*)el;
    return 1;

  default: return 0;
  }
}




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

  default: return 0;
  }
}

int zx_DEC_ELEM_ps_ItemData(struct zx_ctx* c, struct zx_ps_ItemData_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_ps_Object_ELEM:
    if (!x->Object)
      x->Object = (struct zx_ps_Object_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_ps_ListMembersRequest(struct zx_ctx* c, struct zx_ps_ListMembersRequest_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_Structured_ATTR:  x->Structured = x->gg.attr; return 1;
    case zx_id_ATTR:  x->id = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_ps_ListMembersRequest(struct zx_ctx* c, struct zx_ps_ListMembersRequest_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_ps_TargetObjectID_ELEM:
    if (!x->TargetObjectID)
      x->TargetObjectID = el;
    return 1;
  case zx_ps_Subscription_ELEM:
    if (!x->Subscription)
      x->Subscription = (struct zx_ps_Subscription_s*)el;
    return 1;

  default: return 0;
  }
}




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

  default: return 0;
  }
}

int zx_DEC_ELEM_ps_ListMembersResponse(struct zx_ctx* c, struct zx_ps_ListMembersResponse_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_lu_Status_ELEM:
    if (!x->Status)
      x->Status = (struct zx_lu_Status_s*)el;
    return 1;
  case zx_ps_Object_ELEM:
    if (!x->Object)
      x->Object = (struct zx_ps_Object_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_ps_Notification(struct zx_ctx* c, struct zx_ps_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_ps_Notification(struct zx_ctx* c, struct zx_ps_Notification_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_lu_TestResult_ELEM:
    if (!x->TestResult)
      x->TestResult = (struct zx_lu_TestResult_s*)el;
    return 1;
  case zx_ps_ItemData_ELEM:
    if (!x->ItemData)
      x->ItemData = (struct zx_ps_ItemData_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_ps_Notify(struct zx_ctx* c, struct zx_ps_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_ps_Notify(struct zx_ctx* c, struct zx_ps_Notify_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_ps_Notification_ELEM:
    if (!x->Notification)
      x->Notification = (struct zx_ps_Notification_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_ps_NotifyResponse(struct zx_ctx* c, struct zx_ps_NotifyResponse_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_itemIDRef_ATTR:  x->itemIDRef = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_ps_NotifyResponse(struct zx_ctx* c, struct zx_ps_NotifyResponse_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_lu_Status_ELEM:
    if (!x->Status)
      x->Status = (struct zx_lu_Status_s*)el;
    return 1;
  case zx_lu_Extension_ELEM:
    if (!x->Extension)
      x->Extension = (struct zx_lu_Extension_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_ps_Object(struct zx_ctx* c, struct zx_ps_Object_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_CreatedDateTime_ATTR:  x->CreatedDateTime = x->gg.attr; return 1;
    case zx_ModifiedDateTime_ATTR:  x->ModifiedDateTime = x->gg.attr; return 1;
    case zx_NodeType_ATTR:  x->NodeType = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_ps_Object(struct zx_ctx* c, struct zx_ps_Object_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_ps_ObjectID_ELEM:
    if (!x->ObjectID)
      x->ObjectID = el;
    return 1;
  case zx_ps_DisplayName_ELEM:
    if (!x->DisplayName)
      x->DisplayName = (struct zx_ps_DisplayName_s*)el;
    return 1;
  case zx_ps_Tag_ELEM:
    if (!x->Tag)
      x->Tag = (struct zx_ps_Tag_s*)el;
    return 1;
  case zx_ps_Object_ELEM:
    if (!x->Object)
      x->Object = (struct zx_ps_Object_s*)el;
    return 1;
  case zx_ps_ObjectRef_ELEM:
    if (!x->ObjectRef)
      x->ObjectRef = el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_ps_QueryObjectsRequest(struct zx_ctx* c, struct zx_ps_QueryObjectsRequest_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_id_ATTR:  x->id = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_ps_QueryObjectsRequest(struct zx_ctx* c, struct zx_ps_QueryObjectsRequest_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_ps_Filter_ELEM:
    if (!x->Filter)
      x->Filter = el;
    return 1;
  case zx_ps_Subscription_ELEM:
    if (!x->Subscription)
      x->Subscription = (struct zx_ps_Subscription_s*)el;
    return 1;

  default: return 0;
  }
}




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

  default: return 0;
  }
}

int zx_DEC_ELEM_ps_QueryObjectsResponse(struct zx_ctx* c, struct zx_ps_QueryObjectsResponse_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_lu_Status_ELEM:
    if (!x->Status)
      x->Status = (struct zx_lu_Status_s*)el;
    return 1;
  case zx_ps_Object_ELEM:
    if (!x->Object)
      x->Object = (struct zx_ps_Object_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_ps_RemoveCollectionRequest(struct zx_ctx* c, struct zx_ps_RemoveCollectionRequest_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_ps_RemoveCollectionRequest(struct zx_ctx* c, struct zx_ps_RemoveCollectionRequest_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_ps_TargetObjectID_ELEM:
    if (!x->TargetObjectID)
      x->TargetObjectID = el;
    return 1;

  default: return 0;
  }
}




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

  default: return 0;
  }
}

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

  default: return 0;
  }
}




int zx_DEC_ATTR_ps_RemoveEntityRequest(struct zx_ctx* c, struct zx_ps_RemoveEntityRequest_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_ps_RemoveEntityRequest(struct zx_ctx* c, struct zx_ps_RemoveEntityRequest_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_ps_TargetObjectID_ELEM:
    if (!x->TargetObjectID)
      x->TargetObjectID = el;
    return 1;

  default: return 0;
  }
}




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

  default: return 0;
  }
}

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

  default: return 0;
  }
}




int zx_DEC_ATTR_ps_RemoveFromCollectionRequest(struct zx_ctx* c, struct zx_ps_RemoveFromCollectionRequest_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_ps_RemoveFromCollectionRequest(struct zx_ctx* c, struct zx_ps_RemoveFromCollectionRequest_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_ps_TargetObjectID_ELEM:
    if (!x->TargetObjectID)
      x->TargetObjectID = el;
    return 1;
  case zx_ps_ObjectID_ELEM:
    if (!x->ObjectID)
      x->ObjectID = el;
    return 1;
  case zx_ps_Subscription_ELEM:
    if (!x->Subscription)
      x->Subscription = (struct zx_ps_Subscription_s*)el;
    return 1;

  default: return 0;
  }
}




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

  default: return 0;
  }
}

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

  default: return 0;
  }
}




int zx_DEC_ATTR_ps_ResolveIdentifierRequest(struct zx_ctx* c, struct zx_ps_ResolveIdentifierRequest_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_ps_ResolveIdentifierRequest(struct zx_ctx* c, struct zx_ps_ResolveIdentifierRequest_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_ps_ResolveInput_ELEM:
    if (!x->ResolveInput)
      x->ResolveInput = (struct zx_ps_ResolveInput_s*)el;
    return 1;

  default: return 0;
  }
}




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

  default: return 0;
  }
}

int zx_DEC_ELEM_ps_ResolveIdentifierResponse(struct zx_ctx* c, struct zx_ps_ResolveIdentifierResponse_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_lu_Status_ELEM:
    if (!x->Status)
      x->Status = (struct zx_lu_Status_s*)el;
    return 1;
  case zx_ps_ResolveOutput_ELEM:
    if (!x->ResolveOutput)
      x->ResolveOutput = (struct zx_ps_ResolveOutput_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_ps_ResolveInput(struct zx_ctx* c, struct zx_ps_ResolveInput_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_reqID_ATTR:  x->reqID = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_ps_ResolveInput(struct zx_ctx* c, struct zx_ps_ResolveInput_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_sec_TokenPolicy_ELEM:
    if (!x->TokenPolicy)
      x->TokenPolicy = (struct zx_sec_TokenPolicy_s*)el;
    return 1;
  case zx_sec_Token_ELEM:
    if (!x->Token)
      x->Token = (struct zx_sec_Token_s*)el;
    return 1;
  case zx_ps_TargetObjectID_ELEM:
    if (!x->TargetObjectID)
      x->TargetObjectID = el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_ps_ResolveOutput(struct zx_ctx* c, struct zx_ps_ResolveOutput_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_reqRef_ATTR:  x->reqRef = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_ps_ResolveOutput(struct zx_ctx* c, struct zx_ps_ResolveOutput_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_sec_Token_ELEM:
    if (!x->Token)
      x->Token = (struct zx_sec_Token_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_ps_SetObjectInfoRequest(struct zx_ctx* c, struct zx_ps_SetObjectInfoRequest_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_ps_SetObjectInfoRequest(struct zx_ctx* c, struct zx_ps_SetObjectInfoRequest_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_ps_Object_ELEM:
    if (!x->Object)
      x->Object = (struct zx_ps_Object_s*)el;
    return 1;
  case zx_ps_Subscription_ELEM:
    if (!x->Subscription)
      x->Subscription = (struct zx_ps_Subscription_s*)el;
    return 1;

  default: return 0;
  }
}




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

  default: return 0;
  }
}

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

  default: return 0;
  }
}




int zx_DEC_ATTR_ps_Subscription(struct zx_ctx* c, struct zx_ps_Subscription_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_adminNotifyToRef_ATTR:  x->adminNotifyToRef = 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_includeData_ATTR:  x->includeData = x->gg.attr; return 1;
    case zx_notifyToRef_ATTR:  x->notifyToRef = 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_ps_Subscription(struct zx_ctx* c, struct zx_ps_Subscription_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_subs_RefItem_ELEM:
    if (!x->RefItem)
      x->RefItem = (struct zx_subs_RefItem_s*)el;
    return 1;
  case zx_lu_Extension_ELEM:
    if (!x->Extension)
      x->Extension = (struct zx_lu_Extension_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_ps_Tag(struct zx_ctx* c, struct zx_ps_Tag_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_Ref_ATTR:  x->Ref = x->gg.attr; return 1;

  default: return 0;
  }
}

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

  default: return 0;
  }
}




int zx_DEC_ATTR_ps_TestMembershipRequest(struct zx_ctx* c, struct zx_ps_TestMembershipRequest_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_ps_TestMembershipRequest(struct zx_ctx* c, struct zx_ps_TestMembershipRequest_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_ps_TargetObjectID_ELEM:
    if (!x->TargetObjectID)
      x->TargetObjectID = el;
    return 1;
  case zx_sec_Token_ELEM:
    if (!x->Token)
      x->Token = (struct zx_sec_Token_s*)el;
    return 1;
  case zx_ps_Subscription_ELEM:
    if (!x->Subscription)
      x->Subscription = (struct zx_ps_Subscription_s*)el;
    return 1;

  default: return 0;
  }
}




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

  default: return 0;
  }
}

int zx_DEC_ELEM_ps_TestMembershipResponse(struct zx_ctx* c, struct zx_ps_TestMembershipResponse_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_lu_Status_ELEM:
    if (!x->Status)
      x->Status = (struct zx_lu_Status_s*)el;
    return 1;
  case zx_ps_Result_ELEM:
    if (!x->Result)
      x->Result = el;
    return 1;

  default: return 0;
  }
}


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