Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GMLAS Schema path with space set with options fails #1452

Closed
vindoctor opened this issue Apr 17, 2019 · 0 comments
Closed

GMLAS Schema path with space set with options fails #1452

vindoctor opened this issue Apr 17, 2019 · 0 comments
Assignees
Labels
Milestone

Comments

@vindoctor
Copy link

vindoctor commented Apr 17, 2019

When calling driver_options_ = CSLAddString(driver_options_, "XSD=C:\path with space\gmltest_1.0.0.xsd");

with

OGRDataSource* poDS = (OGRDataSource*)GDALOpenEx(filenametouse.c_str(), GDAL_OF_READONLY | GDAL_OF_VECTOR | GDAL_OF_VERBOSE_ERROR | ((bUpdate) ? GDAL_OF_UPDATE: 0) | GDAL_OF_SHARED, allowed_drivers_, driver_options_, NULL);

Fails to find the schema. NOTE if you set the path with spaces in the XML/GML file, it works one would expect.

The reason this does not work is because of an assumption/bug when things get tokenized.

As when this gets called:

std::vector OGRGMLASDataSource::BuildXSDVector(
const CPLString& osXSDFilenames)

It splits the the file path up because of the spaces (flags are 0)

char** papszTokens = CSLTokenizeString2(osXSDFilenames," ,",0);

Currently no work around exists other than to fix/compile your code to get around this, or you just define the schema path inside the gml/xml to find the schema file.

One would expect they can give a file path to a schema with spaces using the XSD= option!

This is the latest release 4.2.1
I am running on a Windows 10 OS

@rouault rouault self-assigned this Apr 17, 2019
@rouault rouault added the bug label Apr 17, 2019
@rouault rouault added this to the 2.4.2 milestone Apr 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants