27 #include "../../xml/Reader.h"
28 #include "../../xml/Writer.h"
29 #include "../../xsd/ComplexType.h"
30 #include "../../xsd/Element.h"
31 #include "../../xsd/Key.h"
32 #include "../../xsd/KeyRef.h"
33 #include "../../xsd/QName.h"
34 #include "../../xsd/SimpleType.h"
35 #include "../../xsd/Unique.h"
62 if(pos != std::string::npos)
63 element->setName(
new std::string(reader.
getAttr(pos)));
67 if(pos != std::string::npos)
72 if(pos != std::string::npos)
77 if(pos != std::string::npos)
82 if(pos != std::string::npos)
83 element->setDefaultValue(
new std::string(reader.
getAttr(pos)));
87 if(pos != std::string::npos)
88 element->setFixedValue(
new std::string(reader.
getAttr(pos)));
95 if(pos != std::string::npos)
96 element->setAsNillable(reader.
getAttr(pos) ==
"true" ?
true :
false);
100 if(pos != std::string::npos)
101 element->setAsAbstract(reader.
getAttr(pos) ==
"true" ?
true :
false);
116 std::set<std::string> children;
117 children.insert(
"unique");
118 children.insert(
"key");
119 children.insert(
"keyref");
121 std::set<std::string>::iterator it;
125 std::string tag = *it;
128 element->addIdentityConstraint(
ReadUnique(reader));
134 element->addIdentityConstraint(
ReadKey(reader));
139 element->addIdentityConstraint(
ReadKeyRef(reader));
145 return element.release();
TESERIALIZATIONEXPORT te::xsd::KeyRef * ReadKeyRef(te::xml::Reader &reader)
TESERIALIZATIONEXPORT te::xsd::Unique * ReadUnique(te::xml::Reader &reader)
This class models a XML reader object.
virtual bool next()=0
It gets the next event to be read.
void ReadAnnotated(te::xsd::Annotated *annotated, te::xml::Reader &reader)
TESERIALIZATIONEXPORT te::xsd::Element * ReadElement(te::xml::Reader &reader)
This class models the element of a XML Schema.
TESERIALIZATIONEXPORT void Save(const te::fe::Filter *filter, te::xml::Writer &writer)
void ReadIdentifiable(te::xsd::Identifiable *identifiable, te::xml::Reader &reader)
Support for SimpleType serialization.
te::xsd::QName * CreateQName(const std::string &name)
TESERIALIZATIONEXPORT te::xsd::ComplexType * ReadComplexType(te::xml::Reader &reader)
TESERIALIZATIONEXPORT te::xsd::Key * ReadKey(te::xml::Reader &reader)
void ReadOccurs(te::xsd::Occurs *occurs, te::xml::Reader &reader)
Utility methods for Schema serialization.
Support for Unique serialization.
Support for KeyRef serialization.
Support for ComplexType serialization.
virtual NodeType getNodeType() const =0
It return the type of node read.
Support for Element serialization.
virtual std::string getElementLocalName() const =0
It returns the local part of the element name in the case of an element node.
TESERIALIZATIONEXPORT te::xsd::SimpleType * ReadSimpleType(te::xml::Reader &reader)
virtual std::size_t getAttrPosition(const std::string &name) const =0
It returns the attribute position.
Support for Key serialization.
virtual std::string getAttr(const std::string &name) const =0
It returns the attribute value in the case of an element node with valid attributes.
This class models a XML writer object.