[xsd-users] Question on XSD generated code

Homer J S js.homer at yahoo.com
Fri Feb 6 14:46:02 EST 2009


Hello,
I have the following class "depth" generated by XSD from an existing schema (not mine). The class is derived from xml_schema::double, with an optional attribute uom (string).

I could set the attr uom for an object by

myObject.uom("aString");

but I could not find a way to set the float value for an object without wiping out the existing uom attr of the object, e.g.,

myObject = 3.1416; //this will wipe the current value of uom attr

Am I missing something here please? 

Thanks
JS
----

  class depth: public ::xsd::cxx::tree::fundamental_base< ::xml_schema::double_, char, ::xml_schema::simple_type, ::xsd::cxx::tree::schema_type::double_ >
  {
    public:
    // uom
    // 
    typedef ::xml_schema::string uom_type;
    typedef ::xsd::cxx::tree::optional< uom_type > uom_optional;
    typedef ::xsd::cxx::tree::traits< uom_type, char > uom_traits;

    const uom_optional&
    uom () const;

    uom_optional&
    uom ();

    void
    uom (const uom_type& x);

    void
    uom (const uom_optional& x);

    void
    uom (::std::auto_ptr< uom_type > p);

    // Constructors.
    //
    depth (const ::xml_schema::double_&);

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

    depth (const depth& x,
                        ::xml_schema::flags f = 0,
                        ::xml_schema::container* c = 0);

    virtual depth*
    _clone (::xml_schema::flags f = 0,
            ::xml_schema::container* c = 0) const;

    virtual 
    ~depth ();

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

    protected:
    uom_optional uom_;
  };



      


More information about the xsd-users mailing list