[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Comment nodes in XSLT files.

Subject: RE: Comment nodes in XSLT files.
From: "M. David Peterson" <m.david@xxxxxxxxxx>
Date: Mon, 12 Apr 2004 11:22:17 -0600
multiline comment in xsl
This would definitely be a question better answered by Michael Kay or
one of the handful of other list members who have two helpings of Saxon
for every one helping of Wheatabix each morning :)  But I do know that
from a coding standpoint you have to explicitly call for the comment()
nodes if you want to include them in your transform where as * will
implicitly select every element within its scope while ignoring comments
like they were nothing more than a few dead pixels on the TFT. Heck,
just to get "*" to agree to ride in the same car with a comment() he/she
demands a divider to be placed between them ;) <xsl:apply-template
select="* | comment()"/> ...

So what does this have to do with anything? :)  That's a good
question...  I guess what I am suggesting is that because they are not
implicitly part of the "select everything" selector "*" and to gain
access you have to explicitly ask for them then I would logically
conclude that the processor normally ignores them unless asked
otherwise.

This logic does have a hole in it considering the fact that we know the
processor is on a constant mission to find the next "<" sign indicating
that for every new comment line declared the processor is going to stop,
however brief the layover may be, and check out whats directly on the
other side before continuing on its way.  If this logic is true then it
would be suffice to say that wrapping multi line comments with one set
of <!-- --> tags could potentially show drastic performance increase on
documents laden heavily with single line comment entries.

But again, the person to speak to this question and settle the "debate"
once and for all would be Michael Kay if he's still around for the day
(its 7pm over in GMT+1... If not there are several other members who
will no doubt pick up this thread before the day is through and be able
to answer your question with near if not the same authority.  Ill
definitely be keeping an eye out as im interested to hear what the
actual technical answer turns out to be.

Best of luck!

<M:D/>

-----Original Message-----
From: Greg Alvord [mailto:Greg.Alvord@xxxxxxxxxxxxxxx] 
Sent: Monday, April 12, 2004 10:08 AM
To: 'xsl-list@xxxxxxxxxxxxxxxxxxxxxx'
Subject:  Comment nodes in XSLT files.

Traditionally comments in Interpreted language files slows things down.
It
there any practical experience with the impact of comment nodes in the
XSLT
files, or best practice guidance?
 
I would like to find the balance point between too much and too little.

 
We have also considered an XSLT comment scrubber between the saved
source
and the published source.  It would be easy to build, but if the runtime
impact of leaving the comments in place is sufficiently small why
introduce
all the other headaches?
 
I think the answer varies from one XSLT processor to another.  My
particular
interest is in .NET ( don't flame me please) but I have an interest in
other
processors as well.
 
 
Greg Alvord

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.