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

RE: XSLT: Are XML Comments parseable?

Subject: RE: XSLT: Are XML Comments parseable?
From: "Khorasani, Houman" <houman_khorasani@xxxxxxxxxxxxxx>
Date: Wed, 21 Sep 2005 12:41:35 +0100
xslt select comment
For some reason I kept thinking very complicated and still couldn't
understand what you guys mean.

But then Jenni Tennison's book about the comments made a "ding" in my
head. :o)

Now I understand; thank you guys very much.

Here is the solution for the archive:

<xsl:template match="/">
	<c><xsl:apply-templates select="comment()"/></c>
</xsl:template>

<xsl:template match="comment()">
	<xsl:value-of select="."/>
</xsl:template>


Regards,
Houman


-----Original Message-----
From: David Carlisle [mailto:davidc@xxxxxxxxx]
Sent: 20 September 2005 16:33
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re:  XSLT: Are XML Comments parseable?


> I do understand what guys are trying to say, yet it doesn't work.

You have done something rather different to what was suggested.

You no longer have a template matching comment() so when you do
		<xsl:apply-templates select="comment()"/>
the default template will be executed, which in the case of coment nodes
produces no output.

Then you generate a c element node and do
			<xsl:value-of select="."/>

. here is / ie the whole document, and value-of therefore produces the
string value of the document which is the concatenation of all
characters contained in any element (but not comments).


you want
<c><xsl:apply-templates select="comment()"/></c>

together with a template matching comment that does

<xsl:value-of select="."/>

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

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.