472,334 Members | 2,238 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

What does this do: <xsl:apply-templates select="." />

KJ
What does this do: <xsl:apply-templates select="." /> ?

Jul 20 '05 #1
7 1955
KJ wrote:
What does this do: <xsl:apply-templates select="." /> ?

Applies the best matching template for the current context node.

Unless inside a for-each, it will cause infinite recursion...

Soren
Jul 20 '05 #2
KJ
If inside a template, such as:

<xsl:template match="para" mode="note">
<xsl:apply-templates select="." /><br />
</xsl:template>

Then does it only match para's inside notes? Or does it match para's
children also, or what? I didn't write this, only trying to understand
someone else's code.

Jul 20 '05 #3

"KJ" <n_**********@mail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
If inside a template, such as:

<xsl:template match="para" mode="note">
<xsl:apply-templates select="." /><br />
</xsl:template>

Then does it only match para's inside notes?
No, this template will only be selected for processing of a "para" element
if the corresponding xsl:apply-templates had its "mode" attribute set to
"note".

Once selected for processing it delegates this processing to the "normal"
template (without mode specified), that matches a "para".

This code may have been written when the author realised the need for a
special mode of processing "para"s but didn't have time to fully implement
it and as a first step just wrote the moded template as a wrapper of the
normal template.

Or such a template may include the normal processing and also do something
in addition (not shown in the above code) both before or after the normal
processing.
Or does it match para's
children also,
No.

Cheers,
Dimitre Novatchev

or what? I didn't write this, only trying to understand
someone else's code.

Jul 20 '05 #4
KJ
So the <xsl:apply-templates select="." /> part of the block does the
delegation of processing to the "normal" template (without mode
specified) then?

Jul 20 '05 #5

"KJ" <n_**********@mail.com> wrote in message
news:11*********************@o13g2000cwo.googlegro ups.com...
So the <xsl:apply-templates select="." /> part of the block does the
delegation of processing to the "normal" template (without mode
specified) then?


Yes
Jul 20 '05 #6
KJ
thanks so much to all

Jul 20 '05 #7
KJ <n_**********@mail.com> wrote:
What does this do: <xsl:apply-templates select="." /> ?


It produces an infinite loop.
http://www.w3.org/TR/xslt#section-Ap...Template-Rules

Greets
Andreas
--
Kraftl EDV - Dienstleistungen
Linux, Schulungen, Webprogrammierung, Webdesign
Telefon: +43(0)676/3533220
E-mail: An************@kraftl.at, Homepage: http://www.kraftl.at/
Jul 20 '05 #8

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

Similar topics

0
by: Lisa | last post by:
I need to apply the HTML formatting tags and the French accented characters in a XML document. The XML is generated from a database that has HTML...
4
by: Invalidlastname | last post by:
Hi, I have an XML document, created from ADO DataSet, which contains XML data in some nodes shown below: <NewDataSet> <Table> <field_name>My...
2
by: Paul Verbelen | last post by:
I have a file with topics. I like to copy them in another file but want to have some blank lines between the different topics. I use <xsl:text>...
2
by: allan | last post by:
Hi In the example below what does the '->' mean $proc->importStyleSheet($xsl); Cheers Allan
1
by: andrew_nuss | last post by:
Hi, Something mysterious has happened to my stylus studio project as I've added changes to the XSL file that renders html output. Before, the...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...

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.