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



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

  default: return 0;
  }
}

int zx_DEC_ELEM_xa_Action(struct zx_ctx* c, struct zx_xa_Action_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_xa_ActionMatch_ELEM:
    if (!x->ActionMatch)
      x->ActionMatch = (struct zx_xa_ActionMatch_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_xa_ActionAttributeDesignator(struct zx_ctx* c, struct zx_xa_ActionAttributeDesignator_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_AttributeId_ATTR:  x->AttributeId = x->gg.attr; return 1;
    case zx_DataType_ATTR:  x->DataType = x->gg.attr; return 1;
    case zx_Issuer_ATTR:  x->Issuer = x->gg.attr; return 1;
    case zx_MustBePresent_ATTR:  x->MustBePresent = x->gg.attr; return 1;

  default: return 0;
  }
}

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

  default: return 0;
  }
}




int zx_DEC_ATTR_xa_ActionMatch(struct zx_ctx* c, struct zx_xa_ActionMatch_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_MatchId_ATTR:  x->MatchId = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_xa_ActionMatch(struct zx_ctx* c, struct zx_xa_ActionMatch_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_xa_AttributeValue_ELEM:
    if (!x->AttributeValue)
      x->AttributeValue = (struct zx_xa_AttributeValue_s*)el;
    return 1;
  case zx_xa_ActionAttributeDesignator_ELEM:
    if (!x->ActionAttributeDesignator)
      x->ActionAttributeDesignator = (struct zx_xa_ActionAttributeDesignator_s*)el;
    return 1;
  case zx_xa_AttributeSelector_ELEM:
    if (!x->AttributeSelector)
      x->AttributeSelector = (struct zx_xa_AttributeSelector_s*)el;
    return 1;

  default: return 0;
  }
}




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

  default: return 0;
  }
}

int zx_DEC_ELEM_xa_Actions(struct zx_ctx* c, struct zx_xa_Actions_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_xa_Action_ELEM:
    if (!x->Action)
      x->Action = (struct zx_xa_Action_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_xa_Apply(struct zx_ctx* c, struct zx_xa_Apply_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_FunctionId_ATTR:  x->FunctionId = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_xa_Apply(struct zx_ctx* c, struct zx_xa_Apply_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_xa_Expression_ELEM:
    if (!x->Expression)
      x->Expression = el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_xa_AttributeAssignment(struct zx_ctx* c, struct zx_xa_AttributeAssignment_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_AttributeId_ATTR:  x->AttributeId = x->gg.attr; return 1;
    case zx_DataType_ATTR:  x->DataType = x->gg.attr; return 1;

  default: return 0;
  }
}

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

  default: return 0;
  }
}




int zx_DEC_ATTR_xa_AttributeSelector(struct zx_ctx* c, struct zx_xa_AttributeSelector_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_DataType_ATTR:  x->DataType = x->gg.attr; return 1;
    case zx_MustBePresent_ATTR:  x->MustBePresent = x->gg.attr; return 1;
    case zx_RequestContextPath_ATTR:  x->RequestContextPath = x->gg.attr; return 1;

  default: return 0;
  }
}

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

  default: return 0;
  }
}




int zx_DEC_ATTR_xa_AttributeValue(struct zx_ctx* c, struct zx_xa_AttributeValue_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_DataType_ATTR:  x->DataType = x->gg.attr; return 1;

  default: return 0;
  }
}

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

  default: return 0;
  }
}




int zx_DEC_ATTR_xa_CombinerParameter(struct zx_ctx* c, struct zx_xa_CombinerParameter_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_ParameterName_ATTR:  x->ParameterName = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_xa_CombinerParameter(struct zx_ctx* c, struct zx_xa_CombinerParameter_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_xa_AttributeValue_ELEM:
    if (!x->AttributeValue)
      x->AttributeValue = (struct zx_xa_AttributeValue_s*)el;
    return 1;

  default: return 0;
  }
}




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

  default: return 0;
  }
}

int zx_DEC_ELEM_xa_CombinerParameters(struct zx_ctx* c, struct zx_xa_CombinerParameters_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_xa_CombinerParameter_ELEM:
    if (!x->CombinerParameter)
      x->CombinerParameter = (struct zx_xa_CombinerParameter_s*)el;
    return 1;

  default: return 0;
  }
}




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

  default: return 0;
  }
}

int zx_DEC_ELEM_xa_Condition(struct zx_ctx* c, struct zx_xa_Condition_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_xa_Expression_ELEM:
    if (!x->Expression)
      x->Expression = el;
    return 1;

  default: return 0;
  }
}




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

  default: return 0;
  }
}

int zx_DEC_ELEM_xa_Environment(struct zx_ctx* c, struct zx_xa_Environment_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_xa_EnvironmentMatch_ELEM:
    if (!x->EnvironmentMatch)
      x->EnvironmentMatch = (struct zx_xa_EnvironmentMatch_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_xa_EnvironmentAttributeDesignator(struct zx_ctx* c, struct zx_xa_EnvironmentAttributeDesignator_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_AttributeId_ATTR:  x->AttributeId = x->gg.attr; return 1;
    case zx_DataType_ATTR:  x->DataType = x->gg.attr; return 1;
    case zx_Issuer_ATTR:  x->Issuer = x->gg.attr; return 1;
    case zx_MustBePresent_ATTR:  x->MustBePresent = x->gg.attr; return 1;

  default: return 0;
  }
}

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

  default: return 0;
  }
}




int zx_DEC_ATTR_xa_EnvironmentMatch(struct zx_ctx* c, struct zx_xa_EnvironmentMatch_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_MatchId_ATTR:  x->MatchId = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_xa_EnvironmentMatch(struct zx_ctx* c, struct zx_xa_EnvironmentMatch_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_xa_AttributeValue_ELEM:
    if (!x->AttributeValue)
      x->AttributeValue = (struct zx_xa_AttributeValue_s*)el;
    return 1;
  case zx_xa_EnvironmentAttributeDesignator_ELEM:
    if (!x->EnvironmentAttributeDesignator)
      x->EnvironmentAttributeDesignator = (struct zx_xa_EnvironmentAttributeDesignator_s*)el;
    return 1;
  case zx_xa_AttributeSelector_ELEM:
    if (!x->AttributeSelector)
      x->AttributeSelector = (struct zx_xa_AttributeSelector_s*)el;
    return 1;

  default: return 0;
  }
}




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

  default: return 0;
  }
}

int zx_DEC_ELEM_xa_Environments(struct zx_ctx* c, struct zx_xa_Environments_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_xa_Environment_ELEM:
    if (!x->Environment)
      x->Environment = (struct zx_xa_Environment_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_xa_Function(struct zx_ctx* c, struct zx_xa_Function_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_FunctionId_ATTR:  x->FunctionId = x->gg.attr; return 1;

  default: return 0;
  }
}

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

  default: return 0;
  }
}




int zx_DEC_ATTR_xa_Obligation(struct zx_ctx* c, struct zx_xa_Obligation_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_FulfillOn_ATTR:  x->FulfillOn = x->gg.attr; return 1;
    case zx_ObligationId_ATTR:  x->ObligationId = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_xa_Obligation(struct zx_ctx* c, struct zx_xa_Obligation_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_xa_AttributeAssignment_ELEM:
    if (!x->AttributeAssignment)
      x->AttributeAssignment = (struct zx_xa_AttributeAssignment_s*)el;
    return 1;

  default: return 0;
  }
}




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

  default: return 0;
  }
}

int zx_DEC_ELEM_xa_Obligations(struct zx_ctx* c, struct zx_xa_Obligations_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_xa_Obligation_ELEM:
    if (!x->Obligation)
      x->Obligation = (struct zx_xa_Obligation_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_xa_Policy(struct zx_ctx* c, struct zx_xa_Policy_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_PolicyId_ATTR:  x->PolicyId = x->gg.attr; return 1;
    case zx_RuleCombiningAlgId_ATTR:  x->RuleCombiningAlgId = x->gg.attr; return 1;
    case zx_Version_ATTR:  x->Version = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_xa_Policy(struct zx_ctx* c, struct zx_xa_Policy_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_xa_Description_ELEM:
    if (!x->Description)
      x->Description = el;
    return 1;
  case zx_xa_PolicyDefaults_ELEM:
    if (!x->PolicyDefaults)
      x->PolicyDefaults = (struct zx_xa_PolicyDefaults_s*)el;
    return 1;
  case zx_xa_Target_ELEM:
    if (!x->Target)
      x->Target = (struct zx_xa_Target_s*)el;
    return 1;
  case zx_xa_CombinerParameters_ELEM:
    if (!x->CombinerParameters)
      x->CombinerParameters = (struct zx_xa_CombinerParameters_s*)el;
    return 1;
  case zx_xa_RuleCombinerParameters_ELEM:
    if (!x->RuleCombinerParameters)
      x->RuleCombinerParameters = (struct zx_xa_RuleCombinerParameters_s*)el;
    return 1;
  case zx_xa_VariableDefinition_ELEM:
    if (!x->VariableDefinition)
      x->VariableDefinition = (struct zx_xa_VariableDefinition_s*)el;
    return 1;
  case zx_xa_Rule_ELEM:
    if (!x->Rule)
      x->Rule = (struct zx_xa_Rule_s*)el;
    return 1;
  case zx_xa_Obligations_ELEM:
    if (!x->Obligations)
      x->Obligations = (struct zx_xa_Obligations_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_xa_PolicyCombinerParameters(struct zx_ctx* c, struct zx_xa_PolicyCombinerParameters_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_PolicyIdRef_ATTR:  x->PolicyIdRef = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_xa_PolicyCombinerParameters(struct zx_ctx* c, struct zx_xa_PolicyCombinerParameters_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_xa_CombinerParameter_ELEM:
    if (!x->CombinerParameter)
      x->CombinerParameter = (struct zx_xa_CombinerParameter_s*)el;
    return 1;

  default: return 0;
  }
}




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

  default: return 0;
  }
}

int zx_DEC_ELEM_xa_PolicyDefaults(struct zx_ctx* c, struct zx_xa_PolicyDefaults_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_xa_XPathVersion_ELEM:
    if (!x->XPathVersion)
      x->XPathVersion = el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_xa_PolicyIdReference(struct zx_ctx* c, struct zx_xa_PolicyIdReference_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_EarliestVersion_ATTR:  x->EarliestVersion = x->gg.attr; return 1;
    case zx_LatestVersion_ATTR:  x->LatestVersion = x->gg.attr; return 1;
    case zx_Version_ATTR:  x->Version = x->gg.attr; return 1;

  default: return 0;
  }
}

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

  default: return 0;
  }
}




int zx_DEC_ATTR_xa_PolicySet(struct zx_ctx* c, struct zx_xa_PolicySet_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_PolicyCombiningAlgId_ATTR:  x->PolicyCombiningAlgId = x->gg.attr; return 1;
    case zx_PolicySetId_ATTR:  x->PolicySetId = x->gg.attr; return 1;
    case zx_Version_ATTR:  x->Version = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_xa_PolicySet(struct zx_ctx* c, struct zx_xa_PolicySet_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_xa_Description_ELEM:
    if (!x->Description)
      x->Description = el;
    return 1;
  case zx_xa_PolicySetDefaults_ELEM:
    if (!x->PolicySetDefaults)
      x->PolicySetDefaults = (struct zx_xa_PolicySetDefaults_s*)el;
    return 1;
  case zx_xa_Target_ELEM:
    if (!x->Target)
      x->Target = (struct zx_xa_Target_s*)el;
    return 1;
  case zx_xa_PolicySet_ELEM:
    if (!x->PolicySet)
      x->PolicySet = (struct zx_xa_PolicySet_s*)el;
    return 1;
  case zx_xa_Policy_ELEM:
    if (!x->Policy)
      x->Policy = (struct zx_xa_Policy_s*)el;
    return 1;
  case zx_xa_PolicySetIdReference_ELEM:
    if (!x->PolicySetIdReference)
      x->PolicySetIdReference = (struct zx_xa_PolicySetIdReference_s*)el;
    return 1;
  case zx_xa_PolicyIdReference_ELEM:
    if (!x->PolicyIdReference)
      x->PolicyIdReference = (struct zx_xa_PolicyIdReference_s*)el;
    return 1;
  case zx_xa_CombinerParameters_ELEM:
    if (!x->CombinerParameters)
      x->CombinerParameters = (struct zx_xa_CombinerParameters_s*)el;
    return 1;
  case zx_xa_PolicyCombinerParameters_ELEM:
    if (!x->PolicyCombinerParameters)
      x->PolicyCombinerParameters = (struct zx_xa_PolicyCombinerParameters_s*)el;
    return 1;
  case zx_xa_PolicySetCombinerParameters_ELEM:
    if (!x->PolicySetCombinerParameters)
      x->PolicySetCombinerParameters = (struct zx_xa_PolicySetCombinerParameters_s*)el;
    return 1;
  case zx_xa_Obligations_ELEM:
    if (!x->Obligations)
      x->Obligations = (struct zx_xa_Obligations_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_xa_PolicySetCombinerParameters(struct zx_ctx* c, struct zx_xa_PolicySetCombinerParameters_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_PolicySetIdRef_ATTR:  x->PolicySetIdRef = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_xa_PolicySetCombinerParameters(struct zx_ctx* c, struct zx_xa_PolicySetCombinerParameters_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_xa_CombinerParameter_ELEM:
    if (!x->CombinerParameter)
      x->CombinerParameter = (struct zx_xa_CombinerParameter_s*)el;
    return 1;

  default: return 0;
  }
}




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

  default: return 0;
  }
}

int zx_DEC_ELEM_xa_PolicySetDefaults(struct zx_ctx* c, struct zx_xa_PolicySetDefaults_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_xa_XPathVersion_ELEM:
    if (!x->XPathVersion)
      x->XPathVersion = el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_xa_PolicySetIdReference(struct zx_ctx* c, struct zx_xa_PolicySetIdReference_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_EarliestVersion_ATTR:  x->EarliestVersion = x->gg.attr; return 1;
    case zx_LatestVersion_ATTR:  x->LatestVersion = x->gg.attr; return 1;
    case zx_Version_ATTR:  x->Version = x->gg.attr; return 1;

  default: return 0;
  }
}

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

  default: return 0;
  }
}




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

  default: return 0;
  }
}

int zx_DEC_ELEM_xa_Resource(struct zx_ctx* c, struct zx_xa_Resource_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_xa_ResourceMatch_ELEM:
    if (!x->ResourceMatch)
      x->ResourceMatch = (struct zx_xa_ResourceMatch_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_xa_ResourceAttributeDesignator(struct zx_ctx* c, struct zx_xa_ResourceAttributeDesignator_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_AttributeId_ATTR:  x->AttributeId = x->gg.attr; return 1;
    case zx_DataType_ATTR:  x->DataType = x->gg.attr; return 1;
    case zx_Issuer_ATTR:  x->Issuer = x->gg.attr; return 1;
    case zx_MustBePresent_ATTR:  x->MustBePresent = x->gg.attr; return 1;

  default: return 0;
  }
}

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

  default: return 0;
  }
}




int zx_DEC_ATTR_xa_ResourceMatch(struct zx_ctx* c, struct zx_xa_ResourceMatch_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_MatchId_ATTR:  x->MatchId = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_xa_ResourceMatch(struct zx_ctx* c, struct zx_xa_ResourceMatch_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_xa_AttributeValue_ELEM:
    if (!x->AttributeValue)
      x->AttributeValue = (struct zx_xa_AttributeValue_s*)el;
    return 1;
  case zx_xa_ResourceAttributeDesignator_ELEM:
    if (!x->ResourceAttributeDesignator)
      x->ResourceAttributeDesignator = (struct zx_xa_ResourceAttributeDesignator_s*)el;
    return 1;
  case zx_xa_AttributeSelector_ELEM:
    if (!x->AttributeSelector)
      x->AttributeSelector = (struct zx_xa_AttributeSelector_s*)el;
    return 1;

  default: return 0;
  }
}




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

  default: return 0;
  }
}

int zx_DEC_ELEM_xa_Resources(struct zx_ctx* c, struct zx_xa_Resources_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_xa_Resource_ELEM:
    if (!x->Resource)
      x->Resource = (struct zx_xa_Resource_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_xa_Rule(struct zx_ctx* c, struct zx_xa_Rule_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_Effect_ATTR:  x->Effect = x->gg.attr; return 1;
    case zx_RuleId_ATTR:  x->RuleId = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_xa_Rule(struct zx_ctx* c, struct zx_xa_Rule_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_xa_Description_ELEM:
    if (!x->Description)
      x->Description = el;
    return 1;
  case zx_xa_Target_ELEM:
    if (!x->Target)
      x->Target = (struct zx_xa_Target_s*)el;
    return 1;
  case zx_xa_Condition_ELEM:
    if (!x->Condition)
      x->Condition = (struct zx_xa_Condition_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_xa_RuleCombinerParameters(struct zx_ctx* c, struct zx_xa_RuleCombinerParameters_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_RuleIdRef_ATTR:  x->RuleIdRef = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_xa_RuleCombinerParameters(struct zx_ctx* c, struct zx_xa_RuleCombinerParameters_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_xa_CombinerParameter_ELEM:
    if (!x->CombinerParameter)
      x->CombinerParameter = (struct zx_xa_CombinerParameter_s*)el;
    return 1;

  default: return 0;
  }
}




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

  default: return 0;
  }
}

int zx_DEC_ELEM_xa_Subject(struct zx_ctx* c, struct zx_xa_Subject_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_xa_SubjectMatch_ELEM:
    if (!x->SubjectMatch)
      x->SubjectMatch = (struct zx_xa_SubjectMatch_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_xa_SubjectAttributeDesignator(struct zx_ctx* c, struct zx_xa_SubjectAttributeDesignator_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_AttributeId_ATTR:  x->AttributeId = x->gg.attr; return 1;
    case zx_DataType_ATTR:  x->DataType = x->gg.attr; return 1;
    case zx_Issuer_ATTR:  x->Issuer = x->gg.attr; return 1;
    case zx_MustBePresent_ATTR:  x->MustBePresent = x->gg.attr; return 1;
    case zx_SubjectCategory_ATTR:  x->SubjectCategory = x->gg.attr; return 1;

  default: return 0;
  }
}

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

  default: return 0;
  }
}




int zx_DEC_ATTR_xa_SubjectMatch(struct zx_ctx* c, struct zx_xa_SubjectMatch_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_MatchId_ATTR:  x->MatchId = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_xa_SubjectMatch(struct zx_ctx* c, struct zx_xa_SubjectMatch_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_xa_AttributeValue_ELEM:
    if (!x->AttributeValue)
      x->AttributeValue = (struct zx_xa_AttributeValue_s*)el;
    return 1;
  case zx_xa_SubjectAttributeDesignator_ELEM:
    if (!x->SubjectAttributeDesignator)
      x->SubjectAttributeDesignator = (struct zx_xa_SubjectAttributeDesignator_s*)el;
    return 1;
  case zx_xa_AttributeSelector_ELEM:
    if (!x->AttributeSelector)
      x->AttributeSelector = (struct zx_xa_AttributeSelector_s*)el;
    return 1;

  default: return 0;
  }
}




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

  default: return 0;
  }
}

int zx_DEC_ELEM_xa_Subjects(struct zx_ctx* c, struct zx_xa_Subjects_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_xa_Subject_ELEM:
    if (!x->Subject)
      x->Subject = (struct zx_xa_Subject_s*)el;
    return 1;

  default: return 0;
  }
}




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

  default: return 0;
  }
}

int zx_DEC_ELEM_xa_Target(struct zx_ctx* c, struct zx_xa_Target_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_xa_Subjects_ELEM:
    if (!x->Subjects)
      x->Subjects = (struct zx_xa_Subjects_s*)el;
    return 1;
  case zx_xa_Resources_ELEM:
    if (!x->Resources)
      x->Resources = (struct zx_xa_Resources_s*)el;
    return 1;
  case zx_xa_Actions_ELEM:
    if (!x->Actions)
      x->Actions = (struct zx_xa_Actions_s*)el;
    return 1;
  case zx_xa_Environments_ELEM:
    if (!x->Environments)
      x->Environments = (struct zx_xa_Environments_s*)el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_xa_VariableDefinition(struct zx_ctx* c, struct zx_xa_VariableDefinition_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_VariableId_ATTR:  x->VariableId = x->gg.attr; return 1;

  default: return 0;
  }
}

int zx_DEC_ELEM_xa_VariableDefinition(struct zx_ctx* c, struct zx_xa_VariableDefinition_s* x)
{
  struct zx_elem_s* el = x->gg.kids;
  switch (el->g.tok) {
  case zx_xa_Expression_ELEM:
    if (!x->Expression)
      x->Expression = el;
    return 1;

  default: return 0;
  }
}




int zx_DEC_ATTR_xa_VariableReference(struct zx_ctx* c, struct zx_xa_VariableReference_s* x)
{
  switch (x->gg.attr->g.tok) {
    case zx_VariableId_ATTR:  x->VariableId = x->gg.attr; return 1;

  default: return 0;
  }
}

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

  default: return 0;
  }
}


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