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, 31 Jan 2008 12:19:45 +0100,    group: microsoft.public.xsl        back       


xsl:apply-templates   
I want to use the select function on apply-templates in order to do some 
search.

When there is a record found match the Select pattern, how can I determine 
which template (name) the apply-templates will call to display the data with 
HTML code in it?

Is there something like call-template which you can give the name of 
template to call?

Regards,
date: Thu, 31 Jan 2008 12:19:45 +0100   author:   guoqi zheng

Re: xsl:apply-templates   
guoqi zheng wrote:
> I want to use the select function on apply-templates in order to do some 
> search.
> 
> When there is a record found match the Select pattern, how can I determine 
> which template (name) the apply-templates will call to display the data with 
> HTML code in it?
> 
> Is there something like call-template which you can give the name of 
> template to call?

I don't understand what you are looking for. XSLT has two instructions, 
one is xsl:apply-templates which looks for a matching template, one is 
xsl:call-template which calls a template by its name. Those two 
instructions serve a different purpose.


-- 

	Martin Honnen --- MVP XML
	http://JavaScript.FAQTs.com/
date: Thu, 31 Jan 2008 14:24:41 +0100   author:   Martin Honnen

Re: xsl:apply-templates   
"guoqi zheng"  wrote in message
news:%23163zs$YIHA.5028@TK2MSFTNGP04.phx.gbl...
> I want to use the select function on apply-templates in order to do some
> search.
>
> When there is a record found match the Select pattern, how can I determine
> which template (name) the apply-templates will call to display the data
with
> HTML code in it?
>
> Is there something like call-template which you can give the name of
> template to call?
>

Normally the select path would select nodes that all have a specific name.
So typically you would use:-

<xsl:template match="nameOfTag">
. . .
</xsl:template>

If the path selects nodes with a variety of names, or you already have
templates mathing the 'nameOfTag' for other reasons, you can use the mode
attribute:-

<xsl:apply-templates select="myPath" mode="myMode" />

. . .

<xsl:template match="*" mode="myMode">
. . .
</xsl:template>


In this case only templates have the myMode mode value will be considered
hence your match can be a loose as * and yet only used for the specific
invocation to apply-templates.


-- 
Anthony Jones - MVP ASP/ASP.NET
date: Thu, 31 Jan 2008 13:30:22 -0000   author:   Anthony Jones

Re: xsl:apply-templates   
I think I figure it out now.

1. call-template will excute the name of the called template.
2. apply-templates will re-search for the right matching template using 
current selected node.


"Martin Honnen"  wrote in message 
news:uEfHlyAZIHA.4028@TK2MSFTNGP06.phx.gbl...
> guoqi zheng wrote:
>> I want to use the select function on apply-templates in order to do some 
>> search.
>>
>> When there is a record found match the Select pattern, how can I 
>> determine which template (name) the apply-templates will call to display 
>> the data with HTML code in it?
>>
>> Is there something like call-template which you can give the name of 
>> template to call?
>
> I don't understand what you are looking for. XSLT has two instructions, 
> one is xsl:apply-templates which looks for a matching template, one is 
> xsl:call-template which calls a template by its name. Those two 
> instructions serve a different purpose.
>
>
> -- 
>
> Martin Honnen --- MVP XML
> http://JavaScript.FAQTs.com/
date: Thu, 31 Jan 2008 14:48:14 +0100   author:   guoqi zheng

Google
 
Web ureader.com


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