Indigo Rose Software
  #1  
Old 08-18-2005
NickT's Avatar
NickT NickT is offline
Indigo Rose Customer
 
Join Date: Aug 2005
Posts: 15
XML Get Attribute

Hi. Currently I am evaluating True Update for a project my company is working on. I have been impressed by its easy to use interface and strong features.

However, I am having trouble understanding how the XML.GetAttribute action works. I have an XML file that I need to read from. It's format is very similar to the one below. How would I extract the "Value" of the "ServerLocation" attribute?

serverPath = XML.GetAttribute("ItemSearchResponse/OperationRequest/Arguments/Argument Name", "Value");??

Quote:
<?xml version="1.0" encoding="UTF-8" ?>
<ItemSearchResponse>
<OperationRequest>
<Arguments>
<Argument Name="Service" Value="AWSECommerceService" />
<Argument Name="ItemPage" Value="11" />
<Argument Name="ServerLocation" Value="\\server\share" />
</Arguments>
</OperationRequest>
</ItemSearchResponse>
THANKS
  #2  
Old 08-18-2005
NickT's Avatar
NickT NickT is offline
Indigo Rose Customer
 
Join Date: Aug 2005
Posts: 15
Thumbs down Figured it out

I answered my own question
The code is:
serverPath = XML.GetAttribute("ItemSearchResponse/OperationRequest/Arguments/Argument Name:3", "Value");
  #3  
Old 08-18-2005
Corey's Avatar
Corey Corey is offline
Registered User
 
Join Date: Aug 2002
Posts: 9,746
Excellent! Thanks for posting your answer so others can benefit from it.
  #4  
Old 08-18-2005
Lorne's Avatar
Lorne Lorne is offline
Indigo Rose Staff Member
 
Join Date: Feb 2001
Location: Indigo Rose Software
Posts: 2,588
Quote:
Originally Posted by NickT
I answered my own question
The code is:
serverPath = XML.GetAttribute("ItemSearchResponse/OperationRequest/Arguments/Argument Name:3", "Value");
Careful...I think you should actually be using:
Code:
serverPath = XML.GetAttribute("ItemSearchResponse/OperationRequest/Arguments/Argument:3", "Value");
...since Name is an attribute, and the name of the element is "Argument" and not "Argument Name."
__________________
--[[ Indigo Rose Software Developer ]]
  #5  
Old 08-22-2005
NickT's Avatar
NickT NickT is offline
Indigo Rose Customer
 
Join Date: Aug 2005
Posts: 15
Hey - thanks for the reply!

Quote:
Originally Posted by Lorne
Careful...I think you should actually be using:
Code:
serverPath = XML.GetAttribute("ItemSearchResponse/OperationRequest/Arguments/Argument:3", "Value");
...since Name is an attribute, and the name of the element is "Argument" and not "Argument Name."
Your code does make more sense than mine. Oddly, when I retested both statements, they both produced the same result. However, I will change my code to the statement you suggested.
Thanks!
 

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
XML format TJ_Tigger AutoPlay Media Studio 5.0 6 10-04-2005 01:47 PM
Need help. How to add element to XML??? dmla AutoPlay Media Studio 5.0 5 11-10-2004 03:05 AM
XML plugin Project example - XML Weather from weather.com kpsmith AutoPlay Media Studio 5.0 8 06-03-2004 06:25 PM
Spotlight: XML Actions Plugin Desmond AutoPlay Media Studio 5.0 1 03-15-2004 04:56 PM
Using XML Or INI files during install djpyne Setup Factory 6.0 0 10-15-2003 11:55 AM


All times are GMT -6. The time now is 08:59 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