|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Ouput escaping / XPath
<xsl:message> <xsl:copy-of (or xsl:copy or whatever you need) select="."/> </xsl:message> <xsl:copy-of select="./child::node()"/> This obviously copies everything, even the comment. Apparently I would like to copy everything except the comment as to get the result: you never need to start an XPath with ./ (unless it starts with .//) and child:: is also the default so that is <xsl:copy-of select="node()"/> However you don't want to use copy-of at all as you do not want copies of the child nodes, youneed to transform them. So you want <xsl:apply-templates mode="copy"/> where mode="copy" is the identity transform, but just on elements and text: <xsl:template match="*" mode="copy"> <xsl:copy> <xsl:copy-of select="@*"/> <xsl:apply-templates mode="copy"/> </xsl:copy> </xsl:template> > The element() function seems to copy the comment > as well. What am I doing wrong here? If you copy an element node then the copy has exatly the same children as the original (or rather has copies of those children) so it has teh smae text, comments and child elements. 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 ________________________________________________________________________
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








