Re: [Flightgear-devel] XML include (and value overriding) question
For the sake of completeness, there is also the xml parameterization system often used for panel/instrument configuations. However, the down side of that is that it can lead to some crazy/convoluted path names that can be brittle and are highly dependent on nesting levels -- a functional but unwieldy extension to the property system. :-) Curt. On Mon, Sep 24, 2012 at 2:41 AM, Stuart Buchanan stuar...@gmail.com wrote: On Mon, Sep 24, 2012 at 7:49 AM, Erik Hofman wrote: As far as I know XML is processed in order of appearance, so this should do the trick: PropertyList config weight-and-balance include=passengers.xml passenger1-kg75/passenger1-kg passenger3-kg80/passenger1-kg /weight-and-balance /config /PropertyList I think that will result in /config/weight-and-balance/passenger1-kg[0] = 60 /config/weight-and-balance/passenger1-kg[1] = 75 /config/weight-and-balance/passenger2-kg = 60 /config/weight-and-balance/passenger3-kg[0] = 60 /config/weight-and-balance/passenger3-kg[1] = 80 /config/weight-and-balance/passenger4-kg = 60 I think you need PropertyList config weight-and-balance include=passengers.xml passenger1-kg n=075/passenger1-kg passenger3-kg n=080/passenger1-kg /weight-and-balance /config /PropertyList I've used similar schemes in the various materials.xml and effects definitions. -Stuart -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel -- Curtis Olson: http://www.atiak.com - http://aem.umn.edu/~uav/ http://www.flightgear.org - http://gallinazo.flightgear.org -- Don't let slow site performance ruin your business. Deploy New Relic APM Deploy New Relic app performance management and know exactly what is happening inside your Ruby, Python, PHP, Java, and .NET app Try New Relic at no cost today and get our sweet Data Nerd shirt too! http://p.sf.net/sfu/newrelic-dev2dev___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] XML include (and value overriding) question
On Mon, Sep 24, 2012 at 7:49 AM, Erik Hofman wrote: As far as I know XML is processed in order of appearance, so this should do the trick: PropertyList config weight-and-balance include=passengers.xml passenger1-kg75/passenger1-kg passenger3-kg80/passenger1-kg /weight-and-balance /config /PropertyList I think that will result in /config/weight-and-balance/passenger1-kg[0] = 60 /config/weight-and-balance/passenger1-kg[1] = 75 /config/weight-and-balance/passenger2-kg = 60 /config/weight-and-balance/passenger3-kg[0] = 60 /config/weight-and-balance/passenger3-kg[1] = 80 /config/weight-and-balance/passenger4-kg = 60 I think you need PropertyList config weight-and-balance include=passengers.xml passenger1-kg n=075/passenger1-kg passenger3-kg n=080/passenger1-kg /weight-and-balance /config /PropertyList I've used similar schemes in the various materials.xml and effects definitions. -Stuart -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
Re: [Flightgear-devel] XML include (and value overriding) question
On 09/24/2012 09:41 AM, Stuart Buchanan wrote: I think that will result in /config/weight-and-balance/passenger1-kg[0] = 60 /config/weight-and-balance/passenger1-kg[1] = 75 /config/weight-and-balance/passenger2-kg = 60 /config/weight-and-balance/passenger3-kg[0] = 60 /config/weight-and-balance/passenger3-kg[1] = 80 /config/weight-and-balance/passenger4-kg = 60 I think you need PropertyList config weight-and-balance include=passengers.xml passenger1-kg n=075/passenger1-kg passenger3-kg n=080/passenger1-kg /weight-and-balance /config /PropertyList I've used similar schemes in the various materials.xml and effects definitions. You could be right, it's too long since I looked at the code. Erik -- http://www.adalin.com - Hardware accelerated AeonWave and OpenAL for Windows and Linux -- Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ ___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel
[Flightgear-devel] XML include (and value overriding) question
I have a question about the Flightgear xml config system and doing includes. This is an arbitrary example, but let's say I have an xml config file called main.xml: PropertyList config weight-and-balance include=passengers.xml / /config /PropertyList The passenger.xml file might look like the following: PropertyList passenger1-kg60/passenger1-kg passenger2-kg60/passenger2-kg passenger2-kg60/passenger2-kg passenger2-kg60/passenger2-kg /PropertyList In the property tree after this loads I will have: /config/weight-and-balance/passenger1-kg = 60 /config/weight-and-balance/passenger2-kg = 60 /config/weight-and-balance/passenger3-kg = 60 /config/weight-and-balance/passenger4-kg = 60 Now this is an arbitrary example, but what I want to do in my main.xml is override some of the default values in passenger.xml. Just imagine I am including a much more complicated config file with a lot of standard values, but maybe I want to override a tcp port, or set a enable/disable flag and do that from the main.xml level, and not touch the included file. This included file may get included on a number of systems and I may want to set specific values for each installation, rather than create a myriad of slightly different copies of a bunch of different included files. So for example, on some flight maybe I only have 3 passengers. I weigh them and they are 65 kg, 55 kg, and 58 kg (and the 4th would then be 0 kg.) I don't want to touch the passenger.xml file, but I want to override the default values in my main.xml file after (before?) including the file. Is there a way to include a sub xml file, but override some of the default values that are set in the included xml file? Thanks, Curt. -- Curtis Olson: http://www.atiak.com - http://aem.umn.edu/~uav/ http://www.flightgear.org - http://gallinazo.flightgear.org -- Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://ad.doubleclick.net/clk;258768047;13503038;j? http://info.appdynamics.com/FreeJavaPerformanceDownload.html___ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel