What does this do: <xsl:apply-templates select="." /> ? 7 2032
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
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.
"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.
So the <xsl:apply-templates select="." /> part of the block does the
delegation of processing to the "normal" template (without mode
specified) then?
"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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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....
|
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>...
|
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...
|
by: allan |
last post by:
Hi
In the example below what does the '->' mean
$proc->importStyleSheet($xsl);
Cheers
Allan
|
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...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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...
|
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,...
|
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...
|
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...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |