[xsd-users] dd xsd break IntelliSense?

Jeff Yu thinkmega at gmail.com
Wed Nov 21 10:17:43 EST 2007


I came to realize the generated proxy class from the xsd might have caused
Microsoft's IntelliSense stop working.

 

Here is the code fragment:

 

int _tmain(int argc, _TCHAR* argv[])

{

      ::Block1 b11;

      ::Block2 b12;

      

// IntelliSense is working fine.

      xml_schema::string idp = "ID";

 

// That's it.  It stops working!

      

      b11.id(idp);

      

      

      RTable t(b11, b12);

      

}

 

Is the structure of the xsd proxy class the cause of the break?

 

Any feedback would be appreciated.

 

Thanks.

-------------- next part --------------
// Copyright (C) 2005-2007 Code Synthesis Tools CC
//
// This program was generated by CodeSynthesis XSD, an XML Schema to
// C++ data binding compiler.
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
// published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
// In addition, as a special exception, Code Synthesis Tools CC gives
// permission to link this program with the Xerces-C++ library (or with
// modified versions of Xerces-C++ that use the same license as Xerces-C++),
// and distribute linked combinations including the two. You must obey
// the GNU General Public License version 2 in all respects for all of
// the code used other than Xerces-C++. If you modify this copy of the
// program, you may extend this exception to your version of the program,
// but you are not obligated to do so. If you do not wish to do so, delete
// this exception statement from your version.
//
// Furthermore, Code Synthesis Tools CC makes a special exception for
// the Free/Libre and Open Source Software (FLOSS) which is described
// in the accompanying FLOSSE file.
//

// Begin prologue.
//
//
// End prologue.
#include "stdafx.h"
#include <xsd/cxx/pre.hxx>

#include "RTable.hxx"

// RTable
// 

const RTable::Block1_type& RTable::
Block1 () const
{
  return this->Block1_.get ();
}

RTable::Block1_type& RTable::
Block1 ()
{
  return this->Block1_.get ();
}

void RTable::
Block1 (const Block1_type& Block1)
{
  this->Block1_.set (Block1);
}

void RTable::
Block1 (::std::auto_ptr< Block1_type > Block1)
{
  this->Block1_.set (Block1);
}

const RTable::Block2_type& RTable::
Block2 () const
{
  return this->Block2_.get ();
}

RTable::Block2_type& RTable::
Block2 ()
{
  return this->Block2_.get ();
}

void RTable::
Block2 (const Block2_type& Block2)
{
  this->Block2_.set (Block2);
}

void RTable::
Block2 (::std::auto_ptr< Block2_type > Block2)
{
  this->Block2_.set (Block2);
}


// Block1
// 

const Block1::kind_optional& Block1::
kind () const
{
  return this->kind_;
}

Block1::kind_optional& Block1::
kind ()
{
  return this->kind_;
}

void Block1::
kind (const kind_type& kind)
{
  this->kind_.set (kind);
}

void Block1::
kind (const kind_optional& kind)
{
  this->kind_ = kind;
}

void Block1::
kind (::std::auto_ptr< kind_type > kind)
{
  this->kind_.set (kind);
}

const Block1::id_optional& Block1::
id () const
{
  return this->id_;
}

Block1::id_optional& Block1::
id ()
{
  return this->id_;
}

void Block1::
id (const id_type& id)
{
  this->id_.set (id);
}

void Block1::
id (const id_optional& id)
{
  this->id_ = id;
}

void Block1::
id (::std::auto_ptr< id_type > id)
{
  this->id_.set (id);
}


// Block2
// 

const Block2::localhost_optional& Block2::
localhost () const
{
  return this->localhost_;
}

Block2::localhost_optional& Block2::
localhost ()
{
  return this->localhost_;
}

void Block2::
localhost (const localhost_type& localhost)
{
  this->localhost_.set (localhost);
}

void Block2::
localhost (const localhost_optional& localhost)
{
  this->localhost_ = localhost;
}

void Block2::
localhost (::std::auto_ptr< localhost_type > localhost)
{
  this->localhost_.set (localhost);
}

const Block2::ip_optional& Block2::
ip () const
{
  return this->ip_;
}

Block2::ip_optional& Block2::
ip ()
{
  return this->ip_;
}

void Block2::
ip (const ip_type& ip)
{
  this->ip_.set (ip);
}

void Block2::
ip (const ip_optional& ip)
{
  this->ip_ = ip;
}

void Block2::
ip (::std::auto_ptr< ip_type > ip)
{
  this->ip_.set (ip);
}


#include <xsd/cxx/xml/dom/parsing-source.hxx>

// RTable
//

RTable::
RTable (const Block1_type& Block1,
        const Block2_type& Block2)
: ::xml_schema::type (),
  Block1_ (Block1, ::xml_schema::flags (), this),
  Block2_ (Block2, ::xml_schema::flags (), this)
{
}

RTable::
RTable (const RTable& x,
        ::xml_schema::flags f,
        ::xml_schema::type* c)
: ::xml_schema::type (x, f, c),
  Block1_ (x.Block1_, f, this),
  Block2_ (x.Block2_, f, this)
{
}

RTable::
RTable (const ::xercesc::DOMElement& e,
        ::xml_schema::flags f,
        ::xml_schema::type* c)
: ::xml_schema::type (e, f | ::xml_schema::flags::base, c),
  Block1_ (f, this),
  Block2_ (f, this)
{
  if ((f & ::xml_schema::flags::base) == 0)
  {
    ::xsd::cxx::xml::dom::parser< char > p (e);
    this->parse (p, f);
  }
}

void RTable::
parse (::xsd::cxx::xml::dom::parser< char >& p,
       ::xml_schema::flags f)
{
  for (; p.more_elements (); p.next_element ())
  {
    const ::xercesc::DOMElement& i (p.cur_element ());
    const ::xsd::cxx::xml::qualified_name< char > n (
      ::xsd::cxx::xml::dom::name< char > (i));

    // Block1
    //
    if (n.name () == "Block1" && n.namespace_ ().empty ())
    {
      ::std::auto_ptr< Block1_type > r (
        Block1_traits::create (i, f, this));

      if (!Block1_.present ())
      {
        this->Block1 (r);
        continue;
      }
    }

    // Block2
    //
    if (n.name () == "Block2" && n.namespace_ ().empty ())
    {
      ::std::auto_ptr< Block2_type > r (
        Block2_traits::create (i, f, this));

      if (!Block2_.present ())
      {
        this->Block2 (r);
        continue;
      }
    }

    break;
  }

  if (!Block1_.present ())
  {
    throw ::xsd::cxx::tree::expected_element< char > (
      "Block1",
      "");
  }

  if (!Block2_.present ())
  {
    throw ::xsd::cxx::tree::expected_element< char > (
      "Block2",
      "");
  }
}

RTable* RTable::
_clone (::xml_schema::flags f,
        ::xml_schema::type* c) const
{
  return new RTable (*this, f, c);
}

// Block1
//

Block1::
Block1 ()
: ::xml_schema::type (),
  kind_ (::xml_schema::flags (), this),
  id_ (::xml_schema::flags (), this)
{
}

Block1::
Block1 (const Block1& x,
        ::xml_schema::flags f,
        ::xml_schema::type* c)
: ::xml_schema::type (x, f, c),
  kind_ (x.kind_, f, this),
  id_ (x.id_, f, this)
{
}

Block1::
Block1 (const ::xercesc::DOMElement& e,
        ::xml_schema::flags f,
        ::xml_schema::type* c)
: ::xml_schema::type (e, f | ::xml_schema::flags::base, c),
  kind_ (f, this),
  id_ (f, this)
{
  if ((f & ::xml_schema::flags::base) == 0)
  {
    ::xsd::cxx::xml::dom::parser< char > p (e);
    this->parse (p, f);
  }
}

void Block1::
parse (::xsd::cxx::xml::dom::parser< char >& p,
       ::xml_schema::flags f)
{
  while (p.more_attributes ())
  {
    const ::xercesc::DOMAttr& i (p.next_attribute ());
    const ::xsd::cxx::xml::qualified_name< char > n (
      ::xsd::cxx::xml::dom::name< char > (i));

    if (n.name () == "kind" && n.namespace_ ().empty ())
    {
      ::std::auto_ptr< kind_type > r (
        kind_traits::create (i, f, this));

      this->kind (r);
      continue;
    }

    if (n.name () == "id" && n.namespace_ ().empty ())
    {
      ::std::auto_ptr< id_type > r (
        id_traits::create (i, f, this));

      this->id (r);
      continue;
    }
  }
}

Block1* Block1::
_clone (::xml_schema::flags f,
        ::xml_schema::type* c) const
{
  return new Block1 (*this, f, c);
}

// Block2
//

Block2::
Block2 ()
: ::xml_schema::type (),
  localhost_ (::xml_schema::flags (), this),
  ip_ (::xml_schema::flags (), this)
{
}

Block2::
Block2 (const Block2& x,
        ::xml_schema::flags f,
        ::xml_schema::type* c)
: ::xml_schema::type (x, f, c),
  localhost_ (x.localhost_, f, this),
  ip_ (x.ip_, f, this)
{
}

Block2::
Block2 (const ::xercesc::DOMElement& e,
        ::xml_schema::flags f,
        ::xml_schema::type* c)
: ::xml_schema::type (e, f | ::xml_schema::flags::base, c),
  localhost_ (f, this),
  ip_ (f, this)
{
  if ((f & ::xml_schema::flags::base) == 0)
  {
    ::xsd::cxx::xml::dom::parser< char > p (e);
    this->parse (p, f);
  }
}

void Block2::
parse (::xsd::cxx::xml::dom::parser< char >& p,
       ::xml_schema::flags f)
{
  while (p.more_attributes ())
  {
    const ::xercesc::DOMAttr& i (p.next_attribute ());
    const ::xsd::cxx::xml::qualified_name< char > n (
      ::xsd::cxx::xml::dom::name< char > (i));

    if (n.name () == "localhost" && n.namespace_ ().empty ())
    {
      ::std::auto_ptr< localhost_type > r (
        localhost_traits::create (i, f, this));

      this->localhost (r);
      continue;
    }

    if (n.name () == "ip" && n.namespace_ ().empty ())
    {
      ::std::auto_ptr< ip_type > r (
        ip_traits::create (i, f, this));

      this->ip (r);
      continue;
    }
  }
}

Block2* Block2::
_clone (::xml_schema::flags f,
        ::xml_schema::type* c) const
{
  return new Block2 (*this, f, c);
}

#include <istream>
#include <xercesc/framework/Wrapper4InputSource.hpp>
#include <xsd/cxx/xml/sax/std-input-source.hxx>
#include <xsd/cxx/tree/error-handler.hxx>

::std::auto_ptr< ::RTable >
RTable_ (const ::std::string& u,
         ::xml_schema::flags f,
         const ::xml_schema::properties& p)
{
  ::xsd::cxx::xml::auto_initializer i (
    (f & ::xml_schema::flags::dont_initialize) == 0,
    (f & ::xml_schema::flags::keep_dom) == 0);

  ::xsd::cxx::tree::error_handler< char > h;

  ::xsd::cxx::xml::dom::auto_ptr< ::xercesc::DOMDocument > d (
    ::xsd::cxx::xml::dom::parse< char > (u, h, p, f));

  h.throw_if_failed< ::xsd::cxx::tree::parsing< char > > ();

  ::std::auto_ptr< ::RTable > r (
    ::RTable_ (
      d.get (), f | ::xml_schema::flags::own_dom, p));

  if (f & ::xml_schema::flags::keep_dom)
    d.release ();

  return r;
}

::std::auto_ptr< ::RTable >
RTable_ (const ::std::string& u,
         ::xml_schema::error_handler& h,
         ::xml_schema::flags f,
         const ::xml_schema::properties& p)
{
  ::xsd::cxx::xml::auto_initializer i (
    (f & ::xml_schema::flags::dont_initialize) == 0,
    (f & ::xml_schema::flags::keep_dom) == 0);

  ::xsd::cxx::xml::dom::auto_ptr< ::xercesc::DOMDocument > d (
    ::xsd::cxx::xml::dom::parse< char > (u, h, p, f));

  if (!d)
    throw ::xsd::cxx::tree::parsing< char > ();

  ::std::auto_ptr< ::RTable > r (
    ::RTable_ (
      d.get (), f | ::xml_schema::flags::own_dom, p));

  if (f & ::xml_schema::flags::keep_dom)
    d.release ();

  return r;
}

::std::auto_ptr< ::RTable >
RTable_ (const ::std::string& u,
         ::xercesc::DOMErrorHandler& h,
         ::xml_schema::flags f,
         const ::xml_schema::properties& p)
{
  ::xsd::cxx::xml::dom::auto_ptr< ::xercesc::DOMDocument > d (
    ::xsd::cxx::xml::dom::parse< char > (u, h, p, f));

  if (!d)
    throw ::xsd::cxx::tree::parsing< char > ();

  ::std::auto_ptr< ::RTable > r (
    ::RTable_ (
      d.get (), f | ::xml_schema::flags::own_dom, p));

  if (f & ::xml_schema::flags::keep_dom)
    d.release ();

  return r;
}

::std::auto_ptr< ::RTable >
RTable_ (::std::istream& is,
         ::xml_schema::flags f,
         const ::xml_schema::properties& p)
{
  ::xsd::cxx::xml::auto_initializer i (
    (f & ::xml_schema::flags::dont_initialize) == 0,
    (f & ::xml_schema::flags::keep_dom) == 0);

  ::xsd::cxx::xml::sax::std_input_source isrc (is);
  ::xercesc::Wrapper4InputSource wrap (&isrc, false);
  return ::RTable_ (wrap, f, p);
}

::std::auto_ptr< ::RTable >
RTable_ (::std::istream& is,
         ::xml_schema::error_handler& h,
         ::xml_schema::flags f,
         const ::xml_schema::properties& p)
{
  ::xsd::cxx::xml::auto_initializer i (
    (f & ::xml_schema::flags::dont_initialize) == 0,
    (f & ::xml_schema::flags::keep_dom) == 0);

  ::xsd::cxx::xml::sax::std_input_source isrc (is);
  ::xercesc::Wrapper4InputSource wrap (&isrc, false);
  return ::RTable_ (wrap, h, f, p);
}

::std::auto_ptr< ::RTable >
RTable_ (::std::istream& is,
         ::xercesc::DOMErrorHandler& h,
         ::xml_schema::flags f,
         const ::xml_schema::properties& p)
{
  ::xsd::cxx::xml::sax::std_input_source isrc (is);
  ::xercesc::Wrapper4InputSource wrap (&isrc, false);
  return ::RTable_ (wrap, h, f, p);
}

::std::auto_ptr< ::RTable >
RTable_ (::std::istream& is,
         const ::std::string& sid,
         ::xml_schema::flags f,
         const ::xml_schema::properties& p)
{
  ::xsd::cxx::xml::auto_initializer i (
    (f & ::xml_schema::flags::dont_initialize) == 0,
    (f & ::xml_schema::flags::keep_dom) == 0);

  ::xsd::cxx::xml::sax::std_input_source isrc (is, sid);
  ::xercesc::Wrapper4InputSource wrap (&isrc, false);
  return ::RTable_ (wrap, f, p);
}

::std::auto_ptr< ::RTable >
RTable_ (::std::istream& is,
         const ::std::string& sid,
         ::xml_schema::error_handler& h,
         ::xml_schema::flags f,
         const ::xml_schema::properties& p)
{
  ::xsd::cxx::xml::auto_initializer i (
    (f & ::xml_schema::flags::dont_initialize) == 0,
    (f & ::xml_schema::flags::keep_dom) == 0);

  ::xsd::cxx::xml::sax::std_input_source isrc (is, sid);
  ::xercesc::Wrapper4InputSource wrap (&isrc, false);
  return ::RTable_ (wrap, h, f, p);
}

::std::auto_ptr< ::RTable >
RTable_ (::std::istream& is,
         const ::std::string& sid,
         ::xercesc::DOMErrorHandler& h,
         ::xml_schema::flags f,
         const ::xml_schema::properties& p)
{
  ::xsd::cxx::xml::sax::std_input_source isrc (is, sid);
  ::xercesc::Wrapper4InputSource wrap (&isrc, false);
  return ::RTable_ (wrap, h, f, p);
}

::std::auto_ptr< ::RTable >
RTable_ (const ::xercesc::DOMInputSource& i,
         ::xml_schema::flags f,
         const ::xml_schema::properties& p)
{
  ::xsd::cxx::tree::error_handler< char > h;

  ::xsd::cxx::xml::dom::auto_ptr< ::xercesc::DOMDocument > d (
    ::xsd::cxx::xml::dom::parse< char > (i, h, p, f));

  h.throw_if_failed< ::xsd::cxx::tree::parsing< char > > ();

  ::std::auto_ptr< ::RTable > r (
    ::RTable_ (
      d.get (), f | ::xml_schema::flags::own_dom, p));

  if (f & ::xml_schema::flags::keep_dom)
    d.release ();

  return r;
}

::std::auto_ptr< ::RTable >
RTable_ (const ::xercesc::DOMInputSource& i,
         ::xml_schema::error_handler& h,
         ::xml_schema::flags f,
         const ::xml_schema::properties& p)
{
  ::xsd::cxx::xml::dom::auto_ptr< ::xercesc::DOMDocument > d (
    ::xsd::cxx::xml::dom::parse< char > (i, h, p, f));

  if (!d)
    throw ::xsd::cxx::tree::parsing< char > ();

  ::std::auto_ptr< ::RTable > r (
    ::RTable_ (
      d.get (), f | ::xml_schema::flags::own_dom, p));

  if (f & ::xml_schema::flags::keep_dom)
    d.release ();

  return r;
}

::std::auto_ptr< ::RTable >
RTable_ (const ::xercesc::DOMInputSource& i,
         ::xercesc::DOMErrorHandler& h,
         ::xml_schema::flags f,
         const ::xml_schema::properties& p)
{
  ::xsd::cxx::xml::dom::auto_ptr< ::xercesc::DOMDocument > d (
    ::xsd::cxx::xml::dom::parse< char > (i, h, p, f));

  if (!d)
    throw ::xsd::cxx::tree::parsing< char > ();

  ::std::auto_ptr< ::RTable > r (
    ::RTable_ (
      d.get (), f | ::xml_schema::flags::own_dom, p));

  if (f & ::xml_schema::flags::keep_dom)
    d.release ();

  return r;
}

::std::auto_ptr< ::RTable >
RTable_ (const ::xercesc::DOMDocument& d,
         ::xml_schema::flags f,
         const ::xml_schema::properties& p)
{
  if (f & ::xml_schema::flags::keep_dom)
  {
    ::xsd::cxx::xml::dom::auto_ptr< ::xercesc::DOMDocument > c (
      static_cast< ::xercesc::DOMDocument* > (d.cloneNode (true)));

    ::std::auto_ptr< ::RTable > r (
      ::RTable_ (
        c.get (), f | ::xml_schema::flags::own_dom, p));

    c.release ();
    return r;
  }

  const ::xercesc::DOMElement& e (*d.getDocumentElement ());
  const ::xsd::cxx::xml::qualified_name< char > n (
    ::xsd::cxx::xml::dom::name< char > (e));

  if (n.name () == "RTable" &&
      n.namespace_ () == "")
  {
    ::std::auto_ptr< ::RTable > r (
      ::xsd::cxx::tree::traits< ::RTable, char >::create (
        e, f, 0));
    return r;
  }

  throw ::xsd::cxx::tree::unexpected_element < char > (
    n.name (),
    n.namespace_ (),
    "RTable",
    "");
}

::std::auto_ptr< ::RTable >
RTable_ (::xercesc::DOMDocument* d,
         ::xml_schema::flags f,
         const ::xml_schema::properties&)
{
  ::xsd::cxx::xml::dom::auto_ptr< ::xercesc::DOMDocument > c (
    ((f & ::xml_schema::flags::keep_dom) &&
     !(f & ::xml_schema::flags::own_dom))
    ? static_cast< ::xercesc::DOMDocument* > (d->cloneNode (true))
    : 0);

  const ::xercesc::DOMElement& e (
    c.get ()
    ? *c->getDocumentElement ()
    : *d->getDocumentElement ());
  const ::xsd::cxx::xml::qualified_name< char > n (
    ::xsd::cxx::xml::dom::name< char > (e));

  if (n.name () == "RTable" &&
      n.namespace_ () == "")
  {
    ::std::auto_ptr< ::RTable > r (
      ::xsd::cxx::tree::traits< ::RTable, char >::create (
        e, f, 0));
    c.release ();
    return r;
  }

  throw ::xsd::cxx::tree::unexpected_element < char > (
    n.name (),
    n.namespace_ (),
    "RTable",
    "");
}

#include <ostream>
#include <xsd/cxx/xml/dom/serialization-source.hxx>
#include <xsd/cxx/tree/error-handler.hxx>

void
RTable_ (::std::ostream& o,
         const ::RTable& s,
         const ::xml_schema::namespace_infomap& m,
         const ::std::string& e,
         ::xml_schema::flags f)
{
  ::xsd::cxx::xml::auto_initializer i (
    (f & ::xml_schema::flags::dont_initialize) == 0);

  ::xsd::cxx::xml::dom::auto_ptr< ::xercesc::DOMDocument > d (
    ::RTable_ (s, m, f));

  ::xsd::cxx::tree::error_handler< char > h;

  ::xsd::cxx::xml::dom::ostream_format_target t (o);
  if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f))
  {
    h.throw_if_failed< ::xsd::cxx::tree::serialization< char > > ();
  }
}

void
RTable_ (::std::ostream& o,
         const ::RTable& s,
         const ::xml_schema::namespace_infomap& m,
         ::xml_schema::error_handler& h,
         const ::std::string& e,
         ::xml_schema::flags f)
{
  ::xsd::cxx::xml::auto_initializer i (
    (f & ::xml_schema::flags::dont_initialize) == 0);

  ::xsd::cxx::xml::dom::auto_ptr< ::xercesc::DOMDocument > d (
    ::RTable_ (s, m, f));
  ::xsd::cxx::xml::dom::ostream_format_target t (o);
  if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f))
  {
    throw ::xsd::cxx::tree::serialization< char > ();
  }
}

void
RTable_ (::std::ostream& o,
         const ::RTable& s,
         const ::xml_schema::namespace_infomap& m,
         ::xercesc::DOMErrorHandler& h,
         const ::std::string& e,
         ::xml_schema::flags f)
{
  ::xsd::cxx::xml::dom::auto_ptr< ::xercesc::DOMDocument > d (
    ::RTable_ (s, m, f));
  ::xsd::cxx::xml::dom::ostream_format_target t (o);
  if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f))
  {
    throw ::xsd::cxx::tree::serialization< char > ();
  }
}

void
RTable_ (::xercesc::XMLFormatTarget& t,
         const ::RTable& s,
         const ::xml_schema::namespace_infomap& m,
         const ::std::string& e,
         ::xml_schema::flags f)
{
  ::xsd::cxx::xml::dom::auto_ptr< ::xercesc::DOMDocument > d (
    ::RTable_ (s, m, f));

  ::xsd::cxx::tree::error_handler< char > h;

  if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f))
  {
    h.throw_if_failed< ::xsd::cxx::tree::serialization< char > > ();
  }
}

void
RTable_ (::xercesc::XMLFormatTarget& t,
         const ::RTable& s,
         const ::xml_schema::namespace_infomap& m,
         ::xml_schema::error_handler& h,
         const ::std::string& e,
         ::xml_schema::flags f)
{
  ::xsd::cxx::xml::dom::auto_ptr< ::xercesc::DOMDocument > d (
    ::RTable_ (s, m, f));
  if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f))
  {
    throw ::xsd::cxx::tree::serialization< char > ();
  }
}

void
RTable_ (::xercesc::XMLFormatTarget& t,
         const ::RTable& s,
         const ::xml_schema::namespace_infomap& m,
         ::xercesc::DOMErrorHandler& h,
         const ::std::string& e,
         ::xml_schema::flags f)
{
  ::xsd::cxx::xml::dom::auto_ptr< ::xercesc::DOMDocument > d (
    ::RTable_ (s, m, f));
  if (!::xsd::cxx::xml::dom::serialize (t, *d, e, h, f))
  {
    throw ::xsd::cxx::tree::serialization< char > ();
  }
}

void
RTable_ (::xercesc::DOMDocument& d,
         const ::RTable& s,
         ::xml_schema::flags)
{
  ::xercesc::DOMElement& e (*d.getDocumentElement ());
  const ::xsd::cxx::xml::qualified_name< char > n (
    ::xsd::cxx::xml::dom::name< char > (e));

  if (n.name () == "RTable" &&
      n.namespace_ () == "")
  {
    e << s;
  }
  else
  {
    throw ::xsd::cxx::tree::unexpected_element < char > (
      n.name (),
      n.namespace_ (),
      "RTable",
      "");
  }
}

::xsd::cxx::xml::dom::auto_ptr< ::xercesc::DOMDocument >
RTable_ (const ::RTable& s,
         const ::xml_schema::namespace_infomap& m,
         ::xml_schema::flags f)
{
  try
  {
    ::xsd::cxx::xml::dom::auto_ptr< ::xercesc::DOMDocument > d (
      ::xsd::cxx::xml::dom::serialize< char > (
        "RTable",
        "",
        m, f));

    ::RTable_ (*d, s, f);
    return d;
  }
  catch (const ::xsd::cxx::xml::dom::mapping< char >& e)
  {
    throw ::xsd::cxx::tree::no_namespace_mapping< char > (e.name ());
  }
  catch (const ::xsd::cxx::xml::dom::xsi_already_in_use&)
  {
    throw ::xsd::cxx::tree::xsi_already_in_use< char > ();
  }
}

void
operator<< (::xercesc::DOMElement& e, const RTable& i)
{
  e << static_cast< const ::xml_schema::type& > (i);

  // Block1
  //
  {
    ::xercesc::DOMElement& s (
      ::xsd::cxx::xml::dom::create_element (
        "Block1",
        e));

    s << i.Block1 ();
  }

  // Block2
  //
  {
    ::xercesc::DOMElement& s (
      ::xsd::cxx::xml::dom::create_element (
        "Block2",
        e));

    s << i.Block2 ();
  }
}

void
operator<< (::xercesc::DOMElement& e, const Block1& i)
{
  e << static_cast< const ::xml_schema::type& > (i);

  // kind
  //
  if (i.kind ())
  {
    ::xercesc::DOMAttr& a (
      ::xsd::cxx::xml::dom::create_attribute (
        "kind",
        e));

    a << *i.kind ();
  }

  // id
  //
  if (i.id ())
  {
    ::xercesc::DOMAttr& a (
      ::xsd::cxx::xml::dom::create_attribute (
        "id",
        e));

    a << *i.id ();
  }
}

void
operator<< (::xercesc::DOMElement& e, const Block2& i)
{
  e << static_cast< const ::xml_schema::type& > (i);

  // localhost
  //
  if (i.localhost ())
  {
    ::xercesc::DOMAttr& a (
      ::xsd::cxx::xml::dom::create_attribute (
        "localhost",
        e));

    a << *i.localhost ();
  }

  // ip
  //
  if (i.ip ())
  {
    ::xercesc::DOMAttr& a (
      ::xsd::cxx::xml::dom::create_attribute (
        "ip",
        e));

    a << *i.ip ();
  }
}

#include <xsd/cxx/post.hxx>

// Begin epilogue.
//
//
// End epilogue.

-------------- next part --------------
// Copyright (C) 2005-2007 Code Synthesis Tools CC
//
// This program was generated by CodeSynthesis XSD, an XML Schema to
// C++ data binding compiler.
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
// published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
// In addition, as a special exception, Code Synthesis Tools CC gives
// permission to link this program with the Xerces-C++ library (or with
// modified versions of Xerces-C++ that use the same license as Xerces-C++),
// and distribute linked combinations including the two. You must obey
// the GNU General Public License version 2 in all respects for all of
// the code used other than Xerces-C++. If you modify this copy of the
// program, you may extend this exception to your version of the program,
// but you are not obligated to do so. If you do not wish to do so, delete
// this exception statement from your version.
//
// Furthermore, Code Synthesis Tools CC makes a special exception for
// the Free/Libre and Open Source Software (FLOSS) which is described
// in the accompanying FLOSSE file.
//

#ifndef RTABLE_HXX
#define RTABLE_HXX

// Begin prologue.
//
//
// End prologue.

#include <xsd/cxx/version.hxx>

#if (XSD_INT_VERSION != 3000000L)
#error XSD runtime version mismatch
#endif

#include <xsd/cxx/pre.hxx>

#ifndef XSD_USE_CHAR
#define XSD_USE_CHAR
#endif

#ifndef XSD_CXX_TREE_USE_CHAR
#define XSD_CXX_TREE_USE_CHAR
#endif

#include <xsd/cxx/tree/exceptions.hxx>
#include <xsd/cxx/tree/elements.hxx>
#include <xsd/cxx/tree/types.hxx>

#include <xsd/cxx/xml/error-handler.hxx>

#include <xsd/cxx/tree/parsing.hxx>

#include <xsd/cxx/tree/serialization.hxx>
#include <xsd/cxx/xml/dom/serialization-header.hxx>

namespace xml_schema
{
  // anyType and anySimpleType.
  //
  typedef ::xsd::cxx::tree::type type;
  typedef ::xsd::cxx::tree::simple_type<type> simple_type;

  // 8-bit
  //
  typedef signed char byte;
  typedef unsigned char unsigned_byte;

  // 16-bit
  //
  typedef short short_;
  typedef unsigned short unsigned_short;

  // 32-bit
  //
  typedef int int_;
  typedef unsigned int unsigned_int;

  // 64-bit
  //
  typedef long long long_;
  typedef unsigned long long unsigned_long;

  // Supposed to be arbitrary-length integral types.
  //
  typedef long long integer;
  typedef integer non_positive_integer;
  typedef integer non_negative_integer;
  typedef integer positive_integer;
  typedef integer negative_integer;

  // Boolean.
  //
  typedef bool boolean;

  // Floating-point types.
  //
  typedef float float_;
  typedef double double_;
  typedef double decimal;

  // String types.
  //
  typedef ::xsd::cxx::tree::string< char, simple_type > string;
  typedef ::xsd::cxx::tree::normalized_string< char, string > normalized_string;
  typedef ::xsd::cxx::tree::token< char, normalized_string > token;
  typedef ::xsd::cxx::tree::name< char, token > name;
  typedef ::xsd::cxx::tree::nmtoken< char, token > nmtoken;
  typedef ::xsd::cxx::tree::nmtokens< char, simple_type, nmtoken> nmtokens;
  typedef ::xsd::cxx::tree::ncname< char, name > ncname;
  typedef ::xsd::cxx::tree::language< char, token > language;

  // ID/IDREF.
  //
  typedef ::xsd::cxx::tree::id< char, ncname > id;
  typedef ::xsd::cxx::tree::idref< type, char, ncname > idref;
  typedef ::xsd::cxx::tree::idrefs< char, simple_type, idref > idrefs;

  // URI.
  //
  typedef ::xsd::cxx::tree::uri< char, simple_type > uri;

  // Qualified name.
  //
  typedef ::xsd::cxx::tree::qname< char, simple_type, uri, ncname > qname;

  // Binary.
  //
  typedef ::xsd::cxx::tree::buffer< char > buffer;
  typedef ::xsd::cxx::tree::base64_binary< char, simple_type > base64_binary;
  typedef ::xsd::cxx::tree::hex_binary< char, simple_type > hex_binary;

  // Date/time.
  //
  typedef ::xsd::cxx::tree::date< char, simple_type > date;
  typedef ::xsd::cxx::tree::date_time< char, simple_type > date_time;
  typedef ::xsd::cxx::tree::duration< char, simple_type > duration;
  typedef ::xsd::cxx::tree::day< char, simple_type > day;
  typedef ::xsd::cxx::tree::month< char, simple_type > month;
  typedef ::xsd::cxx::tree::month_day< char, simple_type > month_day;
  typedef ::xsd::cxx::tree::year< char, simple_type > year;
  typedef ::xsd::cxx::tree::year_month< char, simple_type > year_month;
  typedef ::xsd::cxx::tree::time< char, simple_type > time;

  // Entity.
  //
  typedef ::xsd::cxx::tree::entity< char, ncname > entity;
  typedef ::xsd::cxx::tree::entities< char, simple_type, entity > entities;

  // Namespace information. Used in serialization functions.
  //
  typedef ::xsd::cxx::xml::dom::namespace_info < char > namespace_info;
  typedef ::xsd::cxx::xml::dom::namespace_infomap < char > namespace_infomap;

  // Flags and properties.
  //
  typedef ::xsd::cxx::tree::flags flags;
  typedef ::xsd::cxx::tree::properties< char > properties;

  // DOM user data key for back pointers to tree nodes.
  //
#ifndef XSD_CXX_TREE_TREE_NODE_KEY_IN___XML_SCHEMA
#define XSD_CXX_TREE_TREE_NODE_KEY_IN___XML_SCHEMA

  const XMLCh* const tree_node_key = ::xsd::cxx::tree::user_data_keys::node;

#endif

  // Exceptions.
  //
  typedef ::xsd::cxx::tree::exception< char > exception;
  typedef ::xsd::cxx::tree::parsing< char > parsing;
  typedef ::xsd::cxx::tree::expected_element< char > expected_element;
  typedef ::xsd::cxx::tree::unexpected_element< char > unexpected_element;
  typedef ::xsd::cxx::tree::expected_attribute< char > expected_attribute;
  typedef ::xsd::cxx::tree::unexpected_enumerator< char > unexpected_enumerator;
  typedef ::xsd::cxx::tree::expected_text_content< char > expected_text_content;
  typedef ::xsd::cxx::tree::no_type_info< char > no_type_info;
  typedef ::xsd::cxx::tree::not_derived< char > not_derived;
  typedef ::xsd::cxx::tree::duplicate_id< char > duplicate_id;
  typedef ::xsd::cxx::tree::serialization< char > serialization;
  typedef ::xsd::cxx::tree::no_namespace_mapping< char > no_namespace_mapping;
  typedef ::xsd::cxx::tree::no_prefix_mapping< char > no_prefix_mapping;
  typedef ::xsd::cxx::tree::xsi_already_in_use< char > xsi_already_in_use;
  typedef ::xsd::cxx::tree::bounds< char > bounds;

  // Parsing/serialization diagnostics.
  //
  typedef ::xsd::cxx::tree::severity severity;
  typedef ::xsd::cxx::tree::error< char > error;
  typedef ::xsd::cxx::tree::diagnostics< char > diagnostics;

  // Error handler interface.
  //
  typedef ::xsd::cxx::xml::error_handler< char > error_handler;
}

// Forward declarations.
//
class RTable;
class Block1;
class Block2;

#include <memory>    // std::auto_ptr
#include <algorithm> // std::binary_search

#include <xsd/cxx/tree/exceptions.hxx>
#include <xsd/cxx/tree/elements.hxx>
#include <xsd/cxx/tree/containers.hxx>
#include <xsd/cxx/tree/list.hxx>

#include <xsd/cxx/xml/dom/parsing-header.hxx>

class RTable: public ::xml_schema::type
{
  public:
  // Block1
  // 
  typedef ::Block1 Block1_type;
  typedef ::xsd::cxx::tree::traits< Block1_type, char > Block1_traits;

  const Block1_type&
  Block1 () const;

  Block1_type&
  Block1 ();

  void
  Block1 (const Block1_type& x);

  void
  Block1 (::std::auto_ptr< Block1_type > p);

  // Block2
  // 
  typedef ::Block2 Block2_type;
  typedef ::xsd::cxx::tree::traits< Block2_type, char > Block2_traits;

  const Block2_type&
  Block2 () const;

  Block2_type&
  Block2 ();

  void
  Block2 (const Block2_type& x);

  void
  Block2 (::std::auto_ptr< Block2_type > p);

  // Constructors.
  //
  RTable (const Block1_type&,
          const Block2_type&);

  RTable (const ::xercesc::DOMElement& e,
          ::xml_schema::flags f = 0,
          ::xml_schema::type* c = 0);

  RTable (const RTable& x,
          ::xml_schema::flags f = 0,
          ::xml_schema::type* c = 0);

  virtual RTable*
  _clone (::xml_schema::flags f = 0,
          ::xml_schema::type* c = 0) const;

  // Implementation.
  //
  protected:
  void
  parse (::xsd::cxx::xml::dom::parser< char >&,
         ::xml_schema::flags);

  private:
  ::xsd::cxx::tree::one< Block1_type > Block1_;
  ::xsd::cxx::tree::one< Block2_type > Block2_;
};

class Block1: public ::xml_schema::type
{
  public:
  // kind
  // 
  typedef ::xml_schema::string kind_type;
  typedef ::xsd::cxx::tree::optional< kind_type > kind_optional;
  typedef ::xsd::cxx::tree::traits< kind_type, char > kind_traits;

  const kind_optional&
  kind () const;

  kind_optional&
  kind ();

  void
  kind (const kind_type& x);

  void
  kind (const kind_optional& x);

  void
  kind (::std::auto_ptr< kind_type > p);

  // id
  // 
  typedef ::xml_schema::string id_type;
  typedef ::xsd::cxx::tree::optional< id_type > id_optional;
  typedef ::xsd::cxx::tree::traits< id_type, char > id_traits;

  const id_optional&
  id () const;

  id_optional&
  id ();

  void
  id (const id_type& x);

  void
  id (const id_optional& x);

  void
  id (::std::auto_ptr< id_type > p);

  // Constructors.
  //
  Block1 ();

  Block1 (const ::xercesc::DOMElement& e,
          ::xml_schema::flags f = 0,
          ::xml_schema::type* c = 0);

  Block1 (const Block1& x,
          ::xml_schema::flags f = 0,
          ::xml_schema::type* c = 0);

  virtual Block1*
  _clone (::xml_schema::flags f = 0,
          ::xml_schema::type* c = 0) const;

  // Implementation.
  //
  protected:
  void
  parse (::xsd::cxx::xml::dom::parser< char >&,
         ::xml_schema::flags);

  private:
  kind_optional kind_;
  id_optional id_;
};

class Block2: public ::xml_schema::type
{
  public:
  // localhost
  // 
  typedef ::xml_schema::string localhost_type;
  typedef ::xsd::cxx::tree::optional< localhost_type > localhost_optional;
  typedef ::xsd::cxx::tree::traits< localhost_type, char > localhost_traits;

  const localhost_optional&
  localhost () const;

  localhost_optional&
  localhost ();

  void
  localhost (const localhost_type& x);

  void
  localhost (const localhost_optional& x);

  void
  localhost (::std::auto_ptr< localhost_type > p);

  // ip
  // 
  typedef ::xml_schema::string ip_type;
  typedef ::xsd::cxx::tree::optional< ip_type > ip_optional;
  typedef ::xsd::cxx::tree::traits< ip_type, char > ip_traits;

  const ip_optional&
  ip () const;

  ip_optional&
  ip ();

  void
  ip (const ip_type& x);

  void
  ip (const ip_optional& x);

  void
  ip (::std::auto_ptr< ip_type > p);

  // Constructors.
  //
  Block2 ();

  Block2 (const ::xercesc::DOMElement& e,
          ::xml_schema::flags f = 0,
          ::xml_schema::type* c = 0);

  Block2 (const Block2& x,
          ::xml_schema::flags f = 0,
          ::xml_schema::type* c = 0);

  virtual Block2*
  _clone (::xml_schema::flags f = 0,
          ::xml_schema::type* c = 0) const;

  // Implementation.
  //
  protected:
  void
  parse (::xsd::cxx::xml::dom::parser< char >&,
         ::xml_schema::flags);

  private:
  localhost_optional localhost_;
  ip_optional ip_;
};

#include <iosfwd>

#include <xercesc/dom/DOMDocument.hpp>
#include <xercesc/dom/DOMInputSource.hpp>
#include <xercesc/dom/DOMErrorHandler.hpp>

// Parse a URI or a local file.
//

::std::auto_ptr< ::RTable >
RTable_ (const ::std::string& uri,
         ::xml_schema::flags f = 0,
         const ::xml_schema::properties& p = ::xml_schema::properties ());

::std::auto_ptr< ::RTable >
RTable_ (const ::std::string& uri,
         ::xml_schema::error_handler& eh,
         ::xml_schema::flags f = 0,
         const ::xml_schema::properties& p = ::xml_schema::properties ());

::std::auto_ptr< ::RTable >
RTable_ (const ::std::string& uri,
         ::xercesc::DOMErrorHandler& eh,
         ::xml_schema::flags f = 0,
         const ::xml_schema::properties& p = ::xml_schema::properties ());

// Parse std::istream.
//

::std::auto_ptr< ::RTable >
RTable_ (::std::istream& is,
         ::xml_schema::flags f = 0,
         const ::xml_schema::properties& p = ::xml_schema::properties ());

::std::auto_ptr< ::RTable >
RTable_ (::std::istream& is,
         ::xml_schema::error_handler& eh,
         ::xml_schema::flags f = 0,
         const ::xml_schema::properties& p = ::xml_schema::properties ());

::std::auto_ptr< ::RTable >
RTable_ (::std::istream& is,
         ::xercesc::DOMErrorHandler& eh,
         ::xml_schema::flags f = 0,
         const ::xml_schema::properties& p = ::xml_schema::properties ());

::std::auto_ptr< ::RTable >
RTable_ (::std::istream& is,
         const ::std::string& id,
         ::xml_schema::flags f = 0,
         const ::xml_schema::properties& p = ::xml_schema::properties ());

::std::auto_ptr< ::RTable >
RTable_ (::std::istream& is,
         const ::std::string& id,
         ::xml_schema::error_handler& eh,
         ::xml_schema::flags f = 0,
         const ::xml_schema::properties& p = ::xml_schema::properties ());

::std::auto_ptr< ::RTable >
RTable_ (::std::istream& is,
         const ::std::string& id,
         ::xercesc::DOMErrorHandler& eh,
         ::xml_schema::flags f = 0,
         const ::xml_schema::properties& p = ::xml_schema::properties ());

// Parse xercesc::DOMInputSource.
//

::std::auto_ptr< ::RTable >
RTable_ (const ::xercesc::DOMInputSource& is,
         ::xml_schema::flags f = 0,
         const ::xml_schema::properties& p = ::xml_schema::properties ());

::std::auto_ptr< ::RTable >
RTable_ (const ::xercesc::DOMInputSource& is,
         ::xml_schema::error_handler& eh,
         ::xml_schema::flags f = 0,
         const ::xml_schema::properties& p = ::xml_schema::properties ());

::std::auto_ptr< ::RTable >
RTable_ (const ::xercesc::DOMInputSource& is,
         ::xercesc::DOMErrorHandler& eh,
         ::xml_schema::flags f = 0,
         const ::xml_schema::properties& p = ::xml_schema::properties ());

// Parse xercesc::DOMDocument.
//

::std::auto_ptr< ::RTable >
RTable_ (const ::xercesc::DOMDocument& d,
         ::xml_schema::flags f = 0,
         const ::xml_schema::properties& p = ::xml_schema::properties ());

::std::auto_ptr< ::RTable >
RTable_ (::xercesc::DOMDocument* d,
         ::xml_schema::flags f = 0,
         const ::xml_schema::properties& p = ::xml_schema::properties ());

#include <iosfwd>

#include <xercesc/dom/DOMDocument.hpp>
#include <xercesc/dom/DOMErrorHandler.hpp>
#include <xercesc/framework/XMLFormatter.hpp>

#include <xsd/cxx/xml/dom/auto-ptr.hxx>

// Serialize to std::ostream.
//

void
RTable_ (::std::ostream& os,
         const ::RTable& x, 
         const ::xml_schema::namespace_infomap& m,
         const ::std::string& e = "UTF-8",
         ::xml_schema::flags f = 0);

void
RTable_ (::std::ostream& os,
         const ::RTable& x, 
         const ::xml_schema::namespace_infomap& m,
         ::xml_schema::error_handler& eh,
         const ::std::string& e = "UTF-8",
         ::xml_schema::flags f = 0);

void
RTable_ (::std::ostream& os,
         const ::RTable& x, 
         const ::xml_schema::namespace_infomap& m,
         ::xercesc::DOMErrorHandler& eh,
         const ::std::string& e = "UTF-8",
         ::xml_schema::flags f = 0);

// Serialize to xercesc::XMLFormatTarget.
//

void
RTable_ (::xercesc::XMLFormatTarget& ft,
         const ::RTable& x, 
         const ::xml_schema::namespace_infomap& m,
         const ::std::string& e = "UTF-8",
         ::xml_schema::flags f = 0);

void
RTable_ (::xercesc::XMLFormatTarget& ft,
         const ::RTable& x, 
         const ::xml_schema::namespace_infomap& m,
         ::xml_schema::error_handler& eh,
         const ::std::string& e = "UTF-8",
         ::xml_schema::flags f = 0);

void
RTable_ (::xercesc::XMLFormatTarget& ft,
         const ::RTable& x, 
         const ::xml_schema::namespace_infomap& m,
         ::xercesc::DOMErrorHandler& eh,
         const ::std::string& e = "UTF-8",
         ::xml_schema::flags f = 0);

// Serialize to an existing xercesc::DOMDocument.
//

void
RTable_ (::xercesc::DOMDocument& d,
         const ::RTable& x,
         ::xml_schema::flags f = 0);

// Serialize to a new xercesc::DOMDocument.
//

::xsd::cxx::xml::dom::auto_ptr< ::xercesc::DOMDocument >
RTable_ (const ::RTable& x, 
         const ::xml_schema::namespace_infomap& m,
         ::xml_schema::flags f = 0);

void
operator<< (::xercesc::DOMElement&, const RTable&);

void
operator<< (::xercesc::DOMElement&, const Block1&);

void
operator<< (::xercesc::DOMElement&, const Block2&);

#include <xsd/cxx/post.hxx>

// Begin epilogue.
//
//
// End epilogue.

#endif // RTABLE_HXX
-------------- next part --------------
A non-text attachment was scrubbed...
Name: RTable.xsd
Type: application/xml
Size: 830 bytes
Desc: not available
Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20071121/edfe6e14/RTable.xml


More information about the xsd-users mailing list