![]() |
Rosetta
2021.16
|
An XMLSchema element, e.g. the FixbbMover "tag" <FixbbMover name="fixbb" task_operations="ex1,ex2"> or the And element which contains a sub-element: <And><Chain id="A"></And>. An element can be defined with an unnamed complex type in-line, or it can say that its type is that of a complex type defined elsewhere. (In XML naming a tag is a single block beginning with "<" and ending with ">", so both "<And>" and "</And>" are tags. The block between the opening and closing tags is called an element. The utility::tag::Tag class represents a complete Element, and not simply the opening or closing tag of an element. This is certainly confusing. More...
#include <XMLSchemaGeneration.hh>

Public Member Functions | |
| XMLSchemaElement () | |
| XMLSchemaElement & | name (std::string const &setting) |
| XMLSchemaElement & | set_abstract () |
| XMLSchemaElement & | substitution_group (std::string const &setting) |
| XMLSchemaElement & | type_name (XMLSchemaType setting) |
| XMLSchemaElement & | reference_name (std::string const &setting) |
| XMLSchemaElement & | element_type_def (XMLSchemaComplexTypeOP setting) |
| std::string const & | element_name () const override |
| void | write_definition (int indentation, std::ostream &os) const override |
| void | prepare_for_output (XMLSchemaDefinition &xsd) const override |
Public Member Functions inherited from utility::tag::XMLSchemaParticle | |
| XMLSchemaParticle () | |
| ~XMLSchemaParticle () override | |
| XMLSchemaParticle & | min_occurs (int setting) |
| XMLSchemaParticle & | max_occurs (int setting) |
| int | min_occurs () const |
| int | max_occurs () const |
Public Member Functions inherited from utility::VirtualBase | |
| VirtualBase ()=default | |
| Default constructor. More... | |
| virtual | ~VirtualBase ()=default |
| The virtual destructor is one of the main reasons for the VirtualBase class. More... | |
| VirtualBase (VirtualBase const &)=default | |
| VirtualBase (VirtualBase &&)=default | |
| VirtualBase & | operator= (VirtualBase const &)=default |
| VirtualBase & | operator= (VirtualBase &&)=default |
Private Attributes | |
| XMLSchemaElementCategory | category_ |
| std::string | name_ |
| XMLSchemaType | type_name_ |
| XMLSchemaComplexTypeOP | complex_type_ |
| std::string | substitution_group_ |
An XMLSchema element, e.g. the FixbbMover "tag" <FixbbMover name="fixbb" task_operations="ex1,ex2"> or the And element which contains a sub-element: <And><Chain id="A"></And>. An element can be defined with an unnamed complex type in-line, or it can say that its type is that of a complex type defined elsewhere. (In XML naming a tag is a single block beginning with "<" and ending with ">", so both "<And>" and "</And>" are tags. The block between the opening and closing tags is called an element. The utility::tag::Tag class represents a complete Element, and not simply the opening or closing tag of an element. This is certainly confusing.
An element may either have its type definition given inline (i.e. as a sub-tag / sub-element of the element declaration) as either a complex type or a restriction – or it may have its type definition given by reference to a (named) type defined elsewhere in the XML Schema. In Rosetta's style of XML, the type of an element is universally a complex type; if the element's type were given as either a primitive type, or a restriction, then the data would have to appear between two tags, e.g.
<FirstName> Andrew </FirstName>
and in Rosetta's XML, we ignore everything that appears outside of a tag, and store all of the data in attributes (aka options) inside of tags. The elements in Rosetta either are "empty" or they contain sub-elements: both of these are classified as complex types in XML Schema.
Elements may appear multiple times, and the number of times they must/may appear are controlled by the min_occurs and max_occurs functions. If you are setting no limit on max_occurs, use the "xsminmax_unbounded" value of the XMLSchemaMinOccursMaxOccurs enumeration.
| utility::tag::XMLSchemaElement::XMLSchemaElement | ( | ) |
|
overridevirtual |
Implements utility::tag::XMLSchemaTopLevelElement.
References name_.
| XMLSchemaElement & utility::tag::XMLSchemaElement::element_type_def | ( | XMLSchemaComplexTypeOP | setting | ) |
References category_, complex_type_, and utility::tag::xs_element_is_complex_type_w_definition.
| XMLSchemaElement & utility::tag::XMLSchemaElement::name | ( | std::string const & | setting | ) |
References name_.
Referenced by basic::resource_manager::ResourceManager::schema_for_resource_definition_file().
|
overridevirtual |
| XMLSchemaElement & utility::tag::XMLSchemaElement::reference_name | ( | std::string const & | setting | ) |
References category_, name_, and utility::tag::xs_element_is_element_reference.
| XMLSchemaElement & utility::tag::XMLSchemaElement::set_abstract | ( | ) |
References category_, and utility::tag::xs_element_is_abstract.
| XMLSchemaElement & utility::tag::XMLSchemaElement::substitution_group | ( | std::string const & | setting | ) |
References substitution_group_.
| XMLSchemaElement & utility::tag::XMLSchemaElement::type_name | ( | XMLSchemaType | setting | ) |
References category_, type_name_, and utility::tag::xs_element_is_type_reference.
Referenced by basic::resource_manager::ResourceManager::schema_for_resource_definition_file().
|
overridevirtual |
Implements utility::tag::XMLSchemaTopLevelElement.
References category_, complex_type_, debug_assert, utility::tag::indent_w_spaces(), utility::tag::XMLSchemaParticle::max_occurs(), utility::tag::XMLSchemaParticle::min_occurs(), name_, substitution_group_, utility::tag::XMLSchemaType::type_name(), type_name_, utility::tag::write_min_occurs_max_occurs_if_necessary(), utility::tag::xs_element_is_abstract, utility::tag::xs_element_is_element_reference, and utility::tag::xs_element_is_type_reference.
|
private |
Referenced by element_type_def(), reference_name(), set_abstract(), type_name(), and write_definition().
|
private |
Referenced by element_type_def(), prepare_for_output(), and write_definition().
|
private |
Referenced by element_name(), name(), reference_name(), and write_definition().
|
private |
Referenced by substitution_group(), and write_definition().
|
private |
Referenced by prepare_for_output(), type_name(), and write_definition().
1.8.7