[xsd-users] Optional Cardinality Issues
jatkins
jatkins at wintelligence.org
Mon Apr 20 19:22:40 EDT 2009
Greetings!
I know this is probably a really simple question, but I'm a bit confused
at the moment. I'm having trouble generating XML from a wireless profile
schema. I have no issues generating elements in the SSIDConfig section,
but I'm struggling with the MSM content. A simple xml representation of a
profile would look like:
<WLANProfile xmlns="[LINK:
http://www.microsoft.com/networking/WLAN/profile/v1]
http://www.microsoft.com/networking/WLAN/profile/v1">
<name>linksys</name>
<SSIDConfig>
<SSID>
<hex>6C696E6B737973</hex>
<name>linksys</name>
</SSID>
</SSIDConfig>
<connectionType>ESS</connectionType>
<MSM>
<security>
<authEncryption>
<authentication>open</authentication>
<encryption>none</encryption>
<useOneX>false</useOneX>
</authEncryption>
</security>
</MSM>
</WLANProfile>
The SSIDConfig section uses sequence which I have no problems with.
WLANProfile wlprofile(L"linksys", L"ESS");
SSID ssid;
ssid.name(L"linksys");
SSIDConfig ssc;
SSIDConfig::SSID_sequence& ssq(ssc.SSID());
ssq.push_back(ssid);
WLANProfile::SSIDConfig_sequence& ss(wlprofile.SSIDConfig());
ss.push_back(ssc);
The schema for this section generates
typedef ::xsd::cxx::tree::sequence< SSID_type > SSID_sequence;
The MSM section goes deeper and appears to be optional cardinality. How
would I populate this information from scratch? I can populate the
authencryption data, but I'm not sure how to populate this info within the
WLANProfile object. There are no push_back/set methods once I populate the
authEncryption object.
class MSM: public ::xml_schema::type
{
public:
// connectivity
//
typedef ::networking::WLAN::profile::v1::connectivity connectivity_type;
typedef ::xsd::cxx::tree::optional< connectivity_type >
connectivity_optional;
typedef ::xsd::cxx::tree::traits< connectivity_type, wchar_t >
connectivity_traits;
const connectivity_optional&
connectivity () const;
connectivity_optional&
connectivity ();
void
connectivity (const connectivity_type& x);
void
connectivity (const connectivity_optional& x);
void
connectivity (::std::auto_ptr< connectivity_type > p);
// security
//
typedef ::networking::WLAN::profile::v1::security security_type;
typedef ::xsd::cxx::tree::optional< security_type > security_optional;
typedef ::xsd::cxx::tree::traits< security_type, wchar_t >
security_traits;
const security_optional&
security () const;
security_optional&
security ();
void
security (const security_type& x);
void
security (const security_optional& x);
void
security (::std::auto_ptr< security_type > p);
// Constructors.
//
MSM ();
MSM (const ::xercesc::DOMElement& e,
::xml_schema::flags f = 0,
::xml_schema::container* c = 0);
MSM (const MSM& x,
::xml_schema::flags f = 0,
::xml_schema::container* c = 0);
virtual MSM*
_clone (::xml_schema::flags f = 0,
::xml_schema::container* c = 0) const;
virtual
~MSM ();
// Implementation.
//
protected:
void
parse (::xsd::cxx::xml::dom::parser< wchar_t >&,
::xml_schema::flags);
protected:
connectivity_optional connectivity_;
security_optional security_;
};
//Set AuthEncryption
authEncryption ae(authentication::open, encryption::none);
authEncryption::useOneX_optional& uox(ae.useOneX());
uox.set(false);
Any help is appreciated. The entire schema is attached.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wlan_wlp.xsd
Type: application/octet-stream
Size: 15263 bytes
Desc: not available
Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20090420/fdae2142/wlan_wlp.obj
More information about the xsd-users
mailing list