Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2009
    Posts
    1

    XMLPath question

    When using the XML.GetAttribute/SetAttribute, I'm getting an error when I specify a path of "/configuration/appSettings/add[1]" it gives an error.

    I'm pretty sure that this is a valid XPath statement for the following XML:

    Code:
    <configuration>
       <appSettings>
          <add key="blah" value="fred was here" />
          <add key="yabba" value="wilma was here" />
          <add key="dabba" value="barney was here" />
       </appSettings>
    </configuration>
    What am I doing incorrectly?
    Thanks
    Paul.

  2. #2
    Join Date
    Apr 2005
    Location
    Ottawa, CA
    Posts
    27
    The XML paths in SU8 use a slightly different syntax. What you need is

    "configuration/appSettings/add:1"

    Note that there's no leading slash, since the path is always assumed to start from the root.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts