Indigo Rose Software
  #1  
Old 09-01-2005
AXXESS's Avatar
AXXESS AXXESS is offline
Forum Member
 
Join Date: Nov 2001
Posts: 498
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.
Reply With Quote
  #2  
Old 09-01-2005
TJ_Tigger's Avatar
TJ_Tigger TJ_Tigger is offline
Indigo Rose Customer
 
Join Date: Sep 2002
Location: Sol 3
Posts: 3,188
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>
And you will have to do a XML.Save to write the XML information back to a file. The changes you made above were made in memory.

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
Reply With Quote
  #3  
Old 09-01-2005
AXXESS's Avatar
AXXESS AXXESS is offline
Forum Member
 
Join Date: Nov 2001
Posts: 498
Good call, Tigg! I was goofing around with both SetAttribute and SetValue for a couple hours... thanks for the help!
Reply With Quote
  #4  
Old 09-01-2005
TJ_Tigger's Avatar
TJ_Tigger TJ_Tigger is offline
Indigo Rose Customer
 
Join Date: Sep 2002
Location: Sol 3
Posts: 3,188
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
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


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.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright © 2000 - 2009 Indigo Rose Corporation. All rights reserved.
Indigo Rose Software