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

Re: Re: Newbie question--applying templates, selecting

Subject: Re: Re: Newbie question--applying templates, selecting paragraphs - SOLVED!!
From: "David N Bertoni/Cambridge/IBM" <david_n_bertoni@xxxxxxxxxx>
Date: Fri, 24 May 2002 11:42:30 -0700
appl grant
> The file below, adjusted per your recommendations, worked!! :)  Thank you
so
> much.
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet
>     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>     xmlns:xhtml="http://www.w3.org/1999/xhtml"
>     version="1.0">
> <xsl:output method="xml" encoding="UTF-8"/>
>            <xsl:template match="*|@*|text()|comment()">
>                        <xsl:copy>
>                                    <xsl:apply-templates
> select="*|@*|text()|comment()"/>
>                        </xsl:copy>
>            </xsl:template>
>            <xsl:template match="xhtml:div[@class='mgronly']"/>
> </xsl:stylesheet>
>
> May I ask one more question that will hopefully help me understand more
> about XSL?  I understand now why the xhtml namespace is necessary.  But I
> don't understand why adding the second template worked.  If the first one
> says "copy everything," the second one must somehow override or modify
the
> first.  But syntactically, I don't see how that is accomplished.

xsl:copy does not make a deep copy, it only copies the current node.  The
xsl:apply-templates element with the xsl:copy recursively processes any
descendants.  The second template is more specific, and therefore, has a
higher default priority, so it is chosen rather than the first one, if it
matches the current node.  For more info, see:

   http://www.w3.org/TR/xslt#conflict

Is there some reason you're not just using the expression "node() | @*",
instead of "*|@*|text()|comment()"?  Are you excluding processing
instructions on purpose?

Dave



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.