473,569 Members | 2,729 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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

Jul 20 '05 #1
7 2037
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_**********@m ail.com> wrote in message
news:11******** **************@ g44g2000cwa.goo glegroups.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_**********@m ail.com> wrote in message
news:11******** *************@o 13g2000cwo.goog legroups.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_**********@m ail.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 - Dienstleistunge n
Linux, Schulungen, Webprogrammieru ng, 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
1954
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 tags and French accented characters in the records. I have specified <xsl:output method="html"/> and encoding="iso-8859-1". When I apply the xsl:value-of and set the disable-output-escaping to...
4
3718
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 Selection</field_name> <field_type>dropdown</field_type> <field_choice_text>
2
1807
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> element with as data some blank lines to perform this. To clarify my question, I have add all the files required to perform the test. First question: Why doesn't this works anymore if I remove the...
2
1456
by: allan | last post by:
Hi In the example below what does the '->' mean $proc->importStyleSheet($xsl); Cheers Allan
1
1535
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 output included the <HEADand <BODYtags for the HTML output, even though I did nothing explictly to cause this. Now, they are missing in the HTML output. Is this a project setting in stylus studio,...
0
7695
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7612
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7922
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8119
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7668
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6281
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5509
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5218
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
1209
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.