Re: Beginners-problem with xpath filter and XML

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hello!

<?xml version="1.0"?>
<SiteSettings>
	<Settings Name="TitleText">
		<value>My homepage</value>
	</Settings>
</SiteSettings>

U use a datalist and a xmldatasource to display the data. The
xmldatasource lets me supply an xpath filter to display only the data I
want. As Im planning to expand this xml-file as I add more site
settings, I need an xpath that displays only the correct data. I am
trying to build an xpath that simply returns "My homepage" without the
node name or anything, but I am having a hard time making it work -
either it includes the "value" or simply doesn't show up at all..

Try this:

/SiteSettings/Settings[@Name = 'TitleText']/value/text()


-- Pascal Schmitt .