Download C++/Tree Mapping User Manual
Transcript
2.12 Mapping for any and anyAttribute
"any_attribute" for the anyAttribute wildcard. The accessor and modifier functions
are named "any" for the any wildcard and "any_attribute" for the anyAttribute
wildcard. Subsequent wildcards in the same type have escaped names such as "any1" or
"any_attribute1".
Because Xerces-C++ DOM nodes always belong to a DOMDocument, each type with a wildcard
has an associated DOMDocument object. The reference to this object can be obtained using the
accessor function called dom_document. The access to the document object from the application code may be necessary to create or modify the wildcard content. For example:
<complexType name="object">
<sequence>
<any namespace="##other"/>
</sequence>
<anyAttribute namespace="##other"/>
</complexType>
is mapped to:
class object: public xml_schema::type
{
public:
// any
//
const xercesc::DOMElement&
any () const;
void
any (const xercesc::DOMElement&);
...
// any_attribute
//
typedef attribute_set any_attribute_set;
typedef any_attribute_set::iterator any_attribute_iterator;
typedef any_attribute_set::const_iterator any_attribute_const_iterator;
const any_attribute_set&
any_attribute () const;
any_attribute_set&
any_attribute ();
...
// DOMDocument object for wildcard content.
//
const xercesc::DOMDocument&
July 2014
C++/Tree Mapping User Manual, v4.0.0
63