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

Re: XSL and js comments (for Google AdSense)

Subject: Re: XSL and js comments (for Google AdSense)
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 21 Feb 2007 12:02:38 GMT
Re:  XSL and js comments (for Google AdSense)
> What have I missed please?
 you missed comments:-)

 <xsl:template match='*|@*'>
that says to match elements and attributes (but not text, processing
instructions or comments)
so when you do
   <xsl:apply-templates select='node()|@*' />
you get the default templates for text, processing
instructions and comments, which copies text nodes but discards PIs and
comments.

Change
 <xsl:template match='*|@*'>

to
 <xsl:template match='node()|@*'>

Of course the real error is putting the javascript inside a comment in
the first place. In HTML clients the HTML engine still sees the
javascript as the <!-- is not actually a comment marker there , as
script has CDATA content so < is just a normal character, in (real)
XHTML systems thoug script has PCDATA content (as CDATA element type
does not exist in XML) so <!-- is a real comment and so it comments out
the javascript which would then not be passed to the javascript engine.

David

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-2011 All Rights Reserved.