Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XML
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old October 9th, 2005, 06:24 AM
Registered User
Join Date: Oct 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default distinct-values in Javascript


who can I use the function 'distinct-values()' in an xPath expression with javascript? As I know this function is only available for xPath v2.0, but I could not find any option to tell javascript to use this version.


Old October 9th, 2005, 12:24 PM
mhkay's Avatar
Wrox Author
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts

Javascript doesn't have any built-in knowledge of XPath. Calling an XPath processor is just like calling any other bit of software: you have to find a bit of software that does what you want, and then work out how to invoke it. The software that's available depends on the environment you are running in: if it's Javascript within the Internet Explorer browser (client-side) then your choices are much more limited than in some other environments.

So you need to be a bit more explicit that just saying you're running Javascript.

It's true though, there aren't very many XPath 2.0 processors around at the moment, and most of them are probably easiest to use from Java applications.

Michael Kay
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
Old October 10th, 2005, 04:56 AM
Registered User
Join Date: Oct 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts

I found a work around.

Thanks, Jan

Similar Threads
Thread Thread Starter Forum Replies Last Post
List of Distinct values using xpath and javascript pnviv XSLT 4 November 5th, 2007 06:52 AM
getting distinct values from attribute markus2000 XSLT 1 June 13th, 2006 03:06 AM
count distinct values Chris Cash XSLT 3 June 8th, 2006 04:55 PM
Distinct values of data arnabghosh Access 18 September 13th, 2005 05:41 PM
DISTINCT ntext Values fleming SQL Server 2000 2 July 23rd, 2005 06:58 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.