|
#1
|
||||
|
||||
|
XML.SetValue Path
I am attempting to use XML.SetValue to change the value of "Assistance" from "true" to "false", thus toggling the radio button in its group.
When referencing the path, does the full path have to be referenced? I.E., AutoPlay\\Docs\\...? Then, based on the example, what is the proper path to change the value? After changing the value, is the XML.Save action required, or is the change written and saved to the XML file with the SetValue action? Code:
<?xml version="1.0" encoding="iso-8859-1" ?> - <menu lang="en"> - <item label="File"> <item label="Exit" /> </item> - <item label="Documents"> - <item label="Instructions"> <item label="Standard Buttons" /> <item label="Address Bar" /> <item label="Links" /> <item type="separator" /> <item label="Lock the Toolbars" /> </item> - <item label="Specifications"> <item label="Standard Buttons" /> <item label="Address Bar" /> <item label="Links" /> <item type="separator" /> <item label="Lock the Toolbars" /> </item> - <item label="References"> <item label="Standard Buttons" /> <item label="Address Bar" /> <item label="Links" /> <item type="separator" /> <item label="Lock the Toolbars" /> </item> </item> - <item label="Instruction"> - <item label="Overview"> <item label="Standard Buttons" type="check" selected="true" /> <item label="Address Bar" type="check" selected="true" /> <item label="Links" type="check" selected="true" /> <item type="separator" /> <item label="Lock the Toolbars" type="check" selected="true" /> <item label="Customize…" /> </item> <item label="Type 1" /> - <item label="Type 2"> <item label="Search" type="check" /> <item label="Favorites" type="check" /> <item label="Media" type="check" /> <item label="History" type="check" /> <item label="Folders" type="check" /> </item> </item> - <item label="Options"> - <item label="Assistance"> <item label="On" type="radio" groupName="assistance" selected="true" /> <item label="Off" type="radio" groupName="assistance" selected="false" /> </item> <item type="separator" /> - <item label="Narration"> <item label="On" type="radio" groupName="narration" selected="true" /> <item label="Off" type="radio" groupName="narration" selected="false" /> </item> </item> - <item label="Help"> <item label="Contents and Index" /> <item type="separator" /> <item label="Check for Update" /> <item type="separator" /> <item label="About…" /> <item label="Program Support" /> </item> </menu> Last edited by AXXESS; 09-01-2005 at 01:40 PM. |
|
#2
|
||||
|
||||
|
The full path needs to be referenced within the XML, not the PC's directory structure and the items contained within the <> will be attributes so you will want to XML.SetAttribute. For instance;
XML.SetAttribute("menu/item:4/item:1/item:1", "selected", "false"); XML.SetAttribute("menu/item:4/item:1/item:2", "selected", "true"); The above is based on the file you posted, since all the strings are labled item, you have to specify which item number you want to modify. So the above will set item 4, item 1 and then item 1 to false and then item 4, item1, item 2 to true. I have created a tabed version posted below Code:
<?xml version="1.0" encoding="iso-8859-1" ?> - <menu lang="en"> - <item label="File"> <item label="Exit" /> </item> - <item label="Documents"> - <item label="Instructions"> <item label="Standard Buttons" /> <item label="Address Bar" /> <item label="Links" /> <item type="separator" /> <item label="Lock the Toolbars" /> </item> - <item label="Specifications"> <item label="Standard Buttons" /> <item label="Address Bar" /> <item label="Links" /> <item type="separator" /> <item label="Lock the Toolbars" /> </item> - <item label="References"> <item label="Standard Buttons" /> <item label="Address Bar" /> <item label="Links" /> <item type="separator" /> <item label="Lock the Toolbars" /> </item> </item> - <item label="Instruction"> - <item label="Overview"> <item label="Standard Buttons" type="check" selected="true" /> <item label="Address Bar" type="check" selected="true" /> <item label="Links" type="check" selected="true" /> <item type="separator" /> <item label="Lock the Toolbars" type="check" selected="true" /> <item label="Customize…" /> </item> <item label="Type 1" /> - <item label="Type 2"> <item label="Search" type="check" /> <item label="Favorites" type="check" /> <item label="Media" type="check" /> <item label="History" type="check" /> <item label="Folders" type="check" /> </item> </item> - <item label="Options"> menu/item:4 - <item label="Assistance"> menu/item:4/item:1 <item label="On" type="radio" groupName="assistance" selected="true" /> menu/item:4/item:1/item:1 <item label="Off" type="radio" groupName="assistance" selected="false" /> menu/item:4/item:1/item:2 </item> <item type="separator" /> - <item label="Narration"> <item label="On" type="radio" groupName="narration" selected="true" /> <item label="Off" type="radio" groupName="narration" selected="false" /> </item> </item> - <item label="Help"> <item label="Contents and Index" /> <item type="separator" /> <item label="Check for Update" /> <item type="separator" /> <item label="About…" /> <item label="Program Support" /> </item> </menu> Tigg
__________________
TJ-Tigger "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools." "Draco dormiens nunquam titillandus." Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine |
|
#3
|
||||
|
||||
|
Good call, Tigg!
|
|
#4
|
||||
|
||||
|
np glad it helped
__________________
TJ-Tigger "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools." "Draco dormiens nunquam titillandus." Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine |
![]() |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Why doesn't the file path work? | Intrigued | Developer's Den | 1 | 10-06-2004 11:55 PM |
| How do I add to my PATH statement at install? | Tnygaard | Setup Factory 6.0 | 3 | 05-27-2002 02:38 AM |
| Path problems in NT when executing file with spaces in path | tomarppe | Setup Factory 6.0 | 6 | 03-21-2002 03:01 PM |
| PATH environment variable | RDodson | Setup Factory 6.0 | 4 | 02-27-2002 01:17 PM |
All times are GMT -6. The time now is 10:27 PM.








Linear Mode

