flying-w Posted August 21, 2016 Report Posted August 21, 2016 Hello Pete I have a little problem with the latest makerwys.exe (4.6.9.7) and the runways.xml file. If certain scenery paths contain a special character, that's passed through to the XML which can give readers such as the Microsoft .Net classes a problem when they try to deal with it. For example, from ORBX scenery: <File>ORBX\FTX_NA\FTX_NA_CRM05_SCENERY\scenery\ADE_FTX_CRM_16W_Little_Goose_Lock_&_Dam.BGL</File> The above generates an exception as "&" has special meaning in XML; it can be "escaped" to make it valid like this: <File>ORBX\FTX_NA\FTX_NA_CRM05_SCENERY\scenery\ADE_FTX_CRM_16W_Little_Goose_Lock_&_Dam.BGL</File> Would you mind having a look at this please? Many thanks Simon
Pete Dowson Posted August 21, 2016 Report Posted August 21, 2016 4 hours ago, flying-w said: <File>ORBX\FTX_NA\FTX_NA_CRM05_SCENERY\scenery\ADE_FTX_CRM_16W_Little_Goose_Lock_&_Dam.BGL</File> The above generates an exception as "&" has special meaning in XML; it can be "escaped" to make it valid like this: <File>ORBX\FTX_NA\FTX_NA_CRM05_SCENERY\scenery\ADE_FTX_CRM_16W_Little_Goose_Lock_&_Dam.BGL</File> Would you mind having a look at this please? Well, I could eliminate all & signs, but where it is part of a file or path name, as here, that will make that file or pathname incorrect. So what do you suggest that would work apart from asking all Scenery designers to avoid using &? There must be other XML files which need file and path names, so how are they managed? Pete
flying-w Posted August 21, 2016 Author Report Posted August 21, 2016 39 minutes ago, Pete Dowson said: There must be other XML files which need file and path names, so how are they managed Here's how FSX Steam Edition is managing the dll.xml. This is the location of my SimConnect DLL: Test 1, use a raw "&" character in the dll.xml entry: <Launch.Addon> <Name>SuperTrafficBoard Server</Name> <Disabled>False</Disabled> <ManualLoad>False</ManualLoad> <Path>E:\Program Files (x86)\FlyingWSimulation\SuperTrafficBoard Data Server for FSX and FSX Steam Edition (Standalone)\STBServer&1\STBServer.dll</Path> </Launch.Addon> Results: The DLL is not loaded. If I run a simconnect server trace, there's no mention of the dll.xml anywhere to be found which isn't normal. Test 2: Escape the "&" character using "&": <Launch.Addon> <Name>SuperTrafficBoard Server</Name> <Disabled>False</Disabled> <ManualLoad>False</ManualLoad> <Path>E:\Program Files (x86)\FlyingWSimulation\SuperTrafficBoard Data Server for FSX and FSX Steam Edition (Standalone)\STBServer&1\STBServer.dll</Path> </Launch.Addon> Results: The DLL is loaded: I guess this ultimately depends on your intention for the runways.xml. If it is just for people to read, no problem. If it is for applications to read, they may run into problems using the standard XML classes/libraries to do so. Simon
moskito-x Posted August 21, 2016 Report Posted August 21, 2016 Hi Pete, for your information there may be also other problems with ORBX files a user in the PRO-ATC/X forum "To be honest, I'm more worried about why P3D is crashing when I try to load it. " Summary of steps user has done. installed ORBX sceneries slight problems with PRO-ATC/X runs older version of MakeRwys so I asked to update to new version. updated to 4.6.9.7 after new run of MakeRwys -> P3D can not be started - crashed immediately asks for help so I removed all ORBX from scenery.cfg (he sends me a ziped scenery.cfg ...) immediately P3D can be started again. a new installation of ORBX and again run of MakeRwys has no longer causes P3D to crash ! looking into users old and new scenery.cfg I noticed last Install has not installed ORBX!VECTOR_FixedAPT . Can be that's the reason P3D now not crash. Thomas
Pete Dowson Posted August 21, 2016 Report Posted August 21, 2016 1 hour ago, flying-w said: Escape the "&" character using "&" So that's how to include a textual & in an XML file? If so, that's all I needed, thanks. BTW what does the "amp; part supposed to mean? Seems quite complicated compared to, say, C's method fo for exaple including textual \ using \\. Pete
moskito-x Posted August 21, 2016 Report Posted August 21, 2016 http://support.esri.com/technical-article/000005870 Thomas
Pete Dowson Posted August 21, 2016 Report Posted August 21, 2016 1 hour ago, moskito-x said: http://support.esri.com/technical-article/000005870 Thanks. Pete
flying-w Posted August 21, 2016 Author Report Posted August 21, 2016 1 hour ago, Pete Dowson said: So that's how to include a textual & in an XML file? If so, that's all I needed, thanks. As far as I know, that's it, and as confirmed by the link above. 1 hour ago, Pete Dowson said: BTW what does the "amp; part supposed to mean? Seems quite complicated compared to, say, C's method fo for exaple including textual \ using \\. I imagine there's some global standards body somewhere that decide this format is the one. "&" is the escape character, something special is coming. "amp" means we want to present an "&" character in the data. ";" means we have finished escaping. Thanks Simon
Pete Dowson Posted August 21, 2016 Report Posted August 21, 2016 Seems I need to do " ' < and > too! Pete
flying-w Posted August 21, 2016 Author Report Posted August 21, 2016 It's times like this a 5 minute job becomes 5 hours! Simon
Luke Kolin Posted August 21, 2016 Report Posted August 21, 2016 33 minutes ago, Pete Dowson said: Seems I need to do " ' < and > too! Are you generating the XML yourself or using a library? Generally speaking, encoding of special/reserved characters is why I never generate XML or JSON myself. Cheers! Luke
Pete Dowson Posted August 21, 2016 Report Posted August 21, 2016 3 hours ago, Luke Kolin said: Are you generating the XML yourself or using a library? My own code. Just a sequence of "sprintf" formatting sections. 3 hours ago, Luke Kolin said: Generally speaking, encoding of special/reserved characters is why I never generate XML I don't like XML at all. It's over-verbose and cumbersome/complicated, which is one reason, but a bigger reason is that one little error in its syntax often makes the whole lot invalid. I only made the XML files because folks asked for them. 3 hours ago, Luke Kolin said: or JSON Don't know "JSON". Pete
Luke Kolin Posted August 21, 2016 Report Posted August 21, 2016 55 minutes ago, Pete Dowson said: I don't like XML at all. It's over-verbose and cumbersome/complicated, which is one reason, but a bigger reason is that one little error in its syntax often makes the whole lot invalid. That's a feature, not a bug :) XML is designed for data interchange, and in most circumstances you want to discard in the case of syntactical invalidity. It's not a bad format for structured data that needs validation with a schema document. The verbosity is a challenge, but at least it compresses nicely. It also is human-readable. In all seriousness, if you're going to emit XML you really should let a library handle all of the encoding for you. You can read about JSON here: http://www.json.org/ It's essentially a way of serializing Javascript objects. Cheers! Luke
Pete Dowson Posted August 23, 2016 Report Posted August 23, 2016 Version 4.968 of MakeRunways is now released, fixing this problem. Pete
flying-w Posted August 23, 2016 Author Report Posted August 23, 2016 Thanks a lot for taking care of this Pete. Simon
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now