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

RE: Output input_xml apart from one tag change?

Subject: RE: Output input_xml apart from one tag change?
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Tue, 02 Oct 2007 12:21:37 -0400
RE:  Output input_xml apart from one tag change?
Scott,

At 11:50 AM 10/2/2007, you wrote:
Say you _don't_ know you want to copy them. I use it as a standard
identity template, because it allows me to do something like the
following afterward:

<xsl:template match="select[some condition]/@multiple"/>

Indeed: I thought I made that clear. My analysis wasn't intended to recommend one method over the other in the general case, just to clarify the tradeoffs, including the subtler ones that don't always make a difference.


For whatever reason, we human beings are quick to make value judgements where they're not necessary or useful. Something is not necessarily bad because it's different, but since we're naturally skittish about the unknown and about the risks that come with it, we often can't help but feel that way when trying to deal with something new. It's helpful when doing analysis to sort out all the options not because we learn which approaches are good or bad, but why a given approach may be good or bad in a given situation. Generalizing the "good/bad" thing is just substituting allergies for judgements.

FWIW, the match="node()|@*" variant (your favorite) is the one that appears in the XSLT spec. But experience shows it is rather mysterious for people whose XPath is weak, and for those who don't get the XSLT processing model. These are often the same people, which is doubly frustrating for them. Separating apart these two aspects of the problem often gives them a much easier way into seeing why the solution works (and seeing much else along with it). Until then it's just a magic spell at best.

One might also recommend

<xsl:template match="child::node() | attribute::node()">
  <xsl:copy>
    <xsl:apply-templates select="child::node() | attribute::node()"/>
  </xsl:copy>
</xsl:template>

... which would have the opposite set of virtues (and vices).

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.