xsl-list
[Top] [All Lists]

Re: [xsl] XSL and js comments (for Google AdSense)

2007-02-21 05:03:59

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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--