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

Re: Copy-per-default

Subject: Re: Copy-per-default
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Thu, 21 Apr 2011 11:43:07 -0400
Re:  Copy-per-default

On 4/21/2011 4:08 AM, Fredrik Bengtsson wrote:
Yeah, things work great now, albeit with a caveat or two (see my
e-mail to Florent Georges).

I understand the point you are making regarding the *|/ template. It
has its benefits, but I am sort of a control freak or perfectionist
if you will. For my part, I'd really prefer "whitelisting" the things
I want to happen and being meticulous in the pattern design. Someone
suggested adding a "null" template for d:book/d:info specifically
instead of for *, but that'd be a form of blacklisting and relies on
me knowing any and all possible subnode types today and for all time
to come....

If you want absolutely to control what you get, you can take the "pull" approach and select just the nodes you want. So if d:book has a d:body child that you want, and you want no others (no d:info or anything else), you say

<xsl:template match="d:book">
  <xsl:apply-templates select="d:body"/>

XSLT is actually really good for control freaks, because you can control what you want to control and what you leave your own mitts off of, relegating control to other parts of the system. Commonly, we rely on schemas and validation to handle the whitelisting part of the problem. This level of control and meta-control does require understanding the processing model and the overall system design.

"Use the Force, Luke".

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


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.
First Name
Last Name
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.