Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML - Beginners question

Status
Not open for further replies.

Tazskool

Technical User
Oct 12, 2006
1
GB
I have a PC game which uses XML as config files.. and theres a standard section of coding in this one which tells the program to use a background..

I want it to be able to choose an image depending on the "team" ID number.

I have a very rough idea on what to do but am no where near sure.

Heres the code from the section to get 1 image.

<!-- MATCH SCREEN -->
<widget class="background" id="bgnd" file="backgrounds/one">
<layout class="stick_to_sides_attachment" alignment="all" inset="0"/>
<attachment class="test_global_attachment" get_property="scid" value="22" mode="1" set_property="hidn" skip_if_null="false" skip_if_resetting="false" priority="1"/>
</widget>

Now.... where the file="backgrounds/one"> is where I want to edit the coding to choose an option automatically..

Such as if the team you are using is ID Code 676 then then choose "file=backgrounds/676" and if the team you are using is ID 670 then "file=backgrounds/670" and if team is not one in the list then "file=backgrounds/default"

I have this coding but not sure if/how it would fit into the section above..
<list id="maps">
<!-- A-League -->
<record from="a-league/adelaide utd" to="graphics/pictures/club/8457492/logo"/>

Any help would be really greatful!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top