473,624 Members | 2,662 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

"Don't Search For Instructions Until..." statement?

VK
Let's say I have a rather big HTML template like

<?xml version="1.0" encoding="ISO-8859-1"?>
....
<snip>
....
<xsl:template match="/">
<html>
<!-- ...
A lot of HTML but no XSL so far
.... -->
<xsl:for-each select="reposit ory/item">
<!--
Here finally XSL comes into play
-->
</xsl:for-each>
....
</html>
</xsl:template>
</xsl:transform>

If I understand properly, XSL will still study each line after
<xsl:template match="/"> for XSL command wasting its time. Is there a
way to start output (thus use
<xsl:template match="/">) but postpone XSL parsing until some
predefined sequence? Namely I'm thinking of some kind of Perl
equivalent of single-quote print block like
print <<'EOT'
....
EOT

May 28 '06 #1
7 1260
VK wrote:
If I understand properly, XSL will still study each line after
<xsl:template match="/"> for XSL command wasting its time.


I suspect that isn't going to take a significant amount of time, but if
you insist on trying to avoid it -- move some of the literal content out
of the template into a stylesheet variable, and just insert its value.

Alternatively, switch to a compiled stylesheet system such as Xalan's
XSLTC support, which will probably optimize this automagically without
your having to do anything to the stylesheet.
May 29 '06 #2

VK wrote:
If I understand properly, XSL will still study each line after
<xsl:template match="/"> for XSL command wasting its time.


Yes, it's called "parsing".

In practice, parsing is typically the slowest part of building
server-side web output when loading a new stylesheet each time. So look
at an XSLT transform engine that allows you to cache this after loading
and re-use the same stylesheet next time. It's a useful saving.

May 30 '06 #3
Andy Dingley <di*****@codesm iths.com> wrote:
at an XSLT transform engine that allows you to cache this after loading
and re-use the same stylesheet next time. It's a useful saving.


Note that the TrAX APIs support this -- you can load a stylesheet once
(which is when stylesheet parsing generally occurs) and then invoke it
multiple times.
May 30 '06 #4
VK

Joe Kesselman wrote:
Andy Dingley <di*****@codesm iths.com> wrote:
at an XSLT transform engine that allows you to cache this after loading
and re-use the same stylesheet next time. It's a useful saving.


Note that the TrAX APIs support this -- you can load a stylesheet once
(which is when stylesheet parsing generally occurs) and then invoke it
multiple times.


Thanks to both of you.

Does enclosing non-XSL part of template into <xsl:text>... </xsl:text>
have an effect on parsing (speed)? Would be glad to be pointed to some
specs/test results.

May 31 '06 #5
VK wrote:
Does enclosing non-XSL part of template into <xsl:text>... </xsl:text>
have an effect on parsing (speed)?


I wouldn't expect xsl:text to make much difference in stylesheet
parse-and-interpret-or-compile speed.

Note that you can't use xsl:text to escape literal result elements; as
its name implies it's intended to give more explicit control over the
boundaries of character content.

I strongly suspect you're micro-optimizing the wrong part of your
problem. Have you run a performance analysis to find out where your
system is actually spending its time? As with any programming language,
rewriting a stylesheet can sometimes tremendously improve its performance.
May 31 '06 #6
VK

Joe Kesselman wrote:
I wouldn't expect xsl:text to make much difference in stylesheet
parse-and-interpret-or-compile speed.
ACK - but I'll still check with timers.
Note that you can't use xsl:text to escape literal result elements; as
its name implies it's intended to give more explicit control over the
boundaries of character content.
ACK
I strongly suspect you're micro-optimizing the wrong part of your
problem.


Actually I don't have any performance problems right at this moment.
I'm just thinking of some common technics (of they exists) for
optimisation of non-XSL part of templates.

May 31 '06 #7
VK wrote:
Actually I don't have any performance problems right at this moment.
I'm just thinking of some common technics (of they exists) for
optimisation of non-XSL part of templates.


The best ways to optimize those are to do so inside the XSLT processor
(a) compile the stylesheet, and (b) while you're at it, prepare blocks
of literal output so they can be dumped out relatively quickly.

--
() ASCII Ribbon Campaign | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry
May 31 '06 #8

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

Similar topics

4
1889
by: Troels F. Smit | last post by:
Where can I find information on implementing a search function on my site ? -- Mvh. Troels F. Smit
1
1335
by: Leu | last post by:
I like to search in the forum but I can't find the (in FAQ described) "search" link: "... To access the search feature, click on the "search" link at the top of most pages. ..." Where is the "search" link? Leu --
3
4199
by: Alastair | last post by:
Hello guys, I've been building a search facility for an intranet site I'm part of developing and we've been building a search engine using Index Server. It mostly works, however there have been a few niggling problems and fixing it seems to be a case of patching errors as we find them so I'm thinking that it might be worth starting the logic from scratch and rebuilding this again. Basically we have a simple search, which is simply a...
7
1488
by: Matt Kruse | last post by:
Javascript "Knowledge Base" Search: http://www.javascripttoolbox.com/search/ Responses to questions on this group are often along the lines of "did you read the FAQ" or "did you search the archives?" or "did you do a google search?". To regular readers and experienced javascript developers, knowing how and where to search and filtering out junk results is an easy task. For most javascript users, however, it's not so easy.
7
2003
by: veliscorin | last post by:
hi experts, the topic is rather misleading but i couldn't find a better way to phrase it.. here's my scenario: Table A: Products Table B: Attributes (with a product_id to show which product it belongs to) i need to join the 2 tables to get what i require, which is a html like so: Product A Attribute 1
5
1881
by: Tony Toews [MVP] | last post by:
I'm very upset with Google's policy of indexing and allowing Google advertising on forum web sites which are "slurping" content from Usenet and Microsoft newsgroup servers. http://msmvps.com/blogs/access/archive/2007/11/12/google-s-motto-quot-don-t-be-evil-quot-hogwash.aspx Tony -- Tony Toews, Microsoft Access MVP Please respond only in the newsgroups so that others can
1
2297
by: Nour469 | last post by:
Hello, I have a problem when I run search, I have fields for: name, clientID and phoneNo. When a client calls I need to find them in the database, they might give me the name and it might not be spelled correctly, I need to search by phoneNo. (the fastest way!) I place the cursor in the appropriate field and click search. when the find window opens up, by default, the Look in: field is: 'Main application form: form' and the 'search field...
0
8179
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8633
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8348
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
8493
tracyyun
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7176
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5570
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4187
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2613
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1797
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.