Directory structure of source generated in output directory named OD
directory |
file |
about contents |
OD/ (output directory) |
- main.cpp
- Makefile.am, configure.ac and other automake related files
|
- the template
main.cpp - automake related files
|
OD/include/ |
Makefile.am |
for Makefile |
OD/include/directory...namespace/ |
- Document.h
- <element-name>.h
- attr_<attribute-name>.h
- all-include.h
|
header files from input-schema(or included/imported docs)
- Document class inside Document.h
- header files defining C++ classes for each top-level element declarations
- header files defining C++ classes for each top-level attribute declarations
- other misc headers like all-include.h
|
OD/include/directory...namespace/Types/ |
- <simpleType-name>.h
- <complexType-name>.h
|
header files from input-schema(or included/imported docs)
- header files defining C++ classes for each top-level simpleType declarations
- header files defining C++ classes for each top-level complexType declarations
|
OD/src/ |
Makefile.am |
for Makefile |
OD/src/directory...namespace/ |
- Document.cpp
- <element-name>.cpp
- attr_<attribute-name>.cpp
|
source(.cpp) files from input-schema(or included/imported docs):
- Source file for Document class in file Document.cpp
- Source files(.cpp) for each top-level element declarations
- Source files(.cpp) for each top-level attribute declarations
|
OD/include/directory...namespace/Types/ |
- <simpleType-name>.cpp
- <complexType-name>.cpp
|
source(.cpp) files from input-schema(or included/imported docs):
- Source files(.cpp) for each top-level simpleType declarations
- Source files(.cpp) for each top-level complexType declarations
|
Naming and Namespaces
Annotation |
component's position in the tree |
component's C++ Type, pointer and Smart pointer |
top-level element |
<schema>
<element name="myElement" type="MyElemType"/>
...
....
</schema>
|
- myElement
- myElement* or myElement_p
- AutoPtr<myElement> or myElement_ptr
|
top-level attribute |
<schema>
<attribute name="MyAttr" type="MyAttrType"/>
...
....
</schema>
|
- myAttr
- myAttr* or myAttr_p
- AutoPtr<myAttr> or myAttr_ptr
|
top-level Type |
<schema>
...
<complexType name="MyComplexType" >
...
</complexType>
...
</schema>
|
- MyComplexType
- MyComplexType* or MyComplexType_p
- AutoPtr<MyComplexType> or MyComplexType_ptr
|
local element |
<schema>
<element name="element1" ...>
...
<element name="element2" ...>
...
<element name="myElement type="MyElemType"/>
...
</element>
...
</element>
</schema>
|
- element1::element2::myElement
- element1::element2::myElement*
or element1::element2::myElement_p
- element1::element2::myElement_ptr
or element1::element2::myElement_ptr
|
local attribute |
<schema>
<element name="element1" ...>
...
<element name="element2" ...>
...
<attribute name="myAttr" type="MyAttrType"/>
...
</element>
...
</element>
</schema>
|
- element1::element2::myAttr
- element1::element2::myAttr*
or element1::element2::myAttr_p
- AutoPtr<element1::element2::attr_myAttr>
or element1::element2::attr_myAttr_ptr
|
nested(anonymous) Type |
-- |
you should not need to know, as the anonymous type would be wrapped inside an element/attribute or a top-level Type, and you would only need access to them |
// Following functions are use case templates.
// You need to put "code" in the respective contexts.
//
void chooseDocumentElement(STDemo::Document* xsdDoc)
{
// uncomment one of folowing to choose root
xsdDoc->set_root_myComplexTypeElem();
//xsdDoc->set_root_intValue2();
}
void populateDocument(DOM::Document* pDoc)
{
STDemo::Document* docNode = dynamic_cast<STDemo::Document *>(pDoc);
// write code to populate the Document here
...
....
rootElem->set_aFont("medium");
rootElem->set_anotherFont("72");
....
...
}
void updateOrConsumeDocument(DOM::Document* pDoc)
{
STDemo::Document* xsdDoc = dynamic_cast<STDemo::Document *>(pDoc);
// write code to update the populated-Document here
}