473,320 Members | 2,146 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

call-template name?

Is it possible to, for example:

<xsl:variable name="thetemplate"
test="props/prop[@key='templatestyle']/@value"/>
<xsl:call-template name="$thetemplate"/>

I tried {$template} as well. Comes back as invalid qname. Just curious if
it is possible. If not I will use a choose construct.

Cheers
Keith Chadwick
Nov 12 '05 #1
4 1540

"Keith Chadwick" <kchadwick[nospam]@leewardsystems.com> wrote in message
news:Oh**************@TK2MSFTNGP09.phx.gbl...
Is it possible to, for example:

<xsl:variable name="thetemplate"
test="props/prop[@key='templatestyle']/@value"/>
<xsl:call-template name="$thetemplate"/>

I tried {$template} as well. Comes back as invalid qname. Just curious if
it is possible. If not I will use a choose construct.


This is definitely not possible in XSLT, because the value of the "name"
attribute of xsl:call-template must be a QName (a string constant,
statically known).

What you want can be done using another mechanism (generic templates and
template references based on xsl:apply-templates and namespaces)

Read more about this on the home page of FXSL (functional programming
library for XSLT):

http://fxsl.sf.net
The first two articles are essential for understanding the rest.

Another useful material is the text (and the ppt) of the presentation I made
in August at the Extreme Markup Languages conference in Montreal:
http://www.idealliance.org/papers/ex...ovatchev01.pdf

and

http://www.idealliance.org/papers/ex...ovatchev01.zip

=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL
Nov 12 '05 #2
Thanks Dimitre,

I gave the whole thing a good read through and it resulted in some
interesting ideas for my current project. I understand what you are trying
to say in the documents and like anything in this field there are always
several ways of getting a result. I would personally fall back on
JScript/msxsl to provide some mathematical functionality versus writing it
in pure xsl but that is only because of my comfort level in JScript.

Thing I will start adding my 2 cents into the w3.org xslt working
drafts/discussion groups.

As always thanks
Keith Chadwick

"Dimitre Novatchev" <dn********@yahoo.com> wrote in message
news:br************@ID-152440.news.uni-berlin.de...

"Keith Chadwick" <kchadwick[nospam]@leewardsystems.com> wrote in message
news:Oh**************@TK2MSFTNGP09.phx.gbl...
Is it possible to, for example:

<xsl:variable name="thetemplate"
test="props/prop[@key='templatestyle']/@value"/>
<xsl:call-template name="$thetemplate"/>

I tried {$template} as well. Comes back as invalid qname. Just curious if it is possible. If not I will use a choose construct.
This is definitely not possible in XSLT, because the value of the "name"
attribute of xsl:call-template must be a QName (a string constant,
statically known).

What you want can be done using another mechanism (generic templates and
template references based on xsl:apply-templates and namespaces)

Read more about this on the home page of FXSL (functional programming
library for XSLT):

http://fxsl.sf.net
The first two articles are essential for understanding the rest.

Another useful material is the text (and the ppt) of the presentation I

made in August at the Extreme Markup Languages conference in Montreal:
http://www.idealliance.org/papers/ex...ovatchev01.pdf
and

http://www.idealliance.org/papers/ex...ovatchev01.zip
=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL

Nov 12 '05 #3

"Keith Chadwick" <kchadwick[nospam]@leewardsystems.com> wrote in message
news:eB**************@TK2MSFTNGP09.phx.gbl...
Thanks Dimitre,

I gave the whole thing a good read through and it resulted in some
interesting ideas for my current project. I understand what you are trying to say in the documents and like anything in this field there are always
several ways of getting a result. I would personally fall back on
JScript/msxsl to provide some mathematical functionality versus writing it
in pure xsl but that is only because of my comfort level in JScript.

Thing I will start adding my 2 cents into the w3.org xslt working
drafts/discussion groups.

As always thanks
Keith Chadwick


Keith,

If you need the ability to use functions as first class objects only for
implementing mathematical functions, then there are at least two ways that
are better (meaning that are still portable) than writing extension
functions in JScript:

1. Use EXSLT

2. Use the math templates of FXSL

In both cases you don't have to implement anything -- just call the
functios/templates.

FXSL is available for XSLT 2.0 too and most templates are actually
xsl:functions in XSLT 2.0, which adds more convenience in using FXSL
functions in XPath expressions.
On the other side, in case you need to implement math functionality that is
not provided by FXSL or EXSLT, I'd love to hear what are your needs.
=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL
Nov 12 '05 #4
The current section of code I am working on, registration, is fairly simple
but very long due to down level browser compliance and other similar issues.
When I move onto the registration wizard and administration component .net
migration I will most definitely be looking into EXSLT and FXSL.

I must admit that I find it difficult figuring out how everything fits
together with ASP.NET. In other words when is it appropriate to use
technology A in implementation B and so on. I realize that there is always
trade offs but the trick is of course is to make sure the trade offs are not
the ones you really needed for the implementation and that takes a lot of
research. That is the real problem, having lived in MSDN for longer than I
can remember, I find the documentation on integration very very lacking.
For instance the MS Xpath extensions listed under msxml4 are not supported
via .Net but it is not evidently documented.

I guess in another year of doing this it will all become evident but at this
point the learning curve is rather bumpy!

Cheers
Keith

PS: Thanks for your help and input as always

"Dimitre Novatchev" <dn********@yahoo.com> wrote in message
news:br************@ID-152440.news.uni-berlin.de...

"Keith Chadwick" <kchadwick[nospam]@leewardsystems.com> wrote in message
news:eB**************@TK2MSFTNGP09.phx.gbl...
Thanks Dimitre,

I gave the whole thing a good read through and it resulted in some
interesting ideas for my current project. I understand what you are trying
to say in the documents and like anything in this field there are always
several ways of getting a result. I would personally fall back on
JScript/msxsl to provide some mathematical functionality versus writing it in pure xsl but that is only because of my comfort level in JScript.

Thing I will start adding my 2 cents into the w3.org xslt working
drafts/discussion groups.

As always thanks
Keith Chadwick


Keith,

If you need the ability to use functions as first class objects only for
implementing mathematical functions, then there are at least two ways that
are better (meaning that are still portable) than writing extension
functions in JScript:

1. Use EXSLT

2. Use the math templates of FXSL

In both cases you don't have to implement anything -- just call the
functios/templates.

FXSL is available for XSLT 2.0 too and most templates are actually
xsl:functions in XSLT 2.0, which adds more convenience in using FXSL
functions in XPath expressions.
On the other side, in case you need to implement math functionality that

is not provided by FXSL or EXSLT, I'd love to hear what are your needs.
=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL

Nov 12 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Marwan | last post by:
Hello I am using asynchronous delegates to make a call to a COM ActiveX object, but even though the call occurs on a separate thread, my UI is still blocking. If i put the thread to sleep in my...
13
by: Bern McCarty | last post by:
I have run an experiment to try to learn some things about floating point performance in managed C++. I am using Visual Studio 2003. I was hoping to get a feel for whether or not it would make...
4
by: John | last post by:
Hi all, This really is quite an urgent matter. I have a page with multiple, dynamically-loaded user controls and when a user clicks on a button, the whole form is submitted. Now at this stage...
5
by: Amaryllis | last post by:
I'm trying to call a CL which is located on our AS400 from a Windows application. I've tried to code it in different ways, but I seem to get the same error every time. Does anyone have any clue...
13
by: mitchellpal | last post by:
i am really having a hard time trying to differentiate the two..........i mean.....anyone got a better idea how each occurs?
7
by: archana | last post by:
Hi all, I am having application in which i am doing asynchronous call.I am using manualresetevent to wait for asynchronous call to complete. I want to stop asynchronous call after certain...
46
by: Steven T. Hatton | last post by:
I just read §2.11.3 of D&E, and I have to say, I'm quite puzzled by what it says. http://java.sun.com/docs/books/tutorial/essential/concurrency/syncrgb.html <shrug> -- NOUN:1. Money or...
9
by: CryptiqueGuy | last post by:
Consider the variadic function with the following prototype: int foo(int num,...); Here 'num' specifies the number of arguments, and assume that all the arguments that should be passed to this...
12
by: Rahul | last post by:
Hi Everyone, I have the following code and i'm able to invoke the destructor explicitly but not the constructor. and i get a compile time error when i invoke the constructor, why is this so? ...
275
by: Astley Le Jasper | last post by:
Sorry for the numpty question ... How do you find the reference name of an object? So if i have this bob = modulename.objectname() how do i find that the name is 'bob'
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.