15 #ifndef QGSGMLSCHEMA_H
16 #define QGSGMLSCHEMA_H
32 #include <QDomElement>
33 #include <QStringList>
47 QList<QgsField> &
fields() {
return mFields; }
49 int fieldIndex(
const QString & name );
51 QString
path()
const {
return mPath; }
69 QList<QgsField> mFields;
72 QStringList mGeometryAttributes;
84 bool parseXSD(
const QByteArray &xml );
91 bool guessSchema(
const QByteArray &data );
94 QStringList typeNames()
const;
97 QList<QgsField> fields(
const QString & typeName );
100 QStringList geometryAttributes(
const QString & typeName );
119 void startElement(
const XML_Char* el,
const XML_Char** attr );
120 void endElement(
const XML_Char* el );
121 void characters(
const XML_Char* chars,
int len );
122 static void start(
void* data,
const XML_Char* el,
const XML_Char** attr )
124 static_cast<QgsGmlSchema*
>( data )->startElement( el, attr );
126 static void end(
void* data,
const XML_Char* el )
130 static void chars(
void* data,
const XML_Char* chars,
int len )
132 static_cast<QgsGmlSchema*
>( data )->characters( chars, len );
135 void addAttribute(
const QString& name,
const QString& value );
141 QString readAttribute(
const QString& attributeName,
const XML_Char** attr )
const;
144 QWidget* findMainWindow()
const;
147 QList<QDomElement> domElements(
const QDomElement &element,
const QString & path );
150 QDomElement domElement(
const QDomElement &element,
const QString & path );
153 QList<QDomElement> domElements( QList<QDomElement> &elements,
const QString & attr,
const QString & attrVal );
156 QDomElement domElement(
const QDomElement &element,
const QString & path,
const QString & attr,
const QString & attrVal );
159 QString stripNS(
const QString & name );
166 QString xsdComplexTypeGmlBaseType(
const QDomElement &element,
const QString & name );
169 bool xsdFeatureClass(
const QDomElement &element,
const QString & typeName,
QgsGmlFeatureClass & featureClass );
173 ParseMode modeStackTop() {
return mParseModeStack.isEmpty() ? none : mParseModeStack.top(); }
176 ParseMode modeStackPop() {
return mParseModeStack.isEmpty() ? none : mParseModeStack.pop(); }
180 QStack<ParseMode> mParseModeStack;
184 QString mCurrentFeatureId;
186 QString mAttributeName;
188 QString mCoordinateSeparator;
190 QString mTupleSeparator;
201 QStringList mParsePathStack;
203 QString mCurrentFeatureName;
206 QStringList mGeometryTypes;
209 QMap<QString, QgsGmlFeatureClass> mFeatureClassMap;