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

# Namespace

Use aka2::xmlns() to register namespace. Here's an example to define a document type in "aka"(http://akaxiso.sourceforge.jp) namespace.

     struct foo {
      long value_;
     };

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

     int main() {
       aka2::initialize();
       aka2::xmlns("aka", "http://akaxiso.sourceforge.jp");
       aka2::doctype("aka:foo", foo_leaf());

       // ... code continues.
     }

By calling aka2::xmlns(), namespace prefix "aka" and namespace URI "http://akaxiso.sourceforge.jp" is associated.
The leaf class, foo_leaf, defines a qualified element by using qualified tag-name of "aka:value".
Document name is also qualified .