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



int zx_DEC_ATTR_sp_ArtifactResolve(struct zx_ctx* c, struct zx_sp_ArtifactResolve_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_Consent_ATTR:  x->Consent = x->gg.attr; return 1;
    case zx_Destination_ATTR:  x->Destination = x->gg.attr; return 1;
    case zx_ID_ATTR:  x->ID = x->gg.attr; return 1;
    case zx_IssueInstant_ATTR:  x->IssueInstant = x->gg.attr; return 1;
    case zx_Version_ATTR:  x->Version = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_sp_ArtifactResolve(struct zx_ctx* c, struct zx_sp_ArtifactResolve_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_sa_Issuer_ELEM:
    if (!x->Issuer)
      x->Issuer = (struct zx_sa_Issuer_s*)el;
    return 1;
  case zx_ds_Signature_ELEM:
    if (!x->Signature)
      x->Signature = (struct zx_ds_Signature_s*)el;
    return 1;
  case zx_sp_Extensions_ELEM:
    if (!x->Extensions)
      x->Extensions = (struct zx_sp_Extensions_s*)el;
    return 1;
  case zx_sp_Artifact_ELEM:
    if (!x->Artifact)
      x->Artifact = el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_sp_ArtifactResponse(struct zx_ctx* c, struct zx_sp_ArtifactResponse_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_Consent_ATTR:  x->Consent = x->gg.attr; return 1;
    case zx_Destination_ATTR:  x->Destination = x->gg.attr; return 1;
    case zx_ID_ATTR:  x->ID = x->gg.attr; return 1;
    case zx_InResponseTo_ATTR:  x->InResponseTo = x->gg.attr; return 1;
    case zx_IssueInstant_ATTR:  x->IssueInstant = x->gg.attr; return 1;
    case zx_Version_ATTR:  x->Version = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_sp_ArtifactResponse(struct zx_ctx* c, struct zx_sp_ArtifactResponse_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_sa_Issuer_ELEM:
    if (!x->Issuer)
      x->Issuer = (struct zx_sa_Issuer_s*)el;
    return 1;
  case zx_ds_Signature_ELEM:
    if (!x->Signature)
      x->Signature = (struct zx_ds_Signature_s*)el;
    return 1;
  case zx_sp_Extensions_ELEM:
    if (!x->Extensions)
      x->Extensions = (struct zx_sp_Extensions_s*)el;
    return 1;
  case zx_sp_Status_ELEM:
    if (!x->Status)
      x->Status = (struct zx_sp_Status_s*)el;
    return 1;
  case zx_sp_Response_ELEM:
    if (!x->Response)
      x->Response = (struct zx_sp_Response_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_sp_AssertionIDRequest(struct zx_ctx* c, struct zx_sp_AssertionIDRequest_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_Consent_ATTR:  x->Consent = x->gg.attr; return 1;
    case zx_Destination_ATTR:  x->Destination = x->gg.attr; return 1;
    case zx_ID_ATTR:  x->ID = x->gg.attr; return 1;
    case zx_IssueInstant_ATTR:  x->IssueInstant = x->gg.attr; return 1;
    case zx_Version_ATTR:  x->Version = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_sp_AssertionIDRequest(struct zx_ctx* c, struct zx_sp_AssertionIDRequest_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_sa_Issuer_ELEM:
    if (!x->Issuer)
      x->Issuer = (struct zx_sa_Issuer_s*)el;
    return 1;
  case zx_ds_Signature_ELEM:
    if (!x->Signature)
      x->Signature = (struct zx_ds_Signature_s*)el;
    return 1;
  case zx_sp_Extensions_ELEM:
    if (!x->Extensions)
      x->Extensions = (struct zx_sp_Extensions_s*)el;
    return 1;
  case zx_sa_AssertionIDRef_ELEM:
    if (!x->AssertionIDRef)
      x->AssertionIDRef = el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_sp_AttributeQuery(struct zx_ctx* c, struct zx_sp_AttributeQuery_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_Consent_ATTR:  x->Consent = x->gg.attr; return 1;
    case zx_Destination_ATTR:  x->Destination = x->gg.attr; return 1;
    case zx_ID_ATTR:  x->ID = x->gg.attr; return 1;
    case zx_IssueInstant_ATTR:  x->IssueInstant = x->gg.attr; return 1;
    case zx_Version_ATTR:  x->Version = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_sp_AttributeQuery(struct zx_ctx* c, struct zx_sp_AttributeQuery_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_sa_Issuer_ELEM:
    if (!x->Issuer)
      x->Issuer = (struct zx_sa_Issuer_s*)el;
    return 1;
  case zx_ds_Signature_ELEM:
    if (!x->Signature)
      x->Signature = (struct zx_ds_Signature_s*)el;
    return 1;
  case zx_sp_Extensions_ELEM:
    if (!x->Extensions)
      x->Extensions = (struct zx_sp_Extensions_s*)el;
    return 1;
  case zx_sa_Subject_ELEM:
    if (!x->Subject)
      x->Subject = (struct zx_sa_Subject_s*)el;
    return 1;
  case zx_sa_Attribute_ELEM:
    if (!x->Attribute)
      x->Attribute = (struct zx_sa_Attribute_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_sp_AuthnQuery(struct zx_ctx* c, struct zx_sp_AuthnQuery_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_Consent_ATTR:  x->Consent = x->gg.attr; return 1;
    case zx_Destination_ATTR:  x->Destination = x->gg.attr; return 1;
    case zx_ID_ATTR:  x->ID = x->gg.attr; return 1;
    case zx_IssueInstant_ATTR:  x->IssueInstant = x->gg.attr; return 1;
    case zx_SessionIndex_ATTR:  x->SessionIndex = x->gg.attr; return 1;
    case zx_Version_ATTR:  x->Version = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_sp_AuthnQuery(struct zx_ctx* c, struct zx_sp_AuthnQuery_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_sa_Issuer_ELEM:
    if (!x->Issuer)
      x->Issuer = (struct zx_sa_Issuer_s*)el;
    return 1;
  case zx_ds_Signature_ELEM:
    if (!x->Signature)
      x->Signature = (struct zx_ds_Signature_s*)el;
    return 1;
  case zx_sp_Extensions_ELEM:
    if (!x->Extensions)
      x->Extensions = (struct zx_sp_Extensions_s*)el;
    return 1;
  case zx_sa_Subject_ELEM:
    if (!x->Subject)
      x->Subject = (struct zx_sa_Subject_s*)el;
    return 1;
  case zx_sp_RequestedAuthnContext_ELEM:
    if (!x->RequestedAuthnContext)
      x->RequestedAuthnContext = (struct zx_sp_RequestedAuthnContext_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_sp_AuthnRequest(struct zx_ctx* c, struct zx_sp_AuthnRequest_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_AssertionConsumerServiceIndex_ATTR:  x->AssertionConsumerServiceIndex = x->gg.attr; return 1;
    case zx_AssertionConsumerServiceURL_ATTR:  x->AssertionConsumerServiceURL = x->gg.attr; return 1;
    case zx_AttributeConsumingServiceIndex_ATTR:  x->AttributeConsumingServiceIndex = x->gg.attr; return 1;
    case zx_Consent_ATTR:  x->Consent = x->gg.attr; return 1;
    case zx_Destination_ATTR:  x->Destination = x->gg.attr; return 1;
    case zx_ForceAuthn_ATTR:  x->ForceAuthn = x->gg.attr; return 1;
    case zx_ID_ATTR:  x->ID = x->gg.attr; return 1;
    case zx_IsPassive_ATTR:  x->IsPassive = x->gg.attr; return 1;
    case zx_IssueInstant_ATTR:  x->IssueInstant = x->gg.attr; return 1;
    case zx_ProtocolBinding_ATTR:  x->ProtocolBinding = x->gg.attr; return 1;
    case zx_ProviderName_ATTR:  x->ProviderName = x->gg.attr; return 1;
    case zx_Version_ATTR:  x->Version = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_sp_AuthnRequest(struct zx_ctx* c, struct zx_sp_AuthnRequest_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_sa_Issuer_ELEM:
    if (!x->Issuer)
      x->Issuer = (struct zx_sa_Issuer_s*)el;
    return 1;
  case zx_ds_Signature_ELEM:
    if (!x->Signature)
      x->Signature = (struct zx_ds_Signature_s*)el;
    return 1;
  case zx_sp_Extensions_ELEM:
    if (!x->Extensions)
      x->Extensions = (struct zx_sp_Extensions_s*)el;
    return 1;
  case zx_sa_Subject_ELEM:
    if (!x->Subject)
      x->Subject = (struct zx_sa_Subject_s*)el;
    return 1;
  case zx_sp_NameIDPolicy_ELEM:
    if (!x->NameIDPolicy)
      x->NameIDPolicy = (struct zx_sp_NameIDPolicy_s*)el;
    return 1;
  case zx_sa_Conditions_ELEM:
    if (!x->Conditions)
      x->Conditions = (struct zx_sa_Conditions_s*)el;
    return 1;
  case zx_sp_RequestedAuthnContext_ELEM:
    if (!x->RequestedAuthnContext)
      x->RequestedAuthnContext = (struct zx_sp_RequestedAuthnContext_s*)el;
    return 1;
  case zx_sp_Scoping_ELEM:
    if (!x->Scoping)
      x->Scoping = (struct zx_sp_Scoping_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_sp_AuthzDecisionQuery(struct zx_ctx* c, struct zx_sp_AuthzDecisionQuery_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_Consent_ATTR:  x->Consent = x->gg.attr; return 1;
    case zx_Destination_ATTR:  x->Destination = x->gg.attr; return 1;
    case zx_ID_ATTR:  x->ID = x->gg.attr; return 1;
    case zx_IssueInstant_ATTR:  x->IssueInstant = x->gg.attr; return 1;
    case zx_Resource_ATTR:  x->Resource = x->gg.attr; return 1;
    case zx_Version_ATTR:  x->Version = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_sp_AuthzDecisionQuery(struct zx_ctx* c, struct zx_sp_AuthzDecisionQuery_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_sa_Issuer_ELEM:
    if (!x->Issuer)
      x->Issuer = (struct zx_sa_Issuer_s*)el;
    return 1;
  case zx_ds_Signature_ELEM:
    if (!x->Signature)
      x->Signature = (struct zx_ds_Signature_s*)el;
    return 1;
  case zx_sp_Extensions_ELEM:
    if (!x->Extensions)
      x->Extensions = (struct zx_sp_Extensions_s*)el;
    return 1;
  case zx_sa_Subject_ELEM:
    if (!x->Subject)
      x->Subject = (struct zx_sa_Subject_s*)el;
    return 1;
  case zx_sa_Action_ELEM:
    if (!x->Action)
      x->Action = (struct zx_sa_Action_s*)el;
    return 1;
  case zx_sa_Evidence_ELEM:
    if (!x->Evidence)
      x->Evidence = (struct zx_sa_Evidence_s*)el;
    return 1;

  default: return 0;
  }
}




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

  default: return 0;
  }
}

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

  default: return 0;
  }
}




int zx_DEC_ATTR_sp_IDPEntry(struct zx_ctx* c, struct zx_sp_IDPEntry_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_Loc_ATTR:  x->Loc = x->gg.attr; return 1;
    case zx_Name_ATTR:  x->Name = x->gg.attr; return 1;
    case zx_ProviderID_ATTR:  x->ProviderID = x->gg.attr; return 1;

  default: return 0;
  }
}

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

  default: return 0;
  }
}




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

  default: return 0;
  }
}

int zx_DEC_ELEM_sp_IDPList(struct zx_ctx* c, struct zx_sp_IDPList_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_sp_IDPEntry_ELEM:
    if (!x->IDPEntry)
      x->IDPEntry = (struct zx_sp_IDPEntry_s*)el;
    return 1;
  case zx_sp_GetComplete_ELEM:
    if (!x->GetComplete)
      x->GetComplete = el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_sp_LogoutRequest(struct zx_ctx* c, struct zx_sp_LogoutRequest_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_Consent_ATTR:  x->Consent = x->gg.attr; return 1;
    case zx_Destination_ATTR:  x->Destination = x->gg.attr; return 1;
    case zx_ID_ATTR:  x->ID = x->gg.attr; return 1;
    case zx_IssueInstant_ATTR:  x->IssueInstant = x->gg.attr; return 1;
    case zx_NotOnOrAfter_ATTR:  x->NotOnOrAfter = x->gg.attr; return 1;
    case zx_Reason_ATTR:  x->Reason = x->gg.attr; return 1;
    case zx_Version_ATTR:  x->Version = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_sp_LogoutRequest(struct zx_ctx* c, struct zx_sp_LogoutRequest_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_sa_Issuer_ELEM:
    if (!x->Issuer)
      x->Issuer = (struct zx_sa_Issuer_s*)el;
    return 1;
  case zx_ds_Signature_ELEM:
    if (!x->Signature)
      x->Signature = (struct zx_ds_Signature_s*)el;
    return 1;
  case zx_sp_Extensions_ELEM:
    if (!x->Extensions)
      x->Extensions = (struct zx_sp_Extensions_s*)el;
    return 1;
  case zx_sa_BaseID_ELEM:
    if (!x->BaseID)
      x->BaseID = (struct zx_sa_BaseID_s*)el;
    return 1;
  case zx_sa_NameID_ELEM:
    if (!x->NameID)
      x->NameID = (struct zx_sa_NameID_s*)el;
    return 1;
  case zx_sa_EncryptedID_ELEM:
    if (!x->EncryptedID)
      x->EncryptedID = (struct zx_sa_EncryptedID_s*)el;
    return 1;
  case zx_sp_SessionIndex_ELEM:
    if (!x->SessionIndex)
      x->SessionIndex = el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_sp_LogoutResponse(struct zx_ctx* c, struct zx_sp_LogoutResponse_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_Consent_ATTR:  x->Consent = x->gg.attr; return 1;
    case zx_Destination_ATTR:  x->Destination = x->gg.attr; return 1;
    case zx_ID_ATTR:  x->ID = x->gg.attr; return 1;
    case zx_InResponseTo_ATTR:  x->InResponseTo = x->gg.attr; return 1;
    case zx_IssueInstant_ATTR:  x->IssueInstant = x->gg.attr; return 1;
    case zx_Version_ATTR:  x->Version = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_sp_LogoutResponse(struct zx_ctx* c, struct zx_sp_LogoutResponse_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_sa_Issuer_ELEM:
    if (!x->Issuer)
      x->Issuer = (struct zx_sa_Issuer_s*)el;
    return 1;
  case zx_ds_Signature_ELEM:
    if (!x->Signature)
      x->Signature = (struct zx_ds_Signature_s*)el;
    return 1;
  case zx_sp_Extensions_ELEM:
    if (!x->Extensions)
      x->Extensions = (struct zx_sp_Extensions_s*)el;
    return 1;
  case zx_sp_Status_ELEM:
    if (!x->Status)
      x->Status = (struct zx_sp_Status_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_sp_ManageNameIDRequest(struct zx_ctx* c, struct zx_sp_ManageNameIDRequest_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_Consent_ATTR:  x->Consent = x->gg.attr; return 1;
    case zx_Destination_ATTR:  x->Destination = x->gg.attr; return 1;
    case zx_ID_ATTR:  x->ID = x->gg.attr; return 1;
    case zx_IssueInstant_ATTR:  x->IssueInstant = x->gg.attr; return 1;
    case zx_Version_ATTR:  x->Version = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_sp_ManageNameIDRequest(struct zx_ctx* c, struct zx_sp_ManageNameIDRequest_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_sa_Issuer_ELEM:
    if (!x->Issuer)
      x->Issuer = (struct zx_sa_Issuer_s*)el;
    return 1;
  case zx_ds_Signature_ELEM:
    if (!x->Signature)
      x->Signature = (struct zx_ds_Signature_s*)el;
    return 1;
  case zx_sp_Extensions_ELEM:
    if (!x->Extensions)
      x->Extensions = (struct zx_sp_Extensions_s*)el;
    return 1;
  case zx_sa_NameID_ELEM:
    if (!x->NameID)
      x->NameID = (struct zx_sa_NameID_s*)el;
    return 1;
  case zx_sa_EncryptedID_ELEM:
    if (!x->EncryptedID)
      x->EncryptedID = (struct zx_sa_EncryptedID_s*)el;
    return 1;
  case zx_sp_NewID_ELEM:
    if (!x->NewID)
      x->NewID = el;
    return 1;
  case zx_sp_NewEncryptedID_ELEM:
    if (!x->NewEncryptedID)
      x->NewEncryptedID = (struct zx_sp_NewEncryptedID_s*)el;
    return 1;
  case zx_sp_Terminate_ELEM:
    if (!x->Terminate)
      x->Terminate = el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_sp_ManageNameIDResponse(struct zx_ctx* c, struct zx_sp_ManageNameIDResponse_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_Consent_ATTR:  x->Consent = x->gg.attr; return 1;
    case zx_Destination_ATTR:  x->Destination = x->gg.attr; return 1;
    case zx_ID_ATTR:  x->ID = x->gg.attr; return 1;
    case zx_InResponseTo_ATTR:  x->InResponseTo = x->gg.attr; return 1;
    case zx_IssueInstant_ATTR:  x->IssueInstant = x->gg.attr; return 1;
    case zx_Version_ATTR:  x->Version = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_sp_ManageNameIDResponse(struct zx_ctx* c, struct zx_sp_ManageNameIDResponse_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_sa_Issuer_ELEM:
    if (!x->Issuer)
      x->Issuer = (struct zx_sa_Issuer_s*)el;
    return 1;
  case zx_ds_Signature_ELEM:
    if (!x->Signature)
      x->Signature = (struct zx_ds_Signature_s*)el;
    return 1;
  case zx_sp_Extensions_ELEM:
    if (!x->Extensions)
      x->Extensions = (struct zx_sp_Extensions_s*)el;
    return 1;
  case zx_sp_Status_ELEM:
    if (!x->Status)
      x->Status = (struct zx_sp_Status_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_sp_NameIDMappingRequest(struct zx_ctx* c, struct zx_sp_NameIDMappingRequest_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_Consent_ATTR:  x->Consent = x->gg.attr; return 1;
    case zx_Destination_ATTR:  x->Destination = x->gg.attr; return 1;
    case zx_ID_ATTR:  x->ID = x->gg.attr; return 1;
    case zx_IssueInstant_ATTR:  x->IssueInstant = x->gg.attr; return 1;
    case zx_Version_ATTR:  x->Version = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_sp_NameIDMappingRequest(struct zx_ctx* c, struct zx_sp_NameIDMappingRequest_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_sa_Issuer_ELEM:
    if (!x->Issuer)
      x->Issuer = (struct zx_sa_Issuer_s*)el;
    return 1;
  case zx_ds_Signature_ELEM:
    if (!x->Signature)
      x->Signature = (struct zx_ds_Signature_s*)el;
    return 1;
  case zx_sp_Extensions_ELEM:
    if (!x->Extensions)
      x->Extensions = (struct zx_sp_Extensions_s*)el;
    return 1;
  case zx_sa_BaseID_ELEM:
    if (!x->BaseID)
      x->BaseID = (struct zx_sa_BaseID_s*)el;
    return 1;
  case zx_sa_NameID_ELEM:
    if (!x->NameID)
      x->NameID = (struct zx_sa_NameID_s*)el;
    return 1;
  case zx_sa_EncryptedID_ELEM:
    if (!x->EncryptedID)
      x->EncryptedID = (struct zx_sa_EncryptedID_s*)el;
    return 1;
  case zx_sp_NameIDPolicy_ELEM:
    if (!x->NameIDPolicy)
      x->NameIDPolicy = (struct zx_sp_NameIDPolicy_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_sp_NameIDMappingResponse(struct zx_ctx* c, struct zx_sp_NameIDMappingResponse_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_Consent_ATTR:  x->Consent = x->gg.attr; return 1;
    case zx_Destination_ATTR:  x->Destination = x->gg.attr; return 1;
    case zx_ID_ATTR:  x->ID = x->gg.attr; return 1;
    case zx_InResponseTo_ATTR:  x->InResponseTo = x->gg.attr; return 1;
    case zx_IssueInstant_ATTR:  x->IssueInstant = x->gg.attr; return 1;
    case zx_Version_ATTR:  x->Version = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_sp_NameIDMappingResponse(struct zx_ctx* c, struct zx_sp_NameIDMappingResponse_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_sa_Issuer_ELEM:
    if (!x->Issuer)
      x->Issuer = (struct zx_sa_Issuer_s*)el;
    return 1;
  case zx_ds_Signature_ELEM:
    if (!x->Signature)
      x->Signature = (struct zx_ds_Signature_s*)el;
    return 1;
  case zx_sp_Extensions_ELEM:
    if (!x->Extensions)
      x->Extensions = (struct zx_sp_Extensions_s*)el;
    return 1;
  case zx_sp_Status_ELEM:
    if (!x->Status)
      x->Status = (struct zx_sp_Status_s*)el;
    return 1;
  case zx_sa_NameID_ELEM:
    if (!x->NameID)
      x->NameID = (struct zx_sa_NameID_s*)el;
    return 1;
  case zx_sa_EncryptedID_ELEM:
    if (!x->EncryptedID)
      x->EncryptedID = (struct zx_sa_EncryptedID_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_sp_NameIDPolicy(struct zx_ctx* c, struct zx_sp_NameIDPolicy_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_AllowCreate_ATTR:  x->AllowCreate = x->gg.attr; return 1;
    case zx_Format_ATTR:  x->Format = x->gg.attr; return 1;
    case zx_SPNameQualifier_ATTR:  x->SPNameQualifier = x->gg.attr; return 1;

  default: return 0;
  }
}

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

  default: return 0;
  }
}




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

  default: return 0;
  }
}

int zx_DEC_ELEM_sp_NewEncryptedID(struct zx_ctx* c, struct zx_sp_NewEncryptedID_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_sp_RequestedAuthnContext(struct zx_ctx* c, struct zx_sp_RequestedAuthnContext_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_Comparison_ATTR:  x->Comparison = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_sp_RequestedAuthnContext(struct zx_ctx* c, struct zx_sp_RequestedAuthnContext_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_sa_AuthnContextClassRef_ELEM:
    if (!x->AuthnContextClassRef)
      x->AuthnContextClassRef = el;
    return 1;
  case zx_sa_AuthnContextDeclRef_ELEM:
    if (!x->AuthnContextDeclRef)
      x->AuthnContextDeclRef = el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_sp_Response(struct zx_ctx* c, struct zx_sp_Response_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_Consent_ATTR:  x->Consent = x->gg.attr; return 1;
    case zx_Destination_ATTR:  x->Destination = x->gg.attr; return 1;
    case zx_ID_ATTR:  x->ID = x->gg.attr; return 1;
    case zx_InResponseTo_ATTR:  x->InResponseTo = x->gg.attr; return 1;
    case zx_IssueInstant_ATTR:  x->IssueInstant = x->gg.attr; return 1;
    case zx_Version_ATTR:  x->Version = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_sp_Response(struct zx_ctx* c, struct zx_sp_Response_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_sa_Issuer_ELEM:
    if (!x->Issuer)
      x->Issuer = (struct zx_sa_Issuer_s*)el;
    return 1;
  case zx_ds_Signature_ELEM:
    if (!x->Signature)
      x->Signature = (struct zx_ds_Signature_s*)el;
    return 1;
  case zx_sp_Extensions_ELEM:
    if (!x->Extensions)
      x->Extensions = (struct zx_sp_Extensions_s*)el;
    return 1;
  case zx_sp_Status_ELEM:
    if (!x->Status)
      x->Status = (struct zx_sp_Status_s*)el;
    return 1;
  case zx_sa_Assertion_ELEM:
    if (!x->Assertion)
      x->Assertion = (struct zx_sa_Assertion_s*)el;
    return 1;
  case zx_sa_EncryptedAssertion_ELEM:
    if (!x->EncryptedAssertion)
      x->EncryptedAssertion = (struct zx_sa_EncryptedAssertion_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_sp_Scoping(struct zx_ctx* c, struct zx_sp_Scoping_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_ProxyCount_ATTR:  x->ProxyCount = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_sp_Scoping(struct zx_ctx* c, struct zx_sp_Scoping_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_sp_IDPList_ELEM:
    if (!x->IDPList)
      x->IDPList = (struct zx_sp_IDPList_s*)el;
    return 1;
  case zx_sp_RequesterID_ELEM:
    if (!x->RequesterID)
      x->RequesterID = el;
    return 1;

  default: return 0;
  }
}




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

  default: return 0;
  }
}

int zx_DEC_ELEM_sp_Status(struct zx_ctx* c, struct zx_sp_Status_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_sp_StatusCode_ELEM:
    if (!x->StatusCode)
      x->StatusCode = (struct zx_sp_StatusCode_s*)el;
    return 1;
  case zx_sp_StatusMessage_ELEM:
    if (!x->StatusMessage)
      x->StatusMessage = el;
    return 1;
  case zx_sp_StatusDetail_ELEM:
    if (!x->StatusDetail)
      x->StatusDetail = (struct zx_sp_StatusDetail_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_sp_StatusCode(struct zx_ctx* c, struct zx_sp_StatusCode_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_Value_ATTR:  x->Value = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_sp_StatusCode(struct zx_ctx* c, struct zx_sp_StatusCode_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_sp_StatusCode_ELEM:
    if (!x->StatusCode)
      x->StatusCode = (struct zx_sp_StatusCode_s*)el;
    return 1;

  default: return 0;
  }
}




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

  default: return 0;
  }
}

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

  default: return 0;
  }
}




int zx_DEC_ATTR_sp_SubjectQuery(struct zx_ctx* c, struct zx_sp_SubjectQuery_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_Consent_ATTR:  x->Consent = x->gg.attr; return 1;
    case zx_Destination_ATTR:  x->Destination = x->gg.attr; return 1;
    case zx_ID_ATTR:  x->ID = x->gg.attr; return 1;
    case zx_IssueInstant_ATTR:  x->IssueInstant = x->gg.attr; return 1;
    case zx_Version_ATTR:  x->Version = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_sp_SubjectQuery(struct zx_ctx* c, struct zx_sp_SubjectQuery_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_sa_Issuer_ELEM:
    if (!x->Issuer)
      x->Issuer = (struct zx_sa_Issuer_s*)el;
    return 1;
  case zx_ds_Signature_ELEM:
    if (!x->Signature)
      x->Signature = (struct zx_ds_Signature_s*)el;
    return 1;
  case zx_sp_Extensions_ELEM:
    if (!x->Extensions)
      x->Extensions = (struct zx_sp_Extensions_s*)el;
    return 1;
  case zx_sa_Subject_ELEM:
    if (!x->Subject)
      x->Subject = (struct zx_sa_Subject_s*)el;
    return 1;

  default: return 0;
  }
}


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