| 135 | | if( szHeader[0] != '<' |
|---|
| 136 | | || strstr(szHeader,"opengis.net/gml") == NULL ) |
|---|
| | 135 | /* -------------------------------------------------------------------- */ |
|---|
| | 136 | /* Check for a UTF-8 BOM and skip if found */ |
|---|
| | 137 | /* */ |
|---|
| | 138 | /* TODO: BOM is variable-lenght parameter and depends on encoding. */ |
|---|
| | 139 | /* Add BOM detection for other encodings. */ |
|---|
| | 140 | /* -------------------------------------------------------------------- */ |
|---|
| | 141 | |
|---|
| | 142 | // Used to skip to actual beginning of XML data |
|---|
| | 143 | char* szPtr = szHeader; |
|---|
| | 144 | |
|---|
| | 145 | if( ( (unsigned char)szHeader[0] == 0xEF ) |
|---|
| | 146 | && ( (unsigned char)szHeader[1] == 0xBB ) |
|---|
| | 147 | && ( (unsigned char)szHeader[2] == 0xBF) ) |
|---|
| | 148 | { |
|---|
| | 149 | szPtr += 3; |
|---|
| | 150 | } |
|---|
| | 151 | |
|---|
| | 152 | /* -------------------------------------------------------------------- */ |
|---|
| | 153 | /* Here, we expect the opening chevrons of GML tree root element */ |
|---|
| | 154 | /* -------------------------------------------------------------------- */ |
|---|
| | 155 | if( szPtr[0] != '<' |
|---|
| | 156 | || strstr(szPtr,"opengis.net/gml") == NULL ) |
|---|