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

Re: searching for occurrences of unique string-value a

Subject: Re: searching for occurrences of unique string-value and replacing with string value of another node
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Wed, 11 Jun 2008 11:52:26 -0400
Re:  searching for occurrences of unique string-value a
Julie,

At 10:40 AM 6/11/2008, you wrote:
>Assuming the context node is an element, that means all attributes of
>the element. Otherwise it means zero nodes (as only elements have
>attributes).

Okay, so in this case I don't think I understand the purpose of this
template. The context is matching all nodes on the attribute access OR
all child nodes of the context node, right? It is then applying
templates and selecting the exact same thing. Doesn't that mean there
*is* no context? Wouldn't the same thing be achieved by just calling a
match to the root?

<xsl:template match="/">

I tried removing this template from the stylesheet and I do still get
the same beautiful result (thanks Michael!).

As it happens, the template


<xsl:template match="@*|node()">
  <xsl:apply-templates select="@*|node()"/>
</xsl:template>

does almost the same thing as XSLT's built-in templates, which are used whenever a node is matched for which you have not provided a template. (It doesn't do exactly the same thing, but it has the same result. The built-in templates do not select attributes for processing, but if they are selected, their values get written. With this template, they are selected and matched, but their values never get written.)

So generally speaking, you can remove this template and get the same output.

Cheers,
Wendell


====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================

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.