28 #include "../xml/ReaderFactory.h"
36 #if TE_XSD_BUILD_WITH_XML_PARSER
42 xml_reader->setValidationScheme(
false);
44 xml_reader->read(file_name);
51 assert(xml_reader->getElementLocalName() ==
"schema");
55 std::size_t n_namespaces = xml_reader->getNumberOfNamespaces();
58 for(std::size_t i = 0; i != n_namespaces; ++i)
60 std::pair<std::string, std::string> ns;
62 xml_reader->getNamespace(i, ns);
64 my_schema->getNamespaces().insert(boost::bimap<std::string, std::string>::value_type(ns.first, ns.second));
69 std::size_t pos = xml_reader->getAttrPosition(
"id");
71 if(pos != std::string::npos)
72 my_schema->setId(
new std::string(xml_reader->getAttr(pos)));
76 std::size_t pos = xml_reader->getAttrPosition(
"attributeFormDefault");
78 if(pos != std::string::npos)
79 my_schema->setAttributeFormDefault(xml_reader->getAttr(pos) ==
"qualified" ?
Qualified :
Unqualified);
83 std::size_t pos = xml_reader->getAttrPosition(
"elementFormDefault");
85 if(pos != std::string::npos)
86 my_schema->setElementFormDefault(xml_reader->getAttr(pos) ==
"qualified" ?
Qualified :
Unqualified);
104 std::size_t pos = xml_reader->getAttrPosition(
"targetNamespace");
106 if(pos != std::string::npos)
107 my_schema->setTargetNamespace(xml_reader->getAttr(pos));
111 std::size_t pos = xml_reader->getAttrPosition(
"version");
113 if(pos != std::string::npos)
114 my_schema->setVersion(xml_reader->getAttr(pos));
120 #endif // TE_XSD_BUILD_WITH_XML_PARSER
An exception class for the XSD module.
A class that models a XML schema (XSD).
A class that models an XML Schema (XSD).
static te::xml::Reader * make()
It creates a new XML reader using the dafault implementation.
TEXSDEXPORT Schema * Read(const std::string &file_name)
It indicates that the attribute attribute must be qualified with the namespace prefix and the no-colo...
It indicates that the attribute attribute is not required to be qualified with the namespace prefix a...
Functions for reading an XSD.