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



int zx_DEC_ATTR_sa_Action(struct zx_ctx* c, struct zx_sa_Action_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_Namespace_ATTR:  x->Namespace = x->gg.attr; return 1;

  default: return 0;
  }
}

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

  default: return 0;
  }
}




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

  default: return 0;
  }
}

int zx_DEC_ELEM_sa_Advice(struct zx_ctx* c, struct zx_sa_Advice_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_sa_AssertionIDRef_ELEM:
    if (!x->AssertionIDRef)
      x->AssertionIDRef = el;
    return 1;
  case zx_sa_AssertionURIRef_ELEM:
    if (!x->AssertionURIRef)
      x->AssertionURIRef = 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;
  case zx_sa11_Assertion_ELEM:
    if (!x->sa11_Assertion)
      x->sa11_Assertion = (struct zx_sa11_Assertion_s*)el;
    return 1;
  case zx_ff12_Assertion_ELEM:
    if (!x->ff12_Assertion)
      x->ff12_Assertion = (struct zx_ff12_Assertion_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_sa_Assertion(struct zx_ctx* c, struct zx_sa_Assertion_s* x)
{
  switch (x->gg.attr->g.tok) {
    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_sa_Assertion(struct zx_ctx* c, struct zx_sa_Assertion_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_sa_Subject_ELEM:
    if (!x->Subject)
      x->Subject = (struct zx_sa_Subject_s*)el;
    return 1;
  case zx_sa_Conditions_ELEM:
    if (!x->Conditions)
      x->Conditions = (struct zx_sa_Conditions_s*)el;
    return 1;
  case zx_sa_Advice_ELEM:
    if (!x->Advice)
      x->Advice = (struct zx_sa_Advice_s*)el;
    return 1;
  case zx_sa_Statement_ELEM:
    if (!x->Statement)
      x->Statement = (struct zx_sa_Statement_s*)el;
    return 1;
  case zx_sa_AuthnStatement_ELEM:
    if (!x->AuthnStatement)
      x->AuthnStatement = (struct zx_sa_AuthnStatement_s*)el;
    return 1;
  case zx_sa_AuthzDecisionStatement_ELEM:
    if (!x->AuthzDecisionStatement)
      x->AuthzDecisionStatement = (struct zx_sa_AuthzDecisionStatement_s*)el;
    return 1;
  case zx_sa_AttributeStatement_ELEM:
    if (!x->AttributeStatement)
      x->AttributeStatement = (struct zx_sa_AttributeStatement_s*)el;
    return 1;
  case zx_xasa_XACMLAuthzDecisionStatement_ELEM:
    if (!x->XACMLAuthzDecisionStatement)
      x->XACMLAuthzDecisionStatement = (struct zx_xasa_XACMLAuthzDecisionStatement_s*)el;
    return 1;
  case zx_xasa_XACMLPolicyStatement_ELEM:
    if (!x->XACMLPolicyStatement)
      x->XACMLPolicyStatement = (struct zx_xasa_XACMLPolicyStatement_s*)el;
    return 1;
  case zx_xasacd1_XACMLAuthzDecisionStatement_ELEM:
    if (!x->xasacd1_XACMLAuthzDecisionStatement)
      x->xasacd1_XACMLAuthzDecisionStatement = (struct zx_xasacd1_XACMLAuthzDecisionStatement_s*)el;
    return 1;
  case zx_xasacd1_XACMLPolicyStatement_ELEM:
    if (!x->xasacd1_XACMLPolicyStatement)
      x->xasacd1_XACMLPolicyStatement = (struct zx_xasacd1_XACMLPolicyStatement_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_sa_Attribute(struct zx_ctx* c, struct zx_sa_Attribute_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_FriendlyName_ATTR:  x->FriendlyName = x->gg.attr; return 1;
    case zx_Name_ATTR:  x->Name = x->gg.attr; return 1;
    case zx_NameFormat_ATTR:  x->NameFormat = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_sa_Attribute(struct zx_ctx* c, struct zx_sa_Attribute_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_sa_AttributeValue_ELEM:
    if (!x->AttributeValue)
      x->AttributeValue = (struct zx_sa_AttributeValue_s*)el;
    return 1;

  default: return 0;
  }
}




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

  default: return 0;
  }
}

int zx_DEC_ELEM_sa_AttributeStatement(struct zx_ctx* c, struct zx_sa_AttributeStatement_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_sa_Attribute_ELEM:
    if (!x->Attribute)
      x->Attribute = (struct zx_sa_Attribute_s*)el;
    return 1;
  case zx_sa_EncryptedAttribute_ELEM:
    if (!x->EncryptedAttribute)
      x->EncryptedAttribute = (struct zx_sa_EncryptedAttribute_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_sa_AttributeValue(struct zx_ctx* c, struct zx_sa_AttributeValue_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_type_ATTR|zx_xsi_NS:  x->type = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_sa_AttributeValue(struct zx_ctx* c, struct zx_sa_AttributeValue_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_di12_ResourceOffering_ELEM:
    if (!x->ResourceOffering)
      x->ResourceOffering = (struct zx_di12_ResourceOffering_s*)el;
    return 1;
  case zx_a_EndpointReference_ELEM:
    if (!x->EndpointReference)
      x->EndpointReference = (struct zx_a_EndpointReference_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_sa_AudienceRestriction(struct zx_ctx* c, struct zx_sa_AudienceRestriction_s* x)
{
  switch (x->gg.attr->g.tok) {

  default: return 0;
  }
}

int zx_DEC_ELEM_sa_AudienceRestriction(struct zx_ctx* c, struct zx_sa_AudienceRestriction_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_sa_Audience_ELEM:
    if (!x->Audience)
      x->Audience = el;
    return 1;

  default: return 0;
  }
}




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

  default: return 0;
  }
}

int zx_DEC_ELEM_sa_AuthnContext(struct zx_ctx* c, struct zx_sa_AuthnContext_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_AuthnContextDecl_ELEM:
    if (!x->AuthnContextDecl)
      x->AuthnContextDecl = el;
    return 1;
  case zx_sa_AuthnContextDeclRef_ELEM:
    if (!x->AuthnContextDeclRef)
      x->AuthnContextDeclRef = el;
    return 1;
  case zx_sa_AuthenticatingAuthority_ELEM:
    if (!x->AuthenticatingAuthority)
      x->AuthenticatingAuthority = el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_sa_AuthnStatement(struct zx_ctx* c, struct zx_sa_AuthnStatement_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_AuthnInstant_ATTR:  x->AuthnInstant = x->gg.attr; return 1;
    case zx_SessionIndex_ATTR:  x->SessionIndex = x->gg.attr; return 1;
    case zx_SessionNotOnOrAfter_ATTR:  x->SessionNotOnOrAfter = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_sa_AuthnStatement(struct zx_ctx* c, struct zx_sa_AuthnStatement_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_sa_SubjectLocality_ELEM:
    if (!x->SubjectLocality)
      x->SubjectLocality = (struct zx_sa_SubjectLocality_s*)el;
    return 1;
  case zx_sa_AuthnContext_ELEM:
    if (!x->AuthnContext)
      x->AuthnContext = (struct zx_sa_AuthnContext_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_sa_AuthzDecisionStatement(struct zx_ctx* c, struct zx_sa_AuthzDecisionStatement_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_Decision_ATTR:  x->Decision = x->gg.attr; return 1;
    case zx_Resource_ATTR:  x->Resource = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_sa_AuthzDecisionStatement(struct zx_ctx* c, struct zx_sa_AuthzDecisionStatement_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  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_sa_BaseID(struct zx_ctx* c, struct zx_sa_BaseID_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_NameQualifier_ATTR:  x->NameQualifier = x->gg.attr; return 1;
    case zx_SPNameQualifier_ATTR:  x->SPNameQualifier = x->gg.attr; return 1;

  default: return 0;
  }
}

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

  default: return 0;
  }
}




int zx_DEC_ATTR_sa_Conditions(struct zx_ctx* c, struct zx_sa_Conditions_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_NotBefore_ATTR:  x->NotBefore = x->gg.attr; return 1;
    case zx_NotOnOrAfter_ATTR:  x->NotOnOrAfter = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_sa_Conditions(struct zx_ctx* c, struct zx_sa_Conditions_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_sa_Condition_ELEM:
    if (!x->Condition)
      x->Condition = el;
    return 1;
  case zx_sa_AudienceRestriction_ELEM:
    if (!x->AudienceRestriction)
      x->AudienceRestriction = (struct zx_sa_AudienceRestriction_s*)el;
    return 1;
  case zx_sa_OneTimeUse_ELEM:
    if (!x->OneTimeUse)
      x->OneTimeUse = (struct zx_sa_OneTimeUse_s*)el;
    return 1;
  case zx_sa_ProxyRestriction_ELEM:
    if (!x->ProxyRestriction)
      x->ProxyRestriction = (struct zx_sa_ProxyRestriction_s*)el;
    return 1;
  case zx_idp_SubjectRestriction_ELEM:
    if (!x->SubjectRestriction)
      x->SubjectRestriction = (struct zx_idp_SubjectRestriction_s*)el;
    return 1;

  default: return 0;
  }
}




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

  default: return 0;
  }
}

int zx_DEC_ELEM_sa_EncryptedAssertion(struct zx_ctx* c, struct zx_sa_EncryptedAssertion_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_sa_EncryptedAttribute(struct zx_ctx* c, struct zx_sa_EncryptedAttribute_s* x)
{
  switch (x->gg.attr->g.tok) {

  default: return 0;
  }
}

int zx_DEC_ELEM_sa_EncryptedAttribute(struct zx_ctx* c, struct zx_sa_EncryptedAttribute_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_sa_EncryptedID(struct zx_ctx* c, struct zx_sa_EncryptedID_s* x)
{
  switch (x->gg.attr->g.tok) {

  default: return 0;
  }
}

int zx_DEC_ELEM_sa_EncryptedID(struct zx_ctx* c, struct zx_sa_EncryptedID_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_sa_Evidence(struct zx_ctx* c, struct zx_sa_Evidence_s* x)
{
  switch (x->gg.attr->g.tok) {

  default: return 0;
  }
}

int zx_DEC_ELEM_sa_Evidence(struct zx_ctx* c, struct zx_sa_Evidence_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_sa_AssertionIDRef_ELEM:
    if (!x->AssertionIDRef)
      x->AssertionIDRef = el;
    return 1;
  case zx_sa_AssertionURIRef_ELEM:
    if (!x->AssertionURIRef)
      x->AssertionURIRef = 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_sa_Issuer(struct zx_ctx* c, struct zx_sa_Issuer_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_Format_ATTR:  x->Format = x->gg.attr; return 1;
    case zx_NameQualifier_ATTR:  x->NameQualifier = x->gg.attr; return 1;
    case zx_SPNameQualifier_ATTR:  x->SPNameQualifier = x->gg.attr; return 1;
    case zx_SPProvidedID_ATTR:  x->SPProvidedID = x->gg.attr; return 1;

  default: return 0;
  }
}

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

  default: return 0;
  }
}




int zx_DEC_ATTR_sa_NameID(struct zx_ctx* c, struct zx_sa_NameID_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_Format_ATTR:  x->Format = x->gg.attr; return 1;
    case zx_NameQualifier_ATTR:  x->NameQualifier = x->gg.attr; return 1;
    case zx_SPNameQualifier_ATTR:  x->SPNameQualifier = x->gg.attr; return 1;
    case zx_SPProvidedID_ATTR:  x->SPProvidedID = x->gg.attr; return 1;

  default: return 0;
  }
}

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

  default: return 0;
  }
}




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

  default: return 0;
  }
}

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

  default: return 0;
  }
}




int zx_DEC_ATTR_sa_ProxyRestriction(struct zx_ctx* c, struct zx_sa_ProxyRestriction_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_Count_ATTR:  x->Count = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_sa_ProxyRestriction(struct zx_ctx* c, struct zx_sa_ProxyRestriction_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_sa_Audience_ELEM:
    if (!x->Audience)
      x->Audience = el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_sa_Statement(struct zx_ctx* c, struct zx_sa_Statement_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_type_ATTR|zx_xsi_NS:  x->type = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_sa_Statement(struct zx_ctx* c, struct zx_sa_Statement_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_xac_Response_ELEM:
    if (!x->Response)
      x->Response = (struct zx_xac_Response_s*)el;
    return 1;
  case zx_xac_Request_ELEM:
    if (!x->Request)
      x->Request = (struct zx_xac_Request_s*)el;
    return 1;

  default: return 0;
  }
}




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

  default: return 0;
  }
}

int zx_DEC_ELEM_sa_Subject(struct zx_ctx* c, struct zx_sa_Subject_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  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_sa_SubjectConfirmation_ELEM:
    if (!x->SubjectConfirmation)
      x->SubjectConfirmation = (struct zx_sa_SubjectConfirmation_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_sa_SubjectConfirmation(struct zx_ctx* c, struct zx_sa_SubjectConfirmation_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_Method_ATTR:  x->Method = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_sa_SubjectConfirmation(struct zx_ctx* c, struct zx_sa_SubjectConfirmation_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  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_sa_SubjectConfirmationData_ELEM:
    if (!x->SubjectConfirmationData)
      x->SubjectConfirmationData = (struct zx_sa_SubjectConfirmationData_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_sa_SubjectConfirmationData(struct zx_ctx* c, struct zx_sa_SubjectConfirmationData_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_Address_ATTR:  x->Address = x->gg.attr; return 1;
    case zx_InResponseTo_ATTR:  x->InResponseTo = x->gg.attr; return 1;
    case zx_NotBefore_ATTR:  x->NotBefore = x->gg.attr; return 1;
    case zx_NotOnOrAfter_ATTR:  x->NotOnOrAfter = x->gg.attr; return 1;
    case zx_Recipient_ATTR:  x->Recipient = x->gg.attr; return 1;
    case zx_type_ATTR|zx_xsi_NS:  x->type = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_sa_SubjectConfirmationData(struct zx_ctx* c, struct zx_sa_SubjectConfirmationData_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_ds_KeyInfo_ELEM:
    if (!x->KeyInfo)
      x->KeyInfo = (struct zx_ds_KeyInfo_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_sa_SubjectLocality(struct zx_ctx* c, struct zx_sa_SubjectLocality_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_Address_ATTR:  x->Address = x->gg.attr; return 1;
    case zx_DNSName_ATTR:  x->DNSName = x->gg.attr; return 1;

  default: return 0;
  }
}

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

  default: return 0;
  }
}




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

  default: return 0;
  }
}

int zx_DEC_ELEM_sa_TestElem(struct zx_ctx* c, struct zx_sa_TestElem_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_sa_AttributeValue_ELEM:
    if (!x->AttributeValue)
      x->AttributeValue = (struct zx_sa_AttributeValue_s*)el;
    return 1;

  default: return 0;
  }
}


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