/***************************************
 An automatically generated skeleton XML parser.

 Automatically generated by xsd-to-xmlparser.
 ***************************************/


#include <stdio.h>

#include "xmlparse.h"


/* The XML tag processing function prototypes */

static int xmlDeclaration_function(const char *_tag_,int _type_,const char *version,const char *encoding);
static int RoutinoProfilesType_function(const char *_tag_,int _type_);
static int profileType_function(const char *_tag_,int _type_,const char *name,const char *transport);
static int restrictionsType_function(const char *_tag_,int _type_);
static int lengthType_function(const char *_tag_,int _type_,const char *limit);
static int widthType_function(const char *_tag_,int _type_,const char *limit);
static int heightType_function(const char *_tag_,int _type_,const char *limit);
static int weightType_function(const char *_tag_,int _type_,const char *limit);
static int turnsType_function(const char *_tag_,int _type_,const char *obey);
static int propertiesType_function(const char *_tag_,int _type_);
static int onewayType_function(const char *_tag_,int _type_,const char *obey);
static int propertyType_function(const char *_tag_,int _type_,const char *type,const char *percent);
static int preferencesType_function(const char *_tag_,int _type_);
static int preferenceType_function(const char *_tag_,int _type_,const char *highway,const char *percent);
static int speedsType_function(const char *_tag_,int _type_);
static int speedType_function(const char *_tag_,int _type_,const char *highway,const char *kph);


/* The XML tag definitions */

/*+ The speedType type tag. +*/
static xmltag speedType_tag=
              {"speed",
               2, {"highway","kph"},
               speedType_function,
               {NULL}};

/*+ The speedsType type tag. +*/
static xmltag speedsType_tag=
              {"speeds",
               0, {NULL},
               speedsType_function,
               {&speedType_tag,NULL}};

/*+ The preferenceType type tag. +*/
static xmltag preferenceType_tag=
              {"preference",
               2, {"highway","percent"},
               preferenceType_function,
               {NULL}};

/*+ The preferencesType type tag. +*/
static xmltag preferencesType_tag=
              {"preferences",
               0, {NULL},
               preferencesType_function,
               {&preferenceType_tag,NULL}};

/*+ The propertyType type tag. +*/
static xmltag propertyType_tag=
              {"property",
               2, {"type","percent"},
               propertyType_function,
               {NULL}};

/*+ The onewayType type tag. +*/
static xmltag onewayType_tag=
              {"oneway",
               1, {"obey"},
               onewayType_function,
               {NULL}};

/*+ The propertiesType type tag. +*/
static xmltag propertiesType_tag=
              {"properties",
               0, {NULL},
               propertiesType_function,
               {&propertyType_tag,NULL}};

/*+ The turnsType type tag. +*/
static xmltag turnsType_tag=
              {"turns",
               1, {"obey"},
               turnsType_function,
               {NULL}};

/*+ The weightType type tag. +*/
static xmltag weightType_tag=
              {"weight",
               1, {"limit"},
               weightType_function,
               {NULL}};

/*+ The heightType type tag. +*/
static xmltag heightType_tag=
              {"height",
               1, {"limit"},
               heightType_function,
               {NULL}};

/*+ The widthType type tag. +*/
static xmltag widthType_tag=
              {"width",
               1, {"limit"},
               widthType_function,
               {NULL}};

/*+ The lengthType type tag. +*/
static xmltag lengthType_tag=
              {"length",
               1, {"limit"},
               lengthType_function,
               {NULL}};

/*+ The restrictionsType type tag. +*/
static xmltag restrictionsType_tag=
              {"restrictions",
               0, {NULL},
               restrictionsType_function,
               {&onewayType_tag,&turnsType_tag,&weightType_tag,&heightType_tag,&widthType_tag,&lengthType_tag,NULL}};

/*+ The profileType type tag. +*/
static xmltag profileType_tag=
              {"profile",
               2, {"name","transport"},
               profileType_function,
               {&speedsType_tag,&preferencesType_tag,&propertiesType_tag,&restrictionsType_tag,NULL}};

/*+ The RoutinoProfilesType type tag. +*/
static xmltag RoutinoProfilesType_tag=
              {"routino-profiles",
               0, {NULL},
               RoutinoProfilesType_function,
               {&profileType_tag,NULL}};

/*+ The xmlDeclaration type tag. +*/
static xmltag xmlDeclaration_tag=
              {"xml",
               2, {"version","encoding"},
               xmlDeclaration_function,
               {NULL}};


/*+ The complete set of tags at the top level. +*/
static xmltag *xml_toplevel_tags[]={&xmlDeclaration_tag,&RoutinoProfilesType_tag,NULL};


/* The XML tag processing functions */


/*++++++++++++++++++++++++++++++++++++++
  The function that is called when the speedType XSD type is seen

  int speedType_function Returns 0 if no error occured or something else otherwise.

  const char *_tag_ Set to the name of the element tag that triggered this function call.

  int _type_ Set to XMLPARSE_TAG_START at the start of a tag and/or XMLPARSE_TAG_END at the end of a tag.

  const char *highway The contents of the 'highway' attribute (or NULL if not defined).

  const char *kph The contents of the 'kph' attribute (or NULL if not defined).
  ++++++++++++++++++++++++++++++++++++++*/

static int speedType_function(const char *_tag_,int _type_,const char *highway,const char *kph)
{
 printf("<%s%s",(_type_==XMLPARSE_TAG_END)?"/":"",_tag_);
 if(highway) printf(" highway=\"%s\"",ParseXML_Encode_Safe_XML(highway));
 if(kph) printf(" kph=\"%s\"",ParseXML_Encode_Safe_XML(kph));
 printf("%s>\n",(_type_==(XMLPARSE_TAG_START|XMLPARSE_TAG_END))?" /":"");
 return(0);
}


/*++++++++++++++++++++++++++++++++++++++
  The function that is called when the speedsType XSD type is seen

  int speedsType_function Returns 0 if no error occured or something else otherwise.

  const char *_tag_ Set to the name of the element tag that triggered this function call.

  int _type_ Set to XMLPARSE_TAG_START at the start of a tag and/or XMLPARSE_TAG_END at the end of a tag.
  ++++++++++++++++++++++++++++++++++++++*/

static int speedsType_function(const char *_tag_,int _type_)
{
 printf("<%s%s",(_type_==XMLPARSE_TAG_END)?"/":"",_tag_);
 printf("%s>\n",(_type_==(XMLPARSE_TAG_START|XMLPARSE_TAG_END))?" /":"");
 return(0);
}


/*++++++++++++++++++++++++++++++++++++++
  The function that is called when the preferenceType XSD type is seen

  int preferenceType_function Returns 0 if no error occured or something else otherwise.

  const char *_tag_ Set to the name of the element tag that triggered this function call.

  int _type_ Set to XMLPARSE_TAG_START at the start of a tag and/or XMLPARSE_TAG_END at the end of a tag.

  const char *highway The contents of the 'highway' attribute (or NULL if not defined).

  const char *percent The contents of the 'percent' attribute (or NULL if not defined).
  ++++++++++++++++++++++++++++++++++++++*/

static int preferenceType_function(const char *_tag_,int _type_,const char *highway,const char *percent)
{
 printf("<%s%s",(_type_==XMLPARSE_TAG_END)?"/":"",_tag_);
 if(highway) printf(" highway=\"%s\"",ParseXML_Encode_Safe_XML(highway));
 if(percent) printf(" percent=\"%s\"",ParseXML_Encode_Safe_XML(percent));
 printf("%s>\n",(_type_==(XMLPARSE_TAG_START|XMLPARSE_TAG_END))?" /":"");
 return(0);
}


/*++++++++++++++++++++++++++++++++++++++
  The function that is called when the preferencesType XSD type is seen

  int preferencesType_function Returns 0 if no error occured or something else otherwise.

  const char *_tag_ Set to the name of the element tag that triggered this function call.

  int _type_ Set to XMLPARSE_TAG_START at the start of a tag and/or XMLPARSE_TAG_END at the end of a tag.
  ++++++++++++++++++++++++++++++++++++++*/

static int preferencesType_function(const char *_tag_,int _type_)
{
 printf("<%s%s",(_type_==XMLPARSE_TAG_END)?"/":"",_tag_);
 printf("%s>\n",(_type_==(XMLPARSE_TAG_START|XMLPARSE_TAG_END))?" /":"");
 return(0);
}


/*++++++++++++++++++++++++++++++++++++++
  The function that is called when the propertyType XSD type is seen

  int propertyType_function Returns 0 if no error occured or something else otherwise.

  const char *_tag_ Set to the name of the element tag that triggered this function call.

  int _type_ Set to XMLPARSE_TAG_START at the start of a tag and/or XMLPARSE_TAG_END at the end of a tag.

  const char *type The contents of the 'type' attribute (or NULL if not defined).

  const char *percent The contents of the 'percent' attribute (or NULL if not defined).
  ++++++++++++++++++++++++++++++++++++++*/

static int propertyType_function(const char *_tag_,int _type_,const char *type,const char *percent)
{
 printf("<%s%s",(_type_==XMLPARSE_TAG_END)?"/":"",_tag_);
 if(type) printf(" type=\"%s\"",ParseXML_Encode_Safe_XML(type));
 if(percent) printf(" percent=\"%s\"",ParseXML_Encode_Safe_XML(percent));
 printf("%s>\n",(_type_==(XMLPARSE_TAG_START|XMLPARSE_TAG_END))?" /":"");
 return(0);
}


/*++++++++++++++++++++++++++++++++++++++
  The function that is called when the onewayType XSD type is seen

  int onewayType_function Returns 0 if no error occured or something else otherwise.

  const char *_tag_ Set to the name of the element tag that triggered this function call.

  int _type_ Set to XMLPARSE_TAG_START at the start of a tag and/or XMLPARSE_TAG_END at the end of a tag.

  const char *obey The contents of the 'obey' attribute (or NULL if not defined).
  ++++++++++++++++++++++++++++++++++++++*/

static int onewayType_function(const char *_tag_,int _type_,const char *obey)
{
 printf("<%s%s",(_type_==XMLPARSE_TAG_END)?"/":"",_tag_);
 if(obey) printf(" obey=\"%s\"",ParseXML_Encode_Safe_XML(obey));
 printf("%s>\n",(_type_==(XMLPARSE_TAG_START|XMLPARSE_TAG_END))?" /":"");
 return(0);
}


/*++++++++++++++++++++++++++++++++++++++
  The function that is called when the propertiesType XSD type is seen

  int propertiesType_function Returns 0 if no error occured or something else otherwise.

  const char *_tag_ Set to the name of the element tag that triggered this function call.

  int _type_ Set to XMLPARSE_TAG_START at the start of a tag and/or XMLPARSE_TAG_END at the end of a tag.
  ++++++++++++++++++++++++++++++++++++++*/

static int propertiesType_function(const char *_tag_,int _type_)
{
 printf("<%s%s",(_type_==XMLPARSE_TAG_END)?"/":"",_tag_);
 printf("%s>\n",(_type_==(XMLPARSE_TAG_START|XMLPARSE_TAG_END))?" /":"");
 return(0);
}


/*++++++++++++++++++++++++++++++++++++++
  The function that is called when the turnsType XSD type is seen

  int turnsType_function Returns 0 if no error occured or something else otherwise.

  const char *_tag_ Set to the name of the element tag that triggered this function call.

  int _type_ Set to XMLPARSE_TAG_START at the start of a tag and/or XMLPARSE_TAG_END at the end of a tag.

  const char *obey The contents of the 'obey' attribute (or NULL if not defined).
  ++++++++++++++++++++++++++++++++++++++*/

static int turnsType_function(const char *_tag_,int _type_,const char *obey)
{
 printf("<%s%s",(_type_==XMLPARSE_TAG_END)?"/":"",_tag_);
 if(obey) printf(" obey=\"%s\"",ParseXML_Encode_Safe_XML(obey));
 printf("%s>\n",(_type_==(XMLPARSE_TAG_START|XMLPARSE_TAG_END))?" /":"");
 return(0);
}


/*++++++++++++++++++++++++++++++++++++++
  The function that is called when the weightType XSD type is seen

  int weightType_function Returns 0 if no error occured or something else otherwise.

  const char *_tag_ Set to the name of the element tag that triggered this function call.

  int _type_ Set to XMLPARSE_TAG_START at the start of a tag and/or XMLPARSE_TAG_END at the end of a tag.

  const char *limit The contents of the 'limit' attribute (or NULL if not defined).
  ++++++++++++++++++++++++++++++++++++++*/

static int weightType_function(const char *_tag_,int _type_,const char *limit)
{
 printf("<%s%s",(_type_==XMLPARSE_TAG_END)?"/":"",_tag_);
 if(limit) printf(" limit=\"%s\"",ParseXML_Encode_Safe_XML(limit));
 printf("%s>\n",(_type_==(XMLPARSE_TAG_START|XMLPARSE_TAG_END))?" /":"");
 return(0);
}


/*++++++++++++++++++++++++++++++++++++++
  The function that is called when the heightType XSD type is seen

  int heightType_function Returns 0 if no error occured or something else otherwise.

  const char *_tag_ Set to the name of the element tag that triggered this function call.

  int _type_ Set to XMLPARSE_TAG_START at the start of a tag and/or XMLPARSE_TAG_END at the end of a tag.

  const char *limit The contents of the 'limit' attribute (or NULL if not defined).
  ++++++++++++++++++++++++++++++++++++++*/

static int heightType_function(const char *_tag_,int _type_,const char *limit)
{
 printf("<%s%s",(_type_==XMLPARSE_TAG_END)?"/":"",_tag_);
 if(limit) printf(" limit=\"%s\"",ParseXML_Encode_Safe_XML(limit));
 printf("%s>\n",(_type_==(XMLPARSE_TAG_START|XMLPARSE_TAG_END))?" /":"");
 return(0);
}


/*++++++++++++++++++++++++++++++++++++++
  The function that is called when the widthType XSD type is seen

  int widthType_function Returns 0 if no error occured or something else otherwise.

  const char *_tag_ Set to the name of the element tag that triggered this function call.

  int _type_ Set to XMLPARSE_TAG_START at the start of a tag and/or XMLPARSE_TAG_END at the end of a tag.

  const char *limit The contents of the 'limit' attribute (or NULL if not defined).
  ++++++++++++++++++++++++++++++++++++++*/

static int widthType_function(const char *_tag_,int _type_,const char *limit)
{
 printf("<%s%s",(_type_==XMLPARSE_TAG_END)?"/":"",_tag_);
 if(limit) printf(" limit=\"%s\"",ParseXML_Encode_Safe_XML(limit));
 printf("%s>\n",(_type_==(XMLPARSE_TAG_START|XMLPARSE_TAG_END))?" /":"");
 return(0);
}


/*++++++++++++++++++++++++++++++++++++++
  The function that is called when the lengthType XSD type is seen

  int lengthType_function Returns 0 if no error occured or something else otherwise.

  const char *_tag_ Set to the name of the element tag that triggered this function call.

  int _type_ Set to XMLPARSE_TAG_START at the start of a tag and/or XMLPARSE_TAG_END at the end of a tag.

  const char *limit The contents of the 'limit' attribute (or NULL if not defined).
  ++++++++++++++++++++++++++++++++++++++*/

static int lengthType_function(const char *_tag_,int _type_,const char *limit)
{
 printf("<%s%s",(_type_==XMLPARSE_TAG_END)?"/":"",_tag_);
 if(limit) printf(" limit=\"%s\"",ParseXML_Encode_Safe_XML(limit));
 printf("%s>\n",(_type_==(XMLPARSE_TAG_START|XMLPARSE_TAG_END))?" /":"");
 return(0);
}


/*++++++++++++++++++++++++++++++++++++++
  The function that is called when the restrictionsType XSD type is seen

  int restrictionsType_function Returns 0 if no error occured or something else otherwise.

  const char *_tag_ Set to the name of the element tag that triggered this function call.

  int _type_ Set to XMLPARSE_TAG_START at the start of a tag and/or XMLPARSE_TAG_END at the end of a tag.
  ++++++++++++++++++++++++++++++++++++++*/

static int restrictionsType_function(const char *_tag_,int _type_)
{
 printf("<%s%s",(_type_==XMLPARSE_TAG_END)?"/":"",_tag_);
 printf("%s>\n",(_type_==(XMLPARSE_TAG_START|XMLPARSE_TAG_END))?" /":"");
 return(0);
}


/*++++++++++++++++++++++++++++++++++++++
  The function that is called when the profileType XSD type is seen

  int profileType_function Returns 0 if no error occured or something else otherwise.

  const char *_tag_ Set to the name of the element tag that triggered this function call.

  int _type_ Set to XMLPARSE_TAG_START at the start of a tag and/or XMLPARSE_TAG_END at the end of a tag.

  const char *name The contents of the 'name' attribute (or NULL if not defined).

  const char *transport The contents of the 'transport' attribute (or NULL if not defined).
  ++++++++++++++++++++++++++++++++++++++*/

static int profileType_function(const char *_tag_,int _type_,const char *name,const char *transport)
{
 printf("<%s%s",(_type_==XMLPARSE_TAG_END)?"/":"",_tag_);
 if(name) printf(" name=\"%s\"",ParseXML_Encode_Safe_XML(name));
 if(transport) printf(" transport=\"%s\"",ParseXML_Encode_Safe_XML(transport));
 printf("%s>\n",(_type_==(XMLPARSE_TAG_START|XMLPARSE_TAG_END))?" /":"");
 return(0);
}


/*++++++++++++++++++++++++++++++++++++++
  The function that is called when the RoutinoProfilesType XSD type is seen

  int RoutinoProfilesType_function Returns 0 if no error occured or something else otherwise.

  const char *_tag_ Set to the name of the element tag that triggered this function call.

  int _type_ Set to XMLPARSE_TAG_START at the start of a tag and/or XMLPARSE_TAG_END at the end of a tag.
  ++++++++++++++++++++++++++++++++++++++*/

static int RoutinoProfilesType_function(const char *_tag_,int _type_)
{
 printf("<%s%s",(_type_==XMLPARSE_TAG_END)?"/":"",_tag_);
 printf("%s>\n",(_type_==(XMLPARSE_TAG_START|XMLPARSE_TAG_END))?" /":"");
 return(0);
}


/*++++++++++++++++++++++++++++++++++++++
  The function that is called when the XML declaration is seen

  int xmlDeclaration_function Returns 0 if no error occured or something else otherwise.

  const char *_tag_ Set to the name of the element tag that triggered this function call.

  int _type_ Set to XMLPARSE_TAG_START at the start of a tag and/or XMLPARSE_TAG_END at the end of a tag.

  const char *version The contents of the 'version' attribute (or NULL if not defined).

  const char *encoding The contents of the 'encoding' attribute (or NULL if not defined).
  ++++++++++++++++++++++++++++++++++++++*/

static int xmlDeclaration_function(const char *_tag_,int _type_,const char *version,const char *encoding)
{
 printf("<?%s",_tag_);
 if(version) printf(" version=\"%s\"",ParseXML_Encode_Safe_XML(version));
 if(encoding) printf(" encoding=\"%s\"",ParseXML_Encode_Safe_XML(encoding));
 printf(" ?>\n");
 return(0);
}


/*++++++++++++++++++++++++++++++++++++++
  A skeleton XML parser.
  ++++++++++++++++++++++++++++++++++++++*/

int main(int argc,char **argv)
{
 if(ParseXML(stdin,xml_toplevel_tags,XMLPARSE_UNKNOWN_ATTR_WARN))
    return(1);
 else
    return(0);
}
