[xsd-users] Namspace schema with spaces in the file path

Garry Jeromson garry.jeromson at enclustra.com
Fri Mar 20 11:08:03 EDT 2015


Hullo,

I'm encountering a classic spaces-in-the-path issue; my application expects some XML files to be in a subfolder relative to the .exe, so I get the full path on the fly at run-time. The schema for said XML has a namespace, which I pass in when parsing as follows:

xml_schema::properties xmlProperties;
xmlProperties.schema_location("EepromMemoryMaps", schemaFilePath);
auto_ptr<EepromXml::EEPROMMemoryMap> pParsedXml(EepromXml::EEPROMMemoryMap_(eepromMapXmlPath, 0, xmlProperties));

When the path to the .exe has spaces in it (as I'd like to have, so it can live in the Program Files folder on Windows), parsing fails because of the spaces. The error "unable to open primary document entity 'C:\path'" is given in the diagnostics; the full path to the files is "C:\path with spaces".

Is there any way to get around this without hacking away at the generated .cxx file?

Cheers,

Garry



More information about the xsd-users mailing list