Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
XML
data.xmlanalysis
mappoint.webservice
msf
msxml-webrelease
netmyservices.sdk
passport.sdk
soap
soapsdk
uddi.general
uddi.programming
uddi.specification
xml
xmlsqlwebrelease
xsl
  
 
date: Thu, 7 Aug 2008 14:50:16 -0700,    group: microsoft.public.xsl        back       


ends-with doesn't work   
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
date: Thu, 7 Aug 2008 14:50:16 -0700   author:   tshad

Re: ends-with doesn't work   
"tshad"  wrote in message 
news:ulySVeN#IHA.5192@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.
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
date: Fri, 8 Aug 2008 07:49:28 +0100   author:   Joe Fawcett am

Re: ends-with doesn't work   
"Joe Fawcett" <joefawcett@newsgroup.nospam> wrote in message 
news:%23nbXpLS%23IHA.4472@TK2MSFTNGP05.phx.gbl...
>
>
> "tshad"  wrote in message 
> news:ulySVeN#IHA.5192@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

> 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
date: Fri, 8 Aug 2008 09:58:02 -0700   author:   tshad

Re: ends-with doesn't work   
>>> 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.

-- 

Joe Fawcett (MVP - XML)
http://joe.fawcett.name
date: Sat, 9 Aug 2008 11:30:51 +0100   author:   Joe Fawcett am

Re: ends-with doesn't work   
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"  wrote in message 
news:ulySVeN%23IHA.5192@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
>
date: Sun, 10 Aug 2008 20:58:06 -0700   author:   Dimitre Novatchev

Re: ends-with doesn't work   
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!

> 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
date: Wed, 20 Aug 2008 18:23:38 -0700 (PDT)   author:   dman

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us