Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ends-with doesn't work

831 views
Skip to first unread message

tshad

unread,
Aug 7, 2008, 5:50:16 PM8/7/08
to
I am using Visual Studio 2005 and ends-with doesn't work there.

I am trying:

not((starts-with(name(), 'GC') or (starts-with(name(), 'CC')) and
ends-with(name(),'-POUND-') and

and I get an error:

ends-with() is an unknown XSLT function.

But when I look it up, it is there in various places, such as:

http://www.w3schools.com/Xpath/xpath_functions.asp#string

Does 2005 use a different version of XSLT?

Thanks,

Tom


Joe Fawcett

unread,
Aug 8, 2008, 2:49:28 AM8/8/08
to

"tshad" <ts...@dslextreme.com> wrote in message
news:ulySVeN#IHA....@TK2MSFTNGP04.phx.gbl...

'ends-with' is XPath 2.0, therefore, for all practical purposes, you need an
XSLT 2.0 processor. None of Microsoft's products support version 2.0.
You can either re-write your XSLT of use Saxon which has a free .NET
version. You won't ,however, be able to debug in Visual Studio, you'll need
to use something like Altova XML Spy.

--

Joe Fawcett (MVP - XML)
http://joe.fawcett.name

tshad

unread,
Aug 8, 2008, 12:58:02 PM8/8/08
to

"Joe Fawcett" <joefa...@newsgroup.nospam> wrote in message
news:%23nbXpLS%23IHA...@TK2MSFTNGP05.phx.gbl...

>
>
> "tshad" <ts...@dslextreme.com> wrote in message
> news:ulySVeN#IHA....@TK2MSFTNGP04.phx.gbl...
>> I am using Visual Studio 2005 and ends-with doesn't work there.
>>
>> I am trying:
>>
>> not((starts-with(name(), 'GC') or (starts-with(name(), 'CC')) and
>> ends-with(name(),'-POUND-') and
>>
>> and I get an error:
>>
>> ends-with() is an unknown XSLT function.
>>
>> But when I look it up, it is there in various places, such as:
>>
>> http://www.w3schools.com/Xpath/xpath_functions.asp#string
>>
>> Does 2005 use a different version of XSLT?
>>
>> Thanks,
>>
>> Tom
>>
> 'ends-with' is XPath 2.0, therefore, for all practical purposes, you need
> an XSLT 2.0 processor. None of Microsoft's products support version 2.0.

Are they planning to?

Thanks,

Tom

Joe Fawcett

unread,
Aug 9, 2008, 6:30:51 AM8/9/08
to
>>> Tom
>>>
>> 'ends-with' is XPath 2.0, therefore, for all practical purposes, you need
>> an XSLT 2.0 processor. None of Microsoft's products support version 2.0.
>
> Are they planning to?
>
> Thanks,
>
> Tom
>
Yes, but no timescales announced.

Dimitre Novatchev

unread,
Aug 10, 2008, 11:58:06 PM8/10/08
to
As others have explained, the Microsoft XSLT processors do not support XSLT
2.0.

A workaround is to use the following XPath expression (or to wrap it in a
named template):

$pPattern
=
substring
($pString,
string-length($pString) - string-length($pPattern)+1
)


Cheers,
Dimitre Novatchev

"tshad" <ts...@dslextreme.com> wrote in message

news:ulySVeN%23IHA...@TK2MSFTNGP04.phx.gbl...

dman

unread,
Aug 20, 2008, 9:23:38 PM8/20/08
to
Thanks heaps for that - I just came looking for such a pattern, and
your post solved it immediately.
I could have experimented and done it myself, but cut&paste is so much
easier!

santh thomas

unread,
Feb 15, 2012, 11:59:37 PM2/15/12
to
Great.This works.

Thanks
Santh

> On Thursday, August 07, 2008 5:50 PM tshad wrote:

> I am using Visual Studio 2005 and ends-with doesn't work there.
>
> I am trying:
>
> not((starts-with(name(), 'GC') or (starts-with(name(), 'CC')) and
> ends-with(name(),'-POUND-') and
>
> and I get an error:
>
> ends-with() is an unknown XSLT function.
>
> But when I look it up, it is there in various places, such as:
>
> http://www.w3schools.com/Xpath/xpath_functions.asp#string
>
> Does 2005 use a different version of XSLT?
>
> Thanks,
>
> Tom


>> On Friday, August 08, 2008 2:49 AM Joe Fawcett wrote:

>> "tshad" <ts...@dslextreme.com> wrote in message
>> news:ulySVeN#IHA....@TK2MSFTNGP04.phx.gbl...
>> 'ends-with' is XPath 2.0, therefore, for all practical purposes, you need an
>> XSLT 2.0 processor. None of Microsoft's products support version 2.0.
>> You can either re-write your XSLT of use Saxon which has a free .NET
>> version. You won't ,however, be able to debug in Visual Studio, you'll need
>> to use something like Altova XML Spy.
>>
>> --
>>
>> Joe Fawcett (MVP - XML)
>> http://joe.fawcett.name


>>> On Friday, August 08, 2008 12:58 PM tshad wrote:

>>> Are they planning to?
>>>
>>> Thanks,
>>>
>>> Tom


>>>> On Saturday, August 09, 2008 6:30 AM Joe Fawcett wrote:

>>>> Yes, but no timescales announced.
>>>>
>>>> --
>>>>
>>>> Joe Fawcett (MVP - XML)
>>>> http://joe.fawcett.name


>>>>> On Sunday, August 10, 2008 11:58 PM Dimitre Novatchev wrote:

>>>>> As others have explained, the Microsoft XSLT processors do not support XSLT
>>>>> 2.0.
>>>>>
>>>>> A workaround is to use the following XPath expression (or to wrap it in a
>>>>> named template):
>>>>>
>>>>> $pPattern
>>>>> =
>>>>> substring
>>>>> ($pString,
>>>>> string-length($pString) - string-length($pPattern)+1
>>>>> )
>>>>>
>>>>>
>>>>> Cheers,
>>>>> Dimitre Novatchev
>>>>>
>>>>> "tshad" <ts...@dslextreme.com> wrote in message
>>>>> news:ulySVeN%23IHA...@TK2MSFTNGP04.phx.gbl...


0 new messages