Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   Related Pages  

Document declaration

Document is declared by using aka2::doctype(const std::string &name, const L &) function. See the following example.

 struct foo {
  long value_;
 };
 struct foo_leaf : aka2::sequence<foo, foo_leaf> {
  void model() {
    member("value", &foo::value_);
  }
 };

int main() {
  aka2::initialize();
  // Users can use document "foo".
  aka2::doctype("foo", foo_leaf());

  //... code continues.
}

If the root type is aka2::any (xs:anyType), then use aka2::doctype(const std::string &name). Deserialized document is aka2::any.

int main() {
  aka2::initialize();
  // aka2::any (xs:anyType) document declaration.
  aka2::doctype("anyType_document");

  //... code continues.
}

If the root type is fixed simpleType value, then use aka2::doctype(const std::string &name, const L&, const std::string &fixed_value).

int main() {
  aka2::initialize();
  aka2::doctype("fixed_document", xiso::leaf<std::string>(), "fixed_value");
};


Generated on Sun Dec 19 22:58:57 2004 for akaxiso2 by doxygen1.2.18