Windows Live Agents: Reading XML element attributes

One missing feature of the Windows Live Agents SDK, at least on the documentation, was the hability to read xml element properties.

Being so oriented to XML parsing and handling it should be possible... So by digging in the old SDK forums I found it.

Having this sample XML:

<?xml version="1.0" encoding="utf-8" ?>
<user id="1" name="Kartones">

<language>Spanish</language>
<location>Spain</location>
</user>

In order to access element properties (id and name in the example) we just have to add a @ when creating the datasource and specifying its name:

datasource UserXML(FILEPATH) => ID, NAME, LANGUAGE, LOCATION
file
FILEPATH
simple xml
user
@id
@name
language
location

Simple but not mentioned in the current documentation ;)

P.S.:By the way, seems that Windows Live Messenger 9 Betas are out, you can see some of the cool stuff it will include at Liveside (I like the custom sounds and multiple sign-out options).

P.S.2: I've been a bit out because I was last week at Microsoft UK at a partner Windows Live Agents training. As most of the content was "restricted/confidential" I will just say that the new SDK is quite interesting (Visual Studio integrated, and with new features) and that more changes are on the way. Next months are going to be very entertaining :)

Posted by Kartones on 2007-12-16

Comments?

Share via: Twitter Linkedin Google+ Facebook